This document provides detailed information about the Back.Serv REST API endpoints.
All API URLs are relative to: http://your-server:4093/
Currently, the API uses a simple user_id system. Future versions may implement more robust authentication.
Submit a new task for processing.
POST /submit_task
Content-Type: application/json
{
"task_type": string,
"task_params": object,
"user_id": string
}
task_type
(required): Type of task to execute- Possible values: "image_creation", "image_upscale", "face_swap", "video_creation"
task_params
(required): Parameters specific to the task typeuser_id
(required): Identifier for the user submitting the task
{
"ticket_id": "string",
"serv_name": "string",
"status": "Queueing"
}
curl -X POST http://localhost:4093/submit_task \
-H "Content-Type: application/json" \
-d '{
"task_type": "image_creation",
"task_params": {
"prompt": "a beautiful sunset"
},
"user_id": "user123"
}'
Get the current status of a task.
GET /query_task/<ticket_id>
ticket_id
(required): The ID of the task to query
{
"status": "string",
"result_info": "string",
"error_info": "string",
"started_at": "datetime",
"completed_at": "datetime"
}
curl http://localhost:4093/query_task/abc123
Cancel a running or queued task.
POST /cancel_task/<ticket_id>
ticket_id
(required): The ID of the task to cancel
{
"status": "Cancelled",
"message": "Task successfully cancelled"
}
curl -X POST http://localhost:4093/cancel_task/abc123
{
"task_type": "image_creation",
"task_params": {
"prompt": "string",
"negative_prompt": "string",
"width": integer,
"height": integer
}
}
{
"task_type": "image_upscale",
"task_params": {
"image_url": "string",
"scale_factor": integer
}
}
{
"task_type": "face_swap",
"task_params": {
"source_image": "string",
"target_image": "string"
}
}
{
"task_type": "video_creation",
"task_params": {
"prompt": "string",
"duration": integer,
"fps": integer
}
}
The API uses standard HTTP response codes:
- 200: Success
- 202: Accepted (for task submission)
- 400: Bad Request
- 404: Not Found
- 500: Internal Server Error
Error responses include a message explaining the error:
{
"error": "string",
"message": "string"
}