Skip to main content
GET
/
producer
/
tasks
查询任务状态
curl --request GET \
  --url https://api.mountsea.ai/producer/tasks \
  --header 'Authorization: Bearer <token>'
{
  "taskId": "<string>",
  "status": "pending",
  "result": {},
  "errorMessage": "<string>",
  "errorCode": 123,
  "finishedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "traceId": "<string>"
}
Query the status and results of a task by its ID. Use this endpoint to poll for task completion.

Query Parameters

taskId
string
required
The task ID returned from previous API calls.

Response

taskId
string
The task ID.
status
string
Current task status.
StatusDescription
pendingTask is waiting to be processed
readyTask is ready to start
assignedTask has been assigned to a worker
processingTask is being processed
completedTask completed successfully
failedTask failed
cancelledTask was cancelled
timeoutTask timed out
result
object
Task result data. Structure varies by task type. Only present when status is completed.
errorMessage
string
Error message if the task failed.
errorCode
number
Error code if the task failed.
finishedAt
string
ISO 8601 timestamp when the task finished.
createdAt
string
ISO 8601 timestamp when the task was created.
traceId
string
Trace ID for debugging.

Example

curl -X GET "https://api.mountsea.ai/producer/tasks?taskId=abc123-def456-ghi789" \
  -H "Authorization: Bearer your-api-key"

Response Example

{
  "taskId": "abc123-def456-ghi789",
  "status": "completed",
  "result": {
    "audioId": "9719e086-576a-4830-a0f2-7c9424460d6d",
    "audioUrl": "https://cdn.example.com/audio.mp3",
    "duration": 180,
    "title": "Summer Vibes"
  },
  "finishedAt": "2025-02-06T10:30:00.000Z",
  "createdAt": "2025-02-06T10:25:00.000Z",
  "traceId": "trace-xyz789"
}
Polling Strategy: Start with a 5-second interval. For long-running tasks, consider implementing exponential backoff.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

taskId
string
required

任务ID

Response

200 - application/json

任务状态

taskId
string
required

任务 ID

status
enum<string>
required

任务状态

Available options:
pending,
ready,
assigned,
processing,
completed,
failed,
cancelled,
timeout
result
object

任务结果(直接透传协议层返回,类型根据任务类型不同而变化)

errorMessage
string

错误信息

errorCode
number

错误代码

finishedAt
string<date-time>

完成时间

createdAt
string<date-time>

创建时间

traceId
string

追踪 ID