---
title: "Adds a subtitle track to a DAM file"
method: POST
path: "/dam/files/{file_id}/subtitles"
tags: ["DAM: Files"]
---

# Adds a subtitle track to a DAM file

`POST /dam/files/{file_id}/subtitles`

## Request

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

Adds a subtitle track to the current version of a video or audio file. Send the cues either as JSON in cues or as the text of a SubRip (.srt) file in srt, not both; see the two request examples. Cues may not overlap. language must be one of the languages subtitles can be generated and translated in. Setting is_default makes this the file's only default track. The response does not carry the cues; read them from the track's cue list.

## Path parameters

- `file_id` string, required

## Request body

- FileSubtitleStoreRequest
  - `data` object, required
    - `type` string, required
    - `attributes` object, required
      - `language` 'en' | 'da' | 'de' | 'sv' | 'no' | 'nn' | 'fi' | 'nl' | 'fr' | 'es' | 'it' | 'pt' | 'pl' | 'ru' | 'uk' | 'cs' | 'sk' | 'ro' | 'hu' | 'el' | 'tr' | 'bg' | 'hr' | 'sr' | 'sl' | 'et' | 'lv' | 'lt' | 'is' | 'ga' | 'ca' | 'id' | 'ms' | 'vi' | 'th' | 'ar' | 'he' | 'hi' | 'fa' | 'af' | 'zh' | 'ja' | 'ko', required: One of the languages subtitles can be generated and translated in.
      - `label` string, nullable
      - `is_default` boolean
      - `cues` FileSubtitleCue[]: The cues of the track. Send either cues or srt.
        - `start_ms` integer, required
        - `end_ms` integer, required
        - `text` string, required
      - `srt` string: The content of a SubRip (.srt) file. Send either cues or srt.

## Response `201`

created

- FileSubtitleResponse
  - `data` FileSubtitle
    - `id` string
    - `type` string
    - `attributes` FileSubtitleAttributes
      - `language` string
      - `label` string, nullable
      - `source` 'manual' | 'import' | 'ai'
      - `is_default` boolean
      - `version` integer
      - `created_at` string
      - `updated_at` string
    - `relationships` object
      - `cues` object
        - `links` object
          - `related` string: URL of the paged cue list of the track
    - `links` object
      - `self` string

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: File not found
- `422`: Invalid attributes, an unsupported language, both or neither of cues and srt, malformed SRT, overlapping cues, or a file that is not a video or audio file

---

[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)
