---
title: "Starts AI subtitle generation for a DAM file"
method: POST
path: "/dam/files/{file_id}/subtitle-generations"
tags: ["DAM: Files"]
---

# Starts AI subtitle generation for a DAM file

`POST /dam/files/{file_id}/subtitle-generations`

## Request

- Base URL: `https://api.kontainer.com/jsonapi/v2`
- URL: `https://api.kontainer.com/jsonapi/v2/dam/files/{file_id}/subtitle-generations`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/kontainer/apis/kontainer-api-documentation/docs/dam/files/:file_id/subtitle-generations/post.ts> (a function with typed inputs; its response is checked against the schema)

Queues AI subtitle generation for a video or audio file, following the JSON:API recommendation for asynchronous processing. The response carries a Content-Location header with the URL of the generation; poll it until it stops answering 200 with a pending status. Requires AI subtitle generation to be enabled for the client.

## Path parameters

- `file_id` string, required

## Request body

- SubtitleGenerationRequest
  - `data` object, required
    - `type` string, required
    - `attributes` object
      - `languages` string[]: Language codes to produce a track for. The spoken language is transcribed and every other language is translated from it. Omit to transcribe only the detected spoken language.

## Response `202`

Generation queued

- SubtitleGenerationResponse
  - `data` SubtitleGeneration
    - `id` string
    - `type` string
    - `attributes` object
      - `status` 'queued' | 'processing' | 'completed' | 'translation_failed' | 'no_audio_track' | 'no_speech' | 'source_missing' | 'failed': queued and processing are still running. completed means every track was added. translation_failed means the spoken-language track was added but none of the translated tracks. no_audio_track, no_speech, source_missing and failed are final and added no tracks.
      - `languages` string[]
      - `created_at` string
      - `updated_at` string
    - `links` object
      - `self` string

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: File not found
- `409`: Every requested language is already being generated for the file
- `422`: The file is not a video or audio file, has no audio track, or the attributes are invalid
- `503`: Subtitle generation is not available

---

[API](https://skmtc.dev/kontainer/apis/kontainer-api-documentation.md) - [All operations](https://skmtc.dev/kontainer/apis/kontainer-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/kontainer/apis/kontainer-api-documentation/revisions/b80a5167e09a?raw)
