> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenbyte.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Subtitle

> Upload a new subtitle file for a specific video.



## OpenAPI

````yaml https://raw.githubusercontent.com/vidinfra/open-api-docs/refs/heads/main/openapi.json post /libraries/{libraryId}/videos/{videoId}/subtitles
openapi: 3.0.1
info:
  title: Default module
  description: ''
  version: 1.0.0
servers:
  - url: https://api.tenbyte.io/v1/vidinfra
    description: Production server
security:
  - bearer: []
tags:
  - name: Library
  - name: Folder
  - name: Video
  - name: Subtitle
  - name: Video Thumbnails
  - name: Transcoding Profiles
  - name: Player Themes
  - name: Video Chapter
  - name: Webhook Endpoints
  - name: Webhook Deliveries
  - name: Security
  - name: Video Multipart Upload
  - name: Webhook
  - name: Migration Jobs
paths:
  /libraries/{libraryId}/videos/{videoId}/subtitles:
    post:
      tags:
        - Subtitle
      summary: Create Subtitle
      description: Upload a new subtitle file for a specific video.
      parameters:
        - name: libraryId
          in: path
          description: Unique identifier of the library.
          required: true
          example: 314221a1-3cbf-4d3c-846e-f6c22bc43064
          schema:
            type: string
        - name: videoId
          in: path
          description: Unique identifier of the targeted video resource.
          required: true
          example: a7f590b4-3fd7-42a4-82bb-a7cfa6aa9d04
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: The display name of the subtitle file (e.g., English).
                  example: enlish.srt
                language:
                  description: Language code of the subtitle (e.g., en, es, fr).
                  example: dn
                  type: string
                file:
                  format: binary
                  type: string
                  description: >-
                    The actual subtitle file to upload, usually in .srt or .vtt
                    format.
                  example: >-
                    file:///home/rob/Downloads/avatar.(2009).bur.1cd.(10182616)/Español.srt
              required:
                - title
                - language
                - file
            examples: {}
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  video_id:
                    type: string
                  title:
                    type: string
                  language:
                    type: string
                  path:
                    type: string
                  created_at:
                    type: string
                  updated_at:
                    type: string
                  deleted_at:
                    type: string
                required:
                  - id
                  - video_id
                  - title
                  - language
                  - path
                  - created_at
                  - updated_at
                  - deleted_at
              example:
                id: 5c24d2b3-8c17-4d58-b96e-18b7cb9e2a41
                video_id: c36f981d-9b53-4f45-9b4f-3d03a94e2a63
                title: English Subtitle
                language: en
                path: en.vtt
                created_at: '2025-11-10T12:40:00Z'
                updated_at: '2025-11-10T12:45:00Z'
                deleted_at: null
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
                required:
                  - message
                  - success
              example:
                message: Invalid Request
                success: false
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  success:
                    type: boolean
                required:
                  - code
                  - message
                  - success
              example:
                code: auth_type_not_found
                message: >-
                  Could not determine authentication type from request. Please
                  provide a valid Authorization header or X-API-Key header.
                success: false
          headers: {}
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
                required:
                  - message
                  - success
              example:
                message: Resource not found
                success: false
          headers: {}
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        code:
                          type: string
                        message:
                          type: string
                  success:
                    type: boolean
                required:
                  - message
                  - errors
                  - success
              example:
                message: Invalid Request
                errors:
                  - field: field_name
                    code: validation_required
                    message: This field is required
                success: false
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
                required:
                  - message
                  - success
              example:
                message: Internal server error
                success: false
          headers: {}
      deprecated: false
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````