> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bunny.net/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.5.5
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
          schema:
            type: integer
            format: int64
          x-position: 1
        - name: videoId
          in: path
          required: true
          schema:
            type: string
          x-position: 2
        - name: srclang
          in: path
          required: true
          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
        '403':
          description: The request authorization failed
        '404':
          description: The requested video was not found
        '500':
          description: Internal Server Error
      security:
        - AccessKey: []
components:
  schemas:
    CaptionModelAdd:
      type: object
      additionalProperties: false
      properties:
        srclang:
          type: string
          description: The unique srclang shortcode for the caption
          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:
              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: Response message description
          nullable: true
        statusCode:
          type: integer
          description: The response status code
          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

````