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

# Add or replace a caption track



## OpenAPI

````yaml /openapi.json post /api/video/streams/{id}/captions
openapi: 3.1.0
info:
  title: Convertly API
  version: 1.0.0
  description: >-
    Convertly provides production API endpoints for media conversion,
    compression, Image CDN delivery, Forma AI, HLS/DASH video streaming, media
    tools, async jobs, workflows, webhooks, and Convertly Storage.
  license:
    name: Proprietary
    url: https://convertly.sh/terms
servers:
  - url: https://convertly.sh
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/video/streams/{id}/captions:
    post:
      tags:
        - Video Streaming
      summary: Add or replace a caption track
      operationId: upsertVideoCaption
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoCaptionTrackInput'
      responses:
        '200':
          description: Updated video stream
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  schemas:
    VideoCaptionTrackInput:
      type: object
      required:
        - label
        - language
        - content
      properties:
        label:
          type: string
          maxLength: 80
          example: English
        language:
          type: string
          example: en
        kind:
          type: string
          enum:
            - subtitles
            - captions
          default: subtitles
        content:
          type: string
          description: WebVTT content. Convertly adds a WEBVTT header when missing.
    Error:
      type: object
      properties:
        error:
          type: string
        upgradeUrl:
          type: string
      required:
        - error
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Dashboard-generated Convertly API key. Keys currently begin with
        `cvly_`.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternative API key header for server-side clients.

````