Task Center Module¶
Feature Description
The API prefix is uniformly http(s)://<your-domain>
HTTPS should be used in production environments to secure authentication tokens. HTTP is only recommended for development environments.
General asynchronous task management system. Primarily supports music generation tasks for platforms like Suno. Includes mechanisms such as automatic task status updates, failure retry, and quota refund.
🔐 User Authentication¶
Get My Tasks¶
- Interface Name: Get My Tasks
- HTTP Method: GET
- Path:
/api/task/self - Authentication Required: User
- Function Description: Paginated retrieval of the current user's task list, supporting filtering by platform, Task ID, status, and other conditions.
💡 Request Example:
const response = await fetch('/api/task/self?p=1&page_size=20&platform=suno&task_id=task123&status=SUCCESS&action=song&start_timestamp=1640908800&end_timestamp=1640995200', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_user_token',
'New-Api-User': 'your_user_id'
}
});
const data = await response.json();
✅ Successful Response Example:
{
"success": true,
"message": "",
"data": {
"items": [
{
"id": 1,
"created_at": 1640908800,
"updated_at": 1640909000,
"task_id": "task123456",
"platform": "suno",
"user_id": 1,
"quota": 1000,
"action": "song",
"status": "SUCCESS",
"fail_reason": "",
"submit_time": 1640908800,
"start_time": 1640908900,
"finish_time": 1640909000,
"progress": "100%",
"properties": {},
"data": {}
}
],
"total": 25,
"page": 1,
"page_size": 20
}
}
❗ Failure Response Example:
🧾 Field Description (Request Parameters):
p(Number): Page number, default is 1page_size(Number): Items per page, default is 20platform(String): Task platform, optionaltask_id(String): Task ID filter, optionalstatus(String): Task status filter, optional values: "NOT_START", "SUBMITTED", "QUEUED", "IN_PROGRESS", "FAILURE", "SUCCESS", "UNKNOWN"action(String): Task type filter, e.g., "song", "lyrics", etc.start_timestamp(Number): Start timestamp, optionalend_timestamp(Number): End timestamp, optional
🧾 Return Field Description:
id(Number): Database record IDtask_id(String): Third-party Task IDplatform(String): Task platformuser_id(Number): User IDquota(Number): Quota consumedaction(String): Task typestatus(String): Task statusfail_reason(String): Failure reasonsubmit_time(Number): Submission timestampstart_time(Number): Start timestampfinish_time(Number): Completion timestampprogress(String): Progress percentageproperties(Object): Task propertiesdata(Object): Task result datatotal(Number): Total number of matching task recordspage(Number): Current returned page numberpage_size(Number): Number of task records displayed per page
🔐 Administrator Authentication¶
Get All Tasks¶
- Interface Name: Get All Tasks
- HTTP Method: GET
- Path:
/api/task/ - Authentication Required: Administrator
- Function Description: Paginated retrieval of all tasks in the system, supporting filtering by Channel ID, platform, User ID, and other conditions.
💡 Request Example:
const response = await fetch('/api/task/?p=1&page_size=20&channel_id=1&platform=suno&task_id=task123&status=SUCCESS&action=song&start_timestamp=1640908800&end_timestamp=1640995200', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_admin_token',
'New-Api-User': 'your_user_id'
}
});
const data = await response.json();
✅ Successful Response Example:
{
"success": true,
"message": "",
"data": {
"items": [
{
"id": 1,
"created_at": 1640908800,
"task_id": "task123456",
"platform": "suno",
"user_id": 1,
"channel_id": 1,
"quota": 1000,
"action": "song",
"status": "SUCCESS",
"submit_time": 1640908800,
"finish_time": 1640909000,
"progress": "100%",
"data": {}
}
],
"total": 100,
"page": 1,
"page_size": 20
}
}
❗ Failure Response Example:
🧾 Field Description (Request Parameters):
p(Number): Page number, default is 1page_size(Number): Items per page, default is 20channel_id(String): Channel ID filter, optionalplatform(String): Task platform filter, optionaltask_id(String): Task ID filter, optionalstatus(String): Task status filter, optionalaction(String): Task type filter, optionalstart_timestamp(Number): Start timestamp, optionalend_timestamp(Number): End timestamp, optional-
Return fields include all fields from user tasks, plus the following addition:
channel_id(Number): Used Channel ID