> ## 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 Video Personalization Task Status

> Retrieves the current status of a video personalization task using its task ID.

## Tracking a Personalization Task

Personalization runs asynchronously: the video is transcribed, re-written for the audience in the prompt, re-voiced in the original speakers' voices and mixed back under the original footage. Pass the `task_id` returned by [`POST /personalize-video`](create-personalize-video) to check how far along it 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 endpoint. |
| `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.

> [!NOTE]
>
> Every line is re-voiced, so a run takes noticeably longer than the source video. Poll every 10 to 15 seconds rather than submitting the job a second time.

## Common Failure Reasons

| `exception_reason` | What to do |
| :- | :- |
| `PAYMENT_REQUIRED` | The workspace does not have enough credits for the video's duration. Top up and resubmit. |
| `ERROR_DOWNLOADING_SOURCE` | The video could not be fetched. Check the URL is public and still resolves. |
| `SOURCE_TYPE_NOT_SUPPORTED` | The file is not a supported video format. |
| `VIDEO_DOES_NOT_HAVE_AUDIO_STREAMS` | There is no speech to re-tell. Personalization needs an audio track. |
| `SOURCE_TOO_LONG` | The video is longer than your plan allows. |
| `LANGUAGE_NOT_SUPPORTED` | The speech is in a language this pipeline cannot voice. |

## Request Example

```python Python SDK theme={null}
import os
import time
from camb.client import CambAI

client = CambAI(api_key=os.environ["CAMB_API_KEY"])

while True:
    status = client.personalize.get_status("your_task_id")
    print(status.status)
    if status.status == "SUCCESS":
        print(f"Run ID: {status.run_id}")
        break
    if status.status == "ERROR":
        raise RuntimeError(f"Personalization failed: {status.exception_reason}")
    time.sleep(15)
```

```typescript TypeScript SDK theme={null}
import { CambClient, CambApi } from "@camb-ai/sdk";

const client = new CambClient({ apiKey: process.env.CAMB_API_KEY });
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));

while (true) {
    const status = await client.personalize.getStatus({
        task_id: "your_task_id",
    });
    console.log(status.status);
    if (status.status === CambApi.TaskStatus.Success) {
        console.log(`Run ID: ${status.run_id}`);
        break;
    }
    if (status.status === CambApi.TaskStatus.Error) {
        throw new Error(String(status.exception_reason));
    }
    await sleep(15_000);
}
```

```python requests 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/personalize-video/{task_id}",
        headers=headers,
    )
    response.raise_for_status()
    status = response.json()
    print(status["status"])
    if status["status"] in ("SUCCESS", "ERROR"):
        break
    time.sleep(15)
```

## Next Steps

Once the status is `SUCCESS`, download the personalized video from [`/personalize-video-result/{run_id}`](get-personalize-video-result).


## OpenAPI

````yaml get /personalize-video/{task_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /personalize-video/{task_id}:
    get:
      tags:
        - Apis
        - Video Personalization
      summary: Get Video Personalization Task Status
      description: >-
        Poll a video personalization task until it reaches SUCCESS or ERROR. On
        SUCCESS the response carries the `run_id` for the result endpoint.
      operationId: get_personalize_video_status_personalize_video__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TaskIDParam'
          description: The `task_id` returned by `POST /personalize-video`.
      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.