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

# Get Image Translation Task Status

> Retrieves the current status of an image translation, export, or fine-tune task using its task ID.

## Tracking Image Translation Tasks

Image translation, export, and fine-tune requests all run asynchronously. Pass the `task_id` returned by [`POST /image-translation`](end-to-end-image-translation), [`POST /image-translation/export`](export-image-translation), or [`POST /image-translation/fine-tune`](fine-tune-image-translation) to check how far along the task is.

## Task Statuses

| `status` | Meaning |
| :- | :- |
| `PENDING` | The task is still running. Poll again. |
| `SUCCESS` | The task finished. Use the returned `run_id` with the result and project endpoints. |
| `ERROR` | The task failed. Read `exception_reason` or `message` when present. |

> [!NOTE]
>
> A task that was just created may report `PENDING` briefly before it starts. Treat `PENDING` as "keep polling", not as an error.

## Request Example

Poll the status endpoint until the task reaches a terminal status:

```python [expandable] theme={null}
import os
import time
import requests

headers = {"x-api-key": os.environ["CAMB_API_KEY"]}
task_id = "your_task_id"

while True:
    response = requests.get(
        f"https://client.camb.ai/apis/image-translation/{task_id}",
        headers=headers,
    )
    response.raise_for_status()
    status = response.json()
    print(status["status"])
    if status["status"] in ("SUCCESS", "ERROR"):
        break
    time.sleep(5)
```

## Next Steps

Once the status is `SUCCESS`, retrieve your translated pages from [`/image-translation/result/{run_id}`](get-image-translation-result), or inspect individual text regions with [`/image-translation/project/{run_id}`](get-image-translation-project).


## OpenAPI

````yaml get /image-translation/{task_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /image-translation/{task_id}:
    get:
      tags:
        - Apis
        - Image Translation
      summary: Get Image Translation Task Status
      description: >-
        Poll an image translation, export, or fine-tune task until it reaches
        SUCCESS or ERROR.
      operationId: get_image_translation_status_image_translation__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TaskIDParam'
            description: Task ID returned by create, export, or fine-tune.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrchestratorPipelineResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    TaskIDParam:
      type: string
      title: Task ID
      description: >-
        This parameter represents a unique identifier for a task. It is used in
        various API endpoints to query the status or result of a specific task.
        The `task_id` is typically returned when a task is created.
    OrchestratorPipelineResult:
      properties:
        status:
          $ref: '#/components/schemas/TaskStatus'
        run_id:
          type:
            - integer
            - 'null'
          title: Run ID
      type: object
      title: OrchestratorPipelineResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - SUCCESS
        - PENDING
        - TIMEOUT
        - ERROR
        - PAYMENT_REQUIRED
      title: TaskStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.