> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-add-address-verification-note.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Caption



## OpenAPI

````yaml https://video.bunnycdn.com/openapi/bunnynet-video-api.public.json post /library/{libraryId}/videos/{videoId}/captions/{srclang}
openapi: 3.0.0
info:
  title: Stream API
  termsOfService: https://bunny.net/tos
  contact:
    name: bunny.net
    url: https://docs.bunny.net
    email: support@bunny.net
  version: 1.6.1
servers:
  - url: https://video.bunnycdn.com
security: []
tags:
  - name: Manage Collections
  - name: Manage Videos
paths:
  /library/{libraryId}/videos/{videoId}/captions/{srclang}:
    post:
      tags:
        - Manage Videos
      summary: Add Caption
      operationId: Video_AddCaption
      parameters:
        - name: libraryId
          in: path
          required: true
          description: The ID of the video library.
          schema:
            type: integer
            format: int64
          x-position: 1
        - name: videoId
          in: path
          required: true
          description: The GUID of the video.
          schema:
            type: string
          x-position: 2
        - name: srclang
          in: path
          required: true
          description: The srclang shortcode for the caption, e.g. "en".
          schema:
            type: string
          x-position: 3
      requestBody:
        x-name: captionModel
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaptionModelAdd'
        required: true
        x-position: 4
      responses:
        '200':
          description: The caption was successfully uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusModelOfCaptionValidationModel'
        '400':
          description: Failed uploading the captions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusModelOfCaptionValidationModel'
        '401':
          description: The request authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusModel'
        '403':
          description: The request authorization failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusModel'
        '404':
          description: The requested video was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusModel'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusModel'
      security:
        - AccessKey: []
components:
  schemas:
    CaptionModelAdd:
      type: object
      additionalProperties: false
      properties:
        srclang:
          type: string
          description: >-
            Not used — the caption's srclang is taken from the srclang route
            segment instead. Any value sent here is ignored.
          deprecated: true
          x-deprecatedMessage: >-
            Not used — the caption's srclang is taken from the srclang route
            segment instead. Any value sent here is ignored.
          nullable: true
        label:
          type: string
          description: The text description label for the caption
          nullable: true
        captionsFile:
          type: string
          description: Base64 encoded captions file
          nullable: true
    StatusModelOfCaptionValidationModel:
      allOf:
        - $ref: '#/components/schemas/StatusModel'
        - type: object
          additionalProperties: false
          properties:
            data:
              description: >-
                The response payload. Some endpoints also populate this with
                error details when Success is false — see the endpoint's own
                response documentation.
              nullable: true
              oneOf:
                - $ref: '#/components/schemas/CaptionValidationModel'
    StatusModel:
      type: object
      additionalProperties: false
      properties:
        success:
          type: boolean
          description: Determines if the request was successful
        message:
          type: string
          description: >-
            Human-readable message describing the result, typically populated
            with error details when Success is false.
          nullable: true
        statusCode:
          type: integer
          description: The HTTP status code corresponding to the result of the request.
          format: int32
    CaptionValidationModel:
      type: object
      additionalProperties: false
      properties:
        valid:
          type: boolean
          description: Denotes whether uploaded captions file was valid
        errorList:
          type: array
          description: When uploaded file was invalid, will contain errors found
          nullable: true
          items:
            type: string
        warningList:
          type: array
          description: >-
            When uploaded file was valid but non-breaking issues were found,
            will contain issues found
          nullable: true
          items:
            type: string
        warningMessage:
          type: string
          description: UI-friendly summary of warnings found in the uploaded captions file
          nullable: true
  securitySchemes:
    AccessKey:
      type: apiKey
      description: AccessKey based authentication
      name: AccessKey
      in: header

````