# API reference: Video

> The Video endpoints (16 operations), generated from the OpenAPI document (https://faraatarjomeh.com/api/v1/openapi.json). For task-level walkthroughs use the guides; for error handling use /api/v1/docs/errors. The full reference: /api/v1/docs/reference.

## At a glance

- Auth on every call: `Authorization: Bearer $FARA_API_KEY`
- `scope`: `read` for GET/HEAD, `write` for the rest
- **spends Fara**: the call holds or charges Fara; get the price first and send `Idempotency-Key`
- Path parameters in the examples are shell variables (`$JOB_ID`, `$ID` …)
- Errors: `application/problem+json` with a stable `code` (not repeated per endpoint below)

## Index

- **Video**: [GET /api/v1/video/voices](#listVideoVoices), [GET /api/v1/video/preferences](#getVideoPreferences), [PUT /api/v1/video/preferences](#updateVideoPreferences), [POST /api/v1/video/jobs/estimate](#estimateVideoJob), [GET /api/v1/video/jobs](#listVideoJobs), [POST /api/v1/video/jobs](#createVideoJob), [GET /api/v1/video/jobs/{id}](#getVideoJob), [DELETE /api/v1/video/jobs/{id}](#deleteVideoJob), [PATCH /api/v1/video/jobs/{id}/segments/{segmentId}](#editVideoSegment), [POST /api/v1/video/jobs/{id}/approve](#approveVideoReview), [POST /api/v1/video/jobs/{id}/reprocess](#reprocessVideoJob), [POST /api/v1/video/jobs/{id}/resume](#resumeVideoJob), [POST /api/v1/video/jobs/{id}/cancel](#cancelVideoJob), [GET /api/v1/video/jobs/{id}/download](#downloadVideo), [GET /api/v1/video/jobs/{id}/preview](#previewVideo), [GET /api/v1/video/jobs/{id}/captions](#downloadVideoCaptions)

## Video

Translate YouTube videos or uploaded video files into Persian subtitles or voice.

<a id="listVideoVoices"></a>
### GET /api/v1/video/voices

List voices for dubbed video

- operationId `listVideoVoices` · scope `read` · free

**Response `200`**

[`VideoVoices`](#schema-video-voices)

**Responses**

- `200` Voices. (`application/json`)
- Errors: `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/voices" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="getVideoPreferences"></a>
### GET /api/v1/video/preferences

Get video preferences

- operationId `getVideoPreferences` · scope `read` · free

**Response `200`**

[`VideoPreferences`](#schema-video-preferences)

**Responses**

- `200` Preferences. (`application/json`)
- Errors: `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/preferences" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="updateVideoPreferences"></a>
### PUT /api/v1/video/preferences

Save video preferences

- operationId `updateVideoPreferences` · scope `write` · free · send `Idempotency-Key`

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

| Field | Type | Required | Notes |
|---|---|---|---|
| `reviewBeforeRender` | boolean | yes |  |

**Response `200`**

[`VideoPreferences`](#schema-video-preferences)

**Responses**

- `200` Saved. (`application/json`)
- Errors: `400`, `401`, `403`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X PUT "https://faraatarjomeh.com/api/v1/video/preferences" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"reviewBeforeRender":true}'
```

<a id="estimateVideoJob"></a>
### POST /api/v1/video/jobs/estimate

Get prices for a video

- operationId `estimateVideoJob` · scope `write` · free · send `Idempotency-Key`

Free. Reads the length of a YouTube video or of an uploaded video file, and returns the price of each output type. An uploaded file answers 400 `UNSUPPORTED_VIDEO_FILE` when it is not a video we can read.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

[`VideoEstimateRequest`](#schema-video-estimate-request)

**Response `200`**

[`VideoEstimate`](#schema-video-estimate)

**Responses**

- `200` Prices. (`application/json`)
- Errors: `400`, `401`, `403`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/video/jobs/estimate" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

<a id="listVideoJobs"></a>
### GET /api/v1/video/jobs

List video jobs

- operationId `listVideoJobs` · scope `read` · free

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `limit` | query | integer | no | Items to return (at most 50). — default: `20`; min 1; max 50 |
| `offset` | query | integer | no | Items to skip. — default: `0`; min 0 |
| `q` | query | string | no | Search by name. Matches the name given to the job or its original file name, ignoring case. Plain text, at most 100 characters; blank means no search. — max length 100 |

**Response `200`**

[`VideoJobList`](#schema-video-job-list)

**Responses**

- `200` Video job summaries. Fetch an individual job for transcript and translation segments. (`application/json`)
- Errors: `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/jobs" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="createVideoJob"></a>
### POST /api/v1/video/jobs

Translate a video

- operationId `createVideoJob` · scope `write` · **spends Fara** · send `Idempotency-Key`

The video is a YouTube link (`url`) or a video file sent as a chunked upload (POST /api/v1/uploads with `purpose: video`, then `uploadId` here). The upload errors (`UPLOAD_NOT_FOUND`, `UPLOAD_EXPIRED`, `UPLOAD_INCOMPLETE`, `UPLOAD_ALREADY_USED`, `UPLOAD_CHECKSUM_MISMATCH`) and `UNSUPPORTED_VIDEO_FILE` come from this call. Fara is held when the job is created and charged at the actual cost when it finishes; released on failure or cancel. If review is on, the job stops at `awaiting_review`: edit segments, then approve.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

[`VideoCreateRequest`](#schema-video-create-request)

**Response `201`**

[`VideoCreateResponse`](#schema-video-create-response)

**Responses**

- `201` Created. (`application/json`)
- Errors: `400`, `401`, `402`, `403`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/video/jobs" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"outputMode":"farsi_subs"}'
```

<a id="getVideoJob"></a>
### GET /api/v1/video/jobs/{id}

Get a video job

- operationId `getVideoJob` · scope `read` · free

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |

**Response `200`**

[`VideoJobEnvelope`](#schema-video-job-envelope)

**Responses**

- `200` The job. (`application/json`)
- Errors: `401`, `403`, `404`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/jobs/$ID" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="deleteVideoJob"></a>
### DELETE /api/v1/video/jobs/{id}

Delete a video translation permanently

- operationId `deleteVideoJob` · scope `write` · free · send `Idempotency-Key`

Removes the video, its subtitles and output files from our servers. Ledger rows stay. Only finished jobs (completed, failed, cancelled): a running or queued job answers 409 `JOB_NOT_FINISHED`; cancel it first. Afterwards the job answers 404.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Responses**

- `204` Deleted.
- Errors: `400`, `401`, `403`, `404`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X DELETE "https://faraatarjomeh.com/api/v1/video/jobs/$ID" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

<a id="editVideoSegment"></a>
### PATCH /api/v1/video/jobs/{id}/segments/{segmentId}

Edit the Persian text of one segment

- operationId `editVideoSegment` · scope `write` · free · send `Idempotency-Key`

Only while `awaiting_review`. Send the current `reviewVersion` in `If-Match`; the answer gives the new one.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |
| `segmentId` | path | string | yes | Segment id from the job's review data. |
| `If-Match` | header | string | yes | The job's current `reviewVersion`, bare (`3`) or quoted (`"3"`). |
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

[`SegmentEditRequest`](#schema-segment-edit-request)

**Response `200`**

[`ReviewEditResponse`](#schema-review-edit-response)

**Responses**

- `200` Saved. (`application/json`)
- Errors: `400`, `401`, `403`, `404`, `409`, `413`, `422`, `428`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X PATCH "https://faraatarjomeh.com/api/v1/video/jobs/$ID/segments/$SEGMENT_ID" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'If-Match: "$REVIEW_VERSION"' \
  -H "Content-Type: application/json" \
  -d '{"farsi":"string"}'
```

<a id="approveVideoReview"></a>
### POST /api/v1/video/jobs/{id}/approve

Approve the review and make the video

- operationId `approveVideoReview` · scope `write` · free · send `Idempotency-Key`

Uses the Fara already held; nothing new is held.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |
| `If-Match` | header | string | yes | The job's current `reviewVersion`, bare (`3`) or quoted (`"3"`). |
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Response `200`**

[`ApproveResponse`](#schema-approve-response)

**Responses**

- `200` Approved. (`application/json`)
- Errors: `400`, `401`, `403`, `404`, `409`, `422`, `428`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/video/jobs/$ID/approve" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'If-Match: "$REVIEW_VERSION"'
```

<a id="reprocessVideoJob"></a>
### POST /api/v1/video/jobs/{id}/reprocess

Make the final video again

- operationId `reprocessVideoJob` · scope `write` · **spends Fara** · send `Idempotency-Key`

Re-runs the last step (mixing the final video) for a `completed` or `failed` job that passed review. Holds the job's price again.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Response `200`**

[`QueueResponse`](#schema-queue-response)

**Responses**

- `200` Queued. (`application/json`)
- Errors: `400`, `401`, `402`, `403`, `404`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/video/jobs/$ID/reprocess" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

<a id="resumeVideoJob"></a>
### POST /api/v1/video/jobs/{id}/resume

Resume or retry a video job

- operationId `resumeVideoJob` · scope `write` · **spends Fara** · send `Idempotency-Key`

For a `failed` job this holds the price again and restarts it. For a stuck job it picks up where it stopped using the Fara already held.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Response `200`**

[`QueueResponse`](#schema-queue-response)

**Responses**

- `200` Queued. (`application/json`)
- Errors: `400`, `401`, `402`, `403`, `404`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/video/jobs/$ID/resume" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

<a id="cancelVideoJob"></a>
### POST /api/v1/video/jobs/{id}/cancel

Cancel a video job

- operationId `cancelVideoJob` · scope `write` · free · send `Idempotency-Key`

Releases the held Fara. Not possible once the final step has started.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Response `200`**

[`OkResponse`](#schema-ok-response)

**Responses**

- `200` Cancelled. (`application/json`)
- Errors: `400`, `401`, `403`, `404`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/video/jobs/$ID/cancel" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

<a id="downloadVideo"></a>
### GET /api/v1/video/jobs/{id}/download

Download the translated video

- operationId `downloadVideo` · scope `read` · free

Supports `Range` requests.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |

**Responses**

- `200` The MP4. (`video/mp4`)
- `206` Part of the file, for a single `Range: bytes=start-end` request. (`video/mp4`)
- `416` The requested range is outside the file. `Content-Range: bytes */total` gives the size.
- Errors: `401`, `403`, `404`, `409`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/jobs/$ID/download" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="previewVideo"></a>
### GET /api/v1/video/jobs/{id}/preview

Stream the translated video inline

- operationId `previewVideo` · scope `read` · free

Same file as download, sent `inline` for players. Supports `Range` requests.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |

**Responses**

- `200` The MP4. (`video/mp4`)
- `206` Part of the file, for a single `Range: bytes=start-end` request. (`video/mp4`)
- `416` The requested range is outside the file. `Content-Range: bytes */total` gives the size.
- Errors: `401`, `403`, `404`, `409`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/jobs/$ID/preview" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="downloadVideoCaptions"></a>
### GET /api/v1/video/jobs/{id}/captions

Download Persian captions (WebVTT)

- operationId `downloadVideoCaptions` · scope `read` · free

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `id` | path | string | yes | Job id. |

**Responses**

- `200` WebVTT captions. (`text/vtt`)
- Errors: `401`, `403`, `404`, `409`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/video/jobs/$ID/captions" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

## Schemas

Named request and response objects used above. Nested objects are flattened as `parent.child`; arrays as `parent[].child`.

<a id="schema-approve-response"></a>
### ApproveResponse

| Field | Type | Required | Notes |
|---|---|---|---|
| `ok` | boolean | yes |  |
| `status` | string | yes | `active`. |
| `reviewVersion` | integer | no |  |
| `untranslatedSpeechSegmentIds` | string[] | no | Video only: spoken segments with no Persian text. They will be silent. |

<a id="schema-ok-response"></a>
### OkResponse

| Field | Type | Required | Notes |
|---|---|---|---|
| `ok` | boolean | yes |  |

<a id="schema-queue-response"></a>
### QueueResponse

| Field | Type | Required | Notes |
|---|---|---|---|
| `ok` | boolean | no |  |
| `queued` | boolean | no |  |
| `name` | string | no | What was queued. |
| `postprocessAttempt` | integer | no |  |

<a id="schema-review-edit-response"></a>
### ReviewEditResponse

| Field | Type | Required | Notes |
|---|---|---|---|
| `ok` | boolean | yes |  |
| `reviewVersion` | integer | yes | New review version. Use it for the next edit. |

<a id="schema-segment-edit-request"></a>
### SegmentEditRequest

| Field | Type | Required | Notes |
|---|---|---|---|
| `farsi` | string | yes | New Persian text for this segment. |

<a id="schema-video-create-request"></a>
### VideoCreateRequest

Send `url` or `uploadId`. Add `startSeconds` / `endSeconds` to translate only part of the video; the hold and the price cover that part.

| Field | Type | Required | Notes |
|---|---|---|---|
| `url` | string | no | YouTube link. Send this or `uploadId`, not both. |
| `uploadId` | string | no | A finished chunked upload of a video file (`purpose: video`): MP4, MOV, MKV, WebM or AVI with a sound track. A refused create leaves the upload open, so it can be used again. |
| `outputMode` | string | yes | `farsi_subs` (Persian subtitles), `farsi_voice` (Persian voice), or `farsi_voice_subs` (both). — one of: `farsi_subs`, `farsi_voice`, `farsi_voice_subs` |
| `voiceSet` | string | no | Voice set, required for voice modes. A key of `voices` from GET /api/v1/video/voices. — one of: `standard`, `premium` |
| `voiceId` | string | no | A voice `id` from `catalog` in GET /api/v1/video/voices (for example `female-warm`), or `male` / `female` for that gender's default. Any other value is refused. Default `male`. When dubbing in the speaker's own voice, only its gender is used, for speakers that cannot be copied. |
| `voiceGender` | string | no | Used when `voiceId` is left out. — one of: `male`, `female` |
| `voiceMood` | string | no | Mood of the Persian voice and translation. `auto` (default) takes it from what is said in the video. Ignored for `farsi_subs`. — one of: `auto`, `neutral`, `friendly`, `formal`, `happy`, `sad`, `calm`, `energetic`, `serious` |
| `downloadQuality` | string | no | Source video quality for a YouTube link. Default `best`. Ignored for an upload. — one of: `best`, `360p`, `480p`, `720p`, `1080p` |
| `voiceCloneMode` | string | no | `source` keeps the speaker's own voice (needs `voiceSet: "premium"` and `voiceCloneConsent: true`). Default `stock`. — one of: `stock`, `source` |
| `voiceCloneConsent` | boolean | no | You confirm you have the right to reuse the speaker's voice. |
| `songDubbing` | boolean | no | When a dubbed video contains a song, sing it again in Persian with the translated lyrics. Spoken lines stay spoken. Default false. Ignored for `farsi_subs`. The hold is the `withSongDubbing` price from the estimate; you pay only for songs that were sung. 409 `SONG_DUBBING_UNAVAILABLE` when it is not offered right now. Same as `songMode: "mixed"`. |
| `songMode` | string | no | `off` (default): songs are spoken like the rest. `mixed`: songs found in the video are sung in Persian and speech stays spoken. `song_only`: the whole video is a song; every line is sung and no song detection runs. Wins over `songDubbing`. Priced and held like `songDubbing: true`. Ignored for `farsi_subs`. — one of: `off`, `mixed`, `song_only` |
| `burnCaptions` | boolean | no | Draw subtitles into the picture. False gives a separate captions track. |
| `reviewBeforeRender` | boolean | no | Stop for review before the final video. Leave out to use your saved preference. |
| `startSeconds` | number | no | Optional. Start of the part to translate, in whole seconds from the start of the video. Leave out to start at 0. The part must be at least 5 seconds and inside the video. A range that covers the whole video is the same as no range. Errors: 400 `INVALID_VIDEO_RANGE`, `VIDEO_RANGE_OUT_OF_BOUNDS`, `VIDEO_RANGE_TOO_SHORT`. |
| `endSeconds` | number | no | Optional. End of the part to translate, in whole seconds from the start of the video. Leave out to run to the end. Must be after `startSeconds`. |

<a id="schema-video-create-response"></a>
### VideoCreateResponse

| Field | Type | Required | Notes |
|---|---|---|---|
| `jobId` | string | yes |  |
| `cost` | object \| null | no | Price of a media job, in Fara. — may be null |
| `cost.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `cost.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `cost.heldFara` | number | no | Fara held when the job started. |
| `cost.refundedFara` | number | no | Part of the hold returned after the actual charge. |

<a id="schema-video-estimate"></a>
### VideoEstimate

Prices for each output type: subtitles only, dubbed voice with each voice set, and the premium set dubbed in the speaker's own voice (`voiceCloneMode: "source"`).

| Field | Type | Required | Notes |
|---|---|---|---|
| `title` | string | no |  |
| `durationSeconds` | number | no | Length that is priced: the selected part, or the whole video when no range was sent. |
| `sourceDurationSeconds` | number | no | Length of the whole video. |
| `startSeconds` | number \| null | no | Start of the selected part; null for the whole video. — may be null |
| `endSeconds` | number \| null | no | End of the selected part; null for the whole video. — may be null |
| `sourceVoiceMinSeconds` | number | no | Shortest length, in seconds, that can be copied for the speaker's own voice (`voiceCloneMode: "source"`). A shorter part (or whole video) cannot use that option. |
| `costSubtitles` | object \| null | no | Price of a media job, in Fara. — may be null |
| `costSubtitles.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `costSubtitles.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `costSubtitles.heldFara` | number | no | Fara held when the job started. |
| `costSubtitles.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `costStandardVoice` | object \| null | no | Price of a media job, in Fara. — may be null |
| `costStandardVoice.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `costStandardVoice.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `costStandardVoice.heldFara` | number | no | Fara held when the job started. |
| `costStandardVoice.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `costPremiumVoice` | object \| null | no | Price of a media job, in Fara. — may be null |
| `costPremiumVoice.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `costPremiumVoice.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `costPremiumVoice.heldFara` | number | no | Fara held when the job started. |
| `costPremiumVoice.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `costClonedVoice` | object \| null | no | Price of a media job, in Fara. — may be null |
| `costClonedVoice.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `costClonedVoice.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `costClonedVoice.heldFara` | number | no | Fara held when the job started. |
| `costClonedVoice.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `withSongDubbing` | object | no | The same dubbed-voice prices with `songDubbing: true`. This is what the create call holds. Missing when song dubbing is not offered right now; a create with `songDubbing: true` then answers 409 `SONG_DUBBING_UNAVAILABLE`. |
| `withSongDubbing.costStandardVoice` | object \| null | no | Price of a media job, in Fara. — may be null |
| `withSongDubbing.costStandardVoice.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `withSongDubbing.costStandardVoice.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `withSongDubbing.costStandardVoice.heldFara` | number | no | Fara held when the job started. |
| `withSongDubbing.costStandardVoice.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `withSongDubbing.costPremiumVoice` | object \| null | no | Price of a media job, in Fara. — may be null |
| `withSongDubbing.costPremiumVoice.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `withSongDubbing.costPremiumVoice.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `withSongDubbing.costPremiumVoice.heldFara` | number | no | Fara held when the job started. |
| `withSongDubbing.costPremiumVoice.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `withSongDubbing.costClonedVoice` | object \| null | no | Price of a media job, in Fara. — may be null |
| `withSongDubbing.costClonedVoice.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `withSongDubbing.costClonedVoice.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `withSongDubbing.costClonedVoice.heldFara` | number | no | Fara held when the job started. |
| `withSongDubbing.costClonedVoice.refundedFara` | number | no | Part of the hold returned after the actual charge. |

<a id="schema-video-estimate-request"></a>
### VideoEstimateRequest

Send `url` or `uploadId`.

| Field | Type | Required | Notes |
|---|---|---|---|
| `url` | string | no | YouTube link. Send this or `uploadId`, not both. |
| `uploadId` | string | no | A finished chunked upload of a video file (`purpose: video`). Reading it does not use it up. |
| `startSeconds` | number | no | Optional. Start of the part to translate, in whole seconds from the start of the video. Leave out to start at 0. The part must be at least 5 seconds and inside the video. A range that covers the whole video is the same as no range. Errors: 400 `INVALID_VIDEO_RANGE`, `VIDEO_RANGE_OUT_OF_BOUNDS`, `VIDEO_RANGE_TOO_SHORT`. |
| `endSeconds` | number | no | Optional. End of the part to translate, in whole seconds from the start of the video. Leave out to run to the end. Must be after `startSeconds`. |

<a id="schema-video-job-envelope"></a>
### VideoJobEnvelope

| Field | Type | Required | Notes |
|---|---|---|---|
| `job` | object | yes |  |
| `job._id` | string | yes | Job id. |
| `job.displayName` | string \| null | no | The name the customer gave the job (null: the original name is shown). — may be null |
| `job.status` | string | yes | `pending`, `active`, `awaiting_review` (waiting for your edits and approval), `retrying`, `finalizing`, `pending_finalization`, and the end states `completed`, `failed`, `cancelled`. Treat any other value as still running. |
| `job.stage` | string | no | Rough step, for progress display. |
| `job.progress` | number | no | 0-100. |
| `job.sourceType` | string | no | Where the video came from. — one of: `youtube`, `upload` |
| `job.sourceUrl` | string | no | The YouTube link. Null for an upload. |
| `job.originalFilename` | string | no | The uploaded file's name. Null for a YouTube link. |
| `job.videoTitle` | string | no |  |
| `job.durationSeconds` | number | no | Length that is processed and priced: the selected part, or the whole video. |
| `job.sourceDurationSeconds` | number | no | Length of the whole source video. |
| `job.startSeconds` | number \| null | no | Start of the selected part in seconds; null when the whole video is translated. — may be null |
| `job.endSeconds` | number \| null | no | End of the selected part in seconds; null when the whole video is translated. — may be null |
| `job.outputMode` | string | no |  |
| `job.songDubbing` | boolean | no | True when songs in this video are sung again in Persian. |
| `job.songMode` | string | no | How songs are handled. — one of: `off`, `mixed`, `song_only` |
| `job.voiceGender` | string \| null | no | may be null |
| `job.voiceKey` | string \| null | no | The chosen stock voice `id`. — may be null |
| `job.voiceMood` | string \| null | no | The chosen mood, or `auto`. — may be null |
| `job.detectedMood` | string \| null | no | With `auto`: the mood taken from the video, once it is known. — may be null |
| `job.downloadQuality` | string | no |  |
| `job.reviewBeforeRender` | boolean | no |  |
| `job.reviewVersion` | integer | no | Send as `If-Match` when editing or approving the review. |
| `job.reviewAutoContinueAt` | string \| null | no | While `awaiting_review`: when review continues by itself if you do not act. Null when it never does. — may be null |
| `job.reviewAutoContinuedAt` | string \| null | no | When review continued by itself, if it did. — may be null |
| `job.translationSegments` | object[] | no | Present while in review and after. |
| `job.translationSegments[].id` | string | no |  |
| `job.translationSegments[].start` | number | no |  |
| `job.translationSegments[].end` | number | no |  |
| `job.translationSegments[].text` | string | no | Original text. |
| `job.translationSegments[].farsi` | string | no | Persian text you can edit. |
| `job.translationSegments[].translationMissing` | boolean | no |  |
| `job.cost` | object \| null | no | Price of a media job, in Fara. — may be null |
| `job.cost.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `job.cost.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `job.cost.heldFara` | number | no | Fara held when the job started. |
| `job.cost.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `job.customerErrorCode` | string \| null | no | Why the job failed, as a stable code. Null while the job is fine. — one of: `NO_TEXT_LAYER`, `FILE_TOO_LARGE`, `TOO_MANY_PAGES`, `MEDIA_TOO_LONG`, `TOOK_TOO_LONG`, `PARTIAL_SECTIONS`, `INSUFFICIENT_CREDITS`, `SPEND_LIMIT_REACHED`, `SERVICE_BUSY`, `YOUTUBE_UNAVAILABLE`, `NO_SPEECH_FOUND`, `VOICE_CONSENT_REQUIRED`, `RETRY_LIMIT_REACHED`, `UNDER_REVIEW`, `OUTLINE_NO_MATERIAL`, `DOCUMENT_NO_MATERIAL`, `OUTLINE_EMPTY`, `RECOVERY_LIMIT`, `UNSUPPORTED_FILE_TYPE`, `DOCUMENT_PROTECTED`, `INVALID_DOCUMENT`, `DOCUMENT_CONVERSION_INCOMPLETE`, `DOCUMENT_CONVERSION_FAILED`, `GENERIC`, `null`; may be null |
| `job.createdAt` | string \| null | no | may be null |
| `job.updatedAt` | string \| null | no | may be null |

<a id="schema-video-job-list"></a>
### VideoJobList

| Field | Type | Required | Notes |
|---|---|---|---|
| `jobs` | object[] | yes |  |
| `jobs[]._id` | string | yes | Job id. |
| `jobs[].displayName` | string \| null | no | The name the customer gave the job (null: the original name is shown). — may be null |
| `jobs[].status` | string | yes | `pending`, `active`, `awaiting_review` (waiting for your edits and approval), `retrying`, `finalizing`, `pending_finalization`, and the end states `completed`, `failed`, `cancelled`. Treat any other value as still running. |
| `jobs[].stage` | string | no | Rough step, for progress display. |
| `jobs[].progress` | number | no | 0-100. |
| `jobs[].sourceType` | string | no | Where the video came from. — one of: `youtube`, `upload` |
| `jobs[].sourceUrl` | string | no | The YouTube link. Null for an upload. |
| `jobs[].originalFilename` | string | no | The uploaded file's name. Null for a YouTube link. |
| `jobs[].videoTitle` | string | no |  |
| `jobs[].durationSeconds` | number | no | Length that is processed and priced: the selected part, or the whole video. |
| `jobs[].sourceDurationSeconds` | number | no | Length of the whole source video. |
| `jobs[].startSeconds` | number \| null | no | Start of the selected part in seconds; null when the whole video is translated. — may be null |
| `jobs[].endSeconds` | number \| null | no | End of the selected part in seconds; null when the whole video is translated. — may be null |
| `jobs[].outputMode` | string | no |  |
| `jobs[].songDubbing` | boolean | no | True when songs in this video are sung again in Persian. |
| `jobs[].songMode` | string | no | How songs are handled. — one of: `off`, `mixed`, `song_only` |
| `jobs[].voiceGender` | string \| null | no | may be null |
| `jobs[].voiceKey` | string \| null | no | The chosen stock voice `id`. — may be null |
| `jobs[].voiceMood` | string \| null | no | The chosen mood, or `auto`. — may be null |
| `jobs[].detectedMood` | string \| null | no | With `auto`: the mood taken from the video, once it is known. — may be null |
| `jobs[].downloadQuality` | string | no |  |
| `jobs[].reviewBeforeRender` | boolean | no |  |
| `jobs[].reviewVersion` | integer | no | Send as `If-Match` when editing or approving the review. |
| `jobs[].reviewAutoContinueAt` | string \| null | no | While `awaiting_review`: when review continues by itself if you do not act. Null when it never does. — may be null |
| `jobs[].reviewAutoContinuedAt` | string \| null | no | When review continued by itself, if it did. — may be null |
| `jobs[].translationSegments` | object[] | no | Present while in review and after. |
| `jobs[].translationSegments[].id` | string | no |  |
| `jobs[].translationSegments[].start` | number | no |  |
| `jobs[].translationSegments[].end` | number | no |  |
| `jobs[].translationSegments[].text` | string | no | Original text. |
| `jobs[].translationSegments[].farsi` | string | no | Persian text you can edit. |
| `jobs[].translationSegments[].translationMissing` | boolean | no |  |
| `jobs[].cost` | object \| null | no | Price of a media job, in Fara. — may be null |
| `jobs[].cost.faraCharged` | number | no | Fara for this job: the held amount while running, the actual charge once finished. |
| `jobs[].cost.minutesBilled` | number | no | Billed minutes, for media jobs. |
| `jobs[].cost.heldFara` | number | no | Fara held when the job started. |
| `jobs[].cost.refundedFara` | number | no | Part of the hold returned after the actual charge. |
| `jobs[].customerErrorCode` | string \| null | no | Why the job failed, as a stable code. Null while the job is fine. — one of: `NO_TEXT_LAYER`, `FILE_TOO_LARGE`, `TOO_MANY_PAGES`, `MEDIA_TOO_LONG`, `TOOK_TOO_LONG`, `PARTIAL_SECTIONS`, `INSUFFICIENT_CREDITS`, `SPEND_LIMIT_REACHED`, `SERVICE_BUSY`, `YOUTUBE_UNAVAILABLE`, `NO_SPEECH_FOUND`, `VOICE_CONSENT_REQUIRED`, `RETRY_LIMIT_REACHED`, `UNDER_REVIEW`, `OUTLINE_NO_MATERIAL`, `DOCUMENT_NO_MATERIAL`, `OUTLINE_EMPTY`, `RECOVERY_LIMIT`, `UNSUPPORTED_FILE_TYPE`, `DOCUMENT_PROTECTED`, `INVALID_DOCUMENT`, `DOCUMENT_CONVERSION_INCOMPLETE`, `DOCUMENT_CONVERSION_FAILED`, `GENERIC`, `null`; may be null |
| `jobs[].createdAt` | string \| null | no | may be null |
| `jobs[].updatedAt` | string \| null | no | may be null |

<a id="schema-video-preferences"></a>
### VideoPreferences

| Field | Type | Required | Notes |
|---|---|---|---|
| `preferences` | object | no |  |
| `preferences.reviewBeforeRender` | boolean | no | Stop at `awaiting_review` before the final video is made. |
| `reviewAutoContinueSeconds` | integer | no | If you do not act, review continues by itself after this many seconds (0 = never). |

<a id="schema-video-voices"></a>
### VideoVoices

| Field | Type | Required | Notes |
|---|---|---|---|
| `voices` | object | no | Voice sets by `voiceSet` key (`standard`, `premium`). Each voice has `id`, `gender` and `label`. |
| `catalog` | object[] | no | Every stock voice. Send its `id` as `voiceId`. |
| `catalog[].id` | string | yes | Voice id, for example `female-warm`. |
| `catalog[].gender` | string | yes | one of: `male`, `female` |
| `catalog[].labelFa` | string | no | Name in Persian. |
| `catalog[].labelEn` | string | no | Name in English. |
| `catalog[].lineFa` | string | no | One-line description in Persian. |
| `catalog[].lineEn` | string | no | One-line description in English. |
| `catalog[].previewUrl` | string | no | Path of a short Persian sample (MP3) on this site. |
| `catalog[].default` | boolean | no | The voice used for this gender when you send only `male` or `female`. |
| `moods` | object[] | no | Moods. Send an `id` as `voiceMood`. |
| `moods[].id` | string | yes | one of: `neutral`, `friendly`, `formal`, `happy`, `sad`, `calm`, `energetic`, `serious` |
| `moods[].labelFa` | string | no |  |
| `moods[].labelEn` | string | no |  |
