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

# Get Task Details

> Query the status and results of any task created in the Market models.

Query  the status and results of any task created in the whollyapi models.

This is a unified query interface that works with all models under the image to video category.

## Supported Models

This endpoint works with all Image-to-Video models in the Market, including:

* **Seedance**: `Seedance-2.0`, `Seedance-1.5-Pro`, and related image to video models
* **Grok Imagine**: image-to-video
* **Kling**: image-to-video models

## Task States

| State        | Description                                |
| ------------ | ------------------------------------------ |
| `waiting`    | Task is queued and waiting to be processed |
| `queuing`    | Task is in the processing queue            |
| `generating` | Task is currently being processed          |
| `success`    | Task completed successfully                |
| `fail`       | Task failed                                |

## Best Practices

* **Download results immediately**: Generated content URLs typically expire after 24 hours.

## Query Parameters

<ParamField query="taskId" type="string" required>
  The unique task identifier returned when you created the task.

  Example: `task_12345678`
</ParamField>

## Authentication

All API requests require a Bearer Token.

Add your API key to the request:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

***

## Response

A successful request returns a `200` response containing the task status, task metadata, generated results, timing information, and credit consumption details.

### Response schema

<ResponseField name="code" type="integer" required={false}>
  Response status code.

  Allowed values:

  | Code  | Description                                                                          |
  | ----- | ------------------------------------------------------------------------------------ |
  | `200` | Success — Request has been processed successfully                                    |
  | `401` | Unauthorized — Authentication credentials are missing or invalid                     |
  | `402` | Insufficient Credits — Account does not have enough credits to perform the operation |
  | `404` | Not Found — The requested resource or endpoint does not exist                        |
  | `422` | Validation Error — The request parameters failed validation checks                   |
  | `429` | Rate Limited — Request limit has been exceeded for this resource                     |
  | `433` | Request Limit — Sub-key usage exceeds limit                                          |
  | `455` | Service Unavailable — System is currently undergoing maintenance                     |
  | `500` | Server Error — An unexpected error occurred while processing the request             |
  | `501` | Generation Failed — Content generation task failed                                   |
  | `505` | Feature Disabled — The requested feature is currently disabled                       |
</ResponseField>

<ResponseField name="msg" type="string" required={false}>
  Response message. Contains the error description when the request fails.

  **Example:** `success`
</ResponseField>

<ResponseField name="data" type="object" required>
  The task data object containing all task information.
</ResponseField>

### Task data

<ResponseField name="taskId" type="string" required>
  The unique identifier for this task.

  **Example:** `task_12345678`
</ResponseField>

<ResponseField name="model" type="string">
  The model used for this task.
</ResponseField>

<ResponseField name="state" type="string">
  Current state of the task.

  Allowed values:

  * `waiting`
  * `queuing`
  * `generating`
  * `success`
  * `fail`

  **Example:** `success`
</ResponseField>

<ResponseField name="param" type="string">
  A JSON string containing the original request parameters used to create the task.
</ResponseField>

<ResponseField name="resultJson" type="string">
  A JSON string containing the generated result. This field is only available when the task state is `success`.
</ResponseField>

<ResponseField name="failCode" type="string">
  Error code if the task failed. Returns an empty string if the task succeeds.
</ResponseField>

<ResponseField name="failMsg" type="string">
  Error message if the task failed. Returns an empty string if the task succeeds.
</ResponseField>

<ResponseField name="costTime" type="integer">
  Processing time in milliseconds. Available when the task is successful.

  **Example:** `15000`
</ResponseField>

<ResponseField name="completeTime" type="integer">
  Completion timestamp as a Unix timestamp in milliseconds.

  **Example:** `1698765432000`
</ResponseField>

<ResponseField name="createTime" type="integer">
  Creation timestamp as a Unix timestamp in milliseconds.

  **Example:** `1698765400000`
</ResponseField>

<ResponseField name="updateTime" type="integer">
  Update timestamp as a Unix timestamp in milliseconds.

  **Example:** `1698765432000`
</ResponseField>

<ResponseField name="progress" type="integer">
  Generation progress from `0` to `100`.

  This field is only returned when the model is `sora2` or `sora2 pro`.

  **Example:** `45`
</ResponseField>

<ResponseField name="creditsConsumed" type="number">
  The actual number of credits deducted during task execution.
</ResponseField>

## Result formats

The structure of `data.resultJson` depends on the output type and model.

### media, and videos

For videos, `resultJson` has the following structure:

```json theme={null}
{
  "resultUrls": [
    "https://example.com/generated-video.mp4"
  ]
}
```

### Seedance 2 and Seedance 2 Fast

When `return_last_frame` is enabled:

```json theme={null}
{
  "resultUrls": [],
  "firstFrameUrl": [],
  "lastFrameUrl": []
}
```

### Text output

For text output:

```json theme={null}
{
  "resultObject": {}
}
```

<Note>
  URLs returned by the subject detection model are valid for 1 hour.
</Note>

## Example response

```json theme={null}
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_12345678",
    "model": "grok-imagine/image-to-video",
    "state": "success",
    "param": "{\"model\":\"grok-imagine/image-to-video\"}",
    "resultJson": "{\"resultUrls\":[\"https://example.com/generated-video.mp4\"]}",
    "failCode": "",
    "failMsg": "",
    "costTime": 15000,
    "completeTime": 1698765432000,
    "createTime": 1698765400000,
    "updateTime": 1698765432000,
    "progress": 100,
    "creditsConsumed": 10
  }
}
```

## HTTP error responses

<AccordionGroup>
  <Accordion title="400 — Bad Request">
    The request could not be processed due to invalid input.
  </Accordion>

  <Accordion title="401 — Unauthorized">
    Authentication credentials are missing or invalid.
  </Accordion>

  <Accordion title="404 — Not Found">
    The requested resource or endpoint does not exist.
  </Accordion>

  <Accordion title="422 — Validation Error">
    The request parameters failed validation checks.
  </Accordion>

  <Accordion title="429 — Rate Limited">
    The request limit has been exceeded for this resource.
  </Accordion>

  <Accordion title="500 — Server Error">
    An unexpected error occurred while processing the request.
  </Accordion>
</AccordionGroup>
