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

# Get Task Details

> Query the status and results of async tasks

<Info>
  Use this endpoint to query the status and results of any async task created
  via the API.
</Info>

<Tip>
  In production, use the callback\_url parameter to receive automatic
  notifications rather than polling.
</Tip>

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer Token authentication. Format: Bearer sk-xxxxxx
</ParamField>

## Path Parameters

<ParamField path="taskId" type="string" required>
  Task ID, the unique identifier returned when creating the task
</ParamField>

## Response

<ResponseField name="code" type="integer" required>
  Response status code
</ResponseField>

<ResponseField name="message" type="string" required>
  Response message
</ResponseField>

<ResponseField name="data" type="object" required>
  Task data object
</ResponseField>

## Task Status

| Status     | Description                 |
| ---------- | --------------------------- |
| waiting    | Task queued for processing  |
| queuing    | Task in processing queue    |
| generating | Task is being processed     |
| success    | Task completed successfully |
| fail       | Task failed                 |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.ruxa.ai/api/v1/tasks/query/task_gemini-2.5-flash-image_1766304530229_cf4dafd2 \
    --header 'Authorization: Bearer sk-xxxxxx'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "message": "success",
    "data": {
      "taskId": "task_gemini-2.5-flash-image_1766304530229_cf4dafd2",
      "state": "success",
      "resultJson": "{\"resultUrls\":[\"https://cdn.example.com/image.png\"]}"
    }
  }
  ```
</ResponseExample>
