> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Task

> Query task status and results

Query the current status and generation results of a task by `taskId`.

<ParamField path="taskId" type="string" required>
  The task ID returned when the task was submitted.
</ParamField>

### Response Fields

<ResponseField name="code" type="integer">
  Status code. `0` indicates success.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="taskId" type="string">
      Task ID.
    </ResponseField>

    <ResponseField name="status" type="string">
      Task status: `PENDING`, `PROCESSING`, `SUBMITTED`, `SUCCESS`, `FAILURE`, `TIMEOUT`, `CANCELLED`.
    </ResponseField>

    <ResponseField name="input" type="object">
      The complete input parameters submitted with the task (including model).
    </ResponseField>

    <ResponseField name="result" type="object">
      Task result. Only has a value when status is `SUCCESS`; for other terminal states it is `null`.

      <Expandable title="properties">
        <ResponseField name="type" type="string">
          Result type: `image` or `video`.
        </ResponseField>

        <ResponseField name="urls" type="string[]">
          List of URLs for the generated resources. Images may have multiple URLs; videos typically have 1.

          <Warning>URLs expire after **7 days**. Please download files promptly.</Warning>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="failure_reason" type="string | null">
      Machine-readable failure classification. Always present; `null` when no specific actionable reason applies.

      | Value                 | Meaning                                                                                                     | Recommended Action                                       |
      | --------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
      | `CONTENT_MODERATION`  | Prompt or image rejected due to real human faces, copyrighted characters or public figures, or NSFW content | Notify the user; **do not retry**                        |
      | `INVALID_PARAMETERS`  | Submitted parameters are invalid                                                                            | Fix request parameters; **do not retry until corrected** |
      | `INSUFFICIENT_POINTS` | Account has insufficient credits                                                                            | Prompt user to recharge; **do not retry**                |
      | `null`                | No specific actionable reason                                                                               | May retry if appropriate                                 |
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Task creation time (ISO 8601).
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Task last updated time (ISO 8601).
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.maxapi.io/api/v1/task/9db7d1ed-d1e5-4d11-9f3a-61f653b905ad \
    --header 'Authorization: Bearer <token>'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 SUCCESS theme={null}
  {
    "code": 0,
    "msg": "ok",
    "data": {
      "taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad",
      "status": "SUCCESS",
      "input": {
        "model": "nano-banana",
        "prompt": "赛博朋克风格的东京街景",
        "ratio": "16:9",
        "resolution": "2k"
      },
      "result": {
        "type": "image",
        "urls": [
          "https://example.com/output/image1.png",
          "https://example.com/output/image2.png"
        ]
      },
      "created_at": "2026-02-10T21:54:46.686768Z",
      "updated_at": "2026-02-10T21:55:04.039815Z"
    }
  }
  ```

  ```json 200 PROCESSING theme={null}
  {
    "code": 0,
    "msg": "ok",
    "data": {
      "taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad",
      "status": "PROCESSING",
      "input": {
        "model": "nano-banana",
        "prompt": "赛博朋克风格的东京街景"
      },
      "result": null,
      "failure_reason": null,
      "created_at": "2026-02-10T21:54:46.686768Z",
      "updated_at": "2026-02-10T21:54:48.000000Z"
    }
  }
  ```

  ```json 200 FAILURE theme={null}
  {
    "code": 0,
    "msg": "ok",
    "data": {
      "taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad",
      "status": "FAILURE",
      "input": {
        "model": "veo3",
        "prompt": "..."
      },
      "result": null,
      "failure_reason": "CONTENT_MODERATION",
      "created_at": "2026-02-10T21:54:46.686768Z",
      "updated_at": "2026-02-10T21:54:55.000000Z"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "code": 404,
    "msg": "task not found"
  }
  ```
</ResponseExample>
