---
title: "Add Caption"
method: POST
path: "/library/{libraryId}/videos/{videoId}/captions/{srclang}"
tags: ["Manage Videos"]
---

# Add Caption

`POST /library/{libraryId}/videos/{videoId}/captions/{srclang}`

## Request

- Base URL: `https://video.bunnycdn.com`
- URL: `https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/captions/{srclang}`
- Auth: API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/stream-api/docs/library/:libraryId/videos/:videoId/captions/:srclang/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `libraryId` integer, required
- `videoId` string, required
- `srclang` string, required

## Request body

- CaptionModelAdd
  - `srclang` string, nullable: Not used — the caption's srclang is taken from the srclang route segment instead. Any value sent here is ignored.
  - `label` string, nullable: The text description label for the caption
  - `captionsFile` string, nullable: Base64 encoded captions file

## Response `200`

The caption was successfully uploaded

- StatusModelOfCaptionValidationModel
  - `success` boolean: Determines if the request was successful
  - `message` string, nullable: Human-readable message describing the result, typically populated with error details when Success is false.
  - `statusCode` integer: The HTTP status code corresponding to the result of the request.
  - `data` CaptionValidationModel
    - `valid` boolean: Denotes whether uploaded captions file was valid
    - `errorList` string[], nullable: When uploaded file was invalid, will contain errors found
    - `warningList` string[], nullable: When uploaded file was valid but non-breaking issues were found, will contain issues found
    - `warningMessage` string, nullable: UI-friendly summary of warnings found in the uploaded captions file

## Other responses

- `400`: Failed uploading the captions
- `401`: The request authentication failed
- `403`: The request authorization failed
- `404`: The requested video was not found
- `500`: Internal Server Error

## Changes

- **2026-11-12** `83116184952f`: 2 breaking, 6 warning, 7 info
  - the response's body type changed from `object` to no type for status `200`
  - the response's body type changed from `object` to no type for status `400`
  - removed the optional property `errorList` from the response with the `400` status
  - removed the optional property `message` from the response with the `200` status
  - …11 more

[Operation history](https://skmtc.dev/bunny/apis/stream-api/changes/library/:libraryId/videos/:videoId/captions/:srclang/post.md)

---

[API](https://skmtc.dev/bunny/apis/stream-api.md) - [All operations](https://skmtc.dev/bunny/apis/stream-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/stream-api/revisions/83116184952f?raw)
