> ## 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.

# Export Image Translation

> Exports the translated pages for a run as page images or PDFs.

## Exporting Translated Pages

A run is exported automatically when image translation completes. Call this endpoint when you want to refresh the download, for example after a [fine-tune](https://docs.camb.ai/api-reference/endpoint/fine-tune-image-translation.md), to switch formats, or if [`GET /image-translation/result/{run_id}`](get-image-translation-result) returns 404.

Send the `run_id` and, optionally, an `export_format`:

* **`ZIP`** (default): the translated page images.
* **`PDF`**: one PDF per target language.

The download is always delivered as a ZIP.

## Response

The response contains a `task_id` and a `cached` flag:

* If `cached` is `true` and there is no `task_id`, the export already exists. Skip polling and fetch the result.
* Otherwise, poll [`/image-translation/{task_id}`](get-end-to-end-image-translation-status) until the status is `SUCCESS`, then fetch the result from [`/image-translation/result/{run_id}`](get-image-translation-result).

## Request Example

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

headers = {
    "x-api-key": os.environ["CAMB_API_KEY"],
    "Content-Type": "application/json",
}

response = requests.post(
    "https://client.camb.ai/apis/image-translation/export",
    headers=headers,
    json={"run_id": 12345, "export_format": "PDF"},
)
response.raise_for_status()
print(response.json())
```


## OpenAPI

````yaml post /image-translation/export
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /image-translation/export:
    post:
      tags:
        - Apis
        - Image Translation
      summary: Export Image Translation
      description: >-
        Export the translated pages for a run as page images or PDFs. Poll the
        returned `task_id` unless `cached` is true.
      operationId: export_image_translation_image_translation_export_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportImageTranslationRequestPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageTextEditExportOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ExportImageTranslationRequestPayload:
      type: object
      title: ExportImageTranslationRequestPayload
      required:
        - run_id
      properties:
        run_id:
          type: integer
          title: Run ID
          description: The image translation run to export.
          example: null
        export_format:
          $ref: '#/components/schemas/ImageTextEditExportFormat'
          description: >-
            `ZIP` (default) is a ZIP of page images. `PDF` is a ZIP of
            per-language PDFs. The download is always a ZIP.
          default: ZIP
    ImageTextEditExportOut:
      type: object
      title: ImageTextEditExportOut
      properties:
        task_id:
          type:
            - string
            - 'null'
          title: Task ID
          description: Poll this task unless `cached` is true and no new export was queued.
        cached:
          type: boolean
          title: Cached
          default: false
          description: >-
            True when an existing export artifact was reused and polling can be
            skipped.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ImageTextEditExportFormat:
      type: string
      enum:
        - ZIP
        - PDF
      default: ZIP
      title: ImageTextEditExportFormat
      description: >-
        `ZIP` of page images (default) or `PDF` (a ZIP of per-language PDFs).
        The result download is always a ZIP.
    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.