Skip to content

task management overview ​

Video, digital human, music, partial pictures and reprocessing capabilities are run in asynchronous tasks. After task, MoonNexAI returns task ID; you can either ask for information or receive a completion notification via WebHOK.

Common process ​

  1. Submit task.
  2. Saves returned task_id or id.
  3. Actively query task status, or wait for Webhook.
  4. task reads the URL after success.
  5. task was read when fail_reason, error.code and error.message failed.

Common Query Entry ​

CapacityQuery Path
Universal taskGET /v1/tasks/{task_id}
Music taskGET /v1/tasks/{task_id}
digital human AudioGET /v1/tasks/{task_id}
digital human VideoGET /v1/tasks/{task_id}
Video taskGET /v1/videos/{task_id}
Midjourney taskGET /mj/task/{id}/fetch

Status statement ​

StatusAnnotationsRecommendations
pendingSystems are in preparation.Further queries will be made later.
submittedSubmitted, pending processing.Further queries will be made later.
runningProcessing.Keep waiting.
succeededAchieved.Reads the URL of the result.
failedtask failed.See the reason for the failure and decide whether to try again.
cancelledtask cancelled.Stops the query.

Some tasks return uppercase states such as SUBMITTED, QUEUED, IN_PROGRESS, SUCCESS and FAILURE. Your application can normalize these to waiting, processing, succeeded and failed.

Webhook Recommendations ​

  • Your webhook endpoint should return 2xx within 10 seconds.
  • Press task_id for processing, etc.
  • Do not place API Key, user token or other sensitive information in callback URL.
  • Even if Webhook is enabled, the active search capability is maintained.

Relevant Pages ​