---
title: "Create Video"
method: POST
path: "/library/{libraryId}/videos"
tags: ["Manage Videos"]
---

# Create Video

`POST /library/{libraryId}/videos`

## Request

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

## Path parameters

- `libraryId` integer, required

## Request body

- CreateVideoModel
  - `title` string, required: The title of the video
  - `collectionId` string, nullable: The ID of the collection where the video will be put
  - `thumbnailTime` integer, nullable: Video time in ms to extract the main video thumbnail.

## Response `200`

The video was successfully created and returned as the response.

- VideoModel
  - `videoLibraryId` integer, required: The ID of the video library that the video belongs to
  - `guid` string, required: The unique ID of the video
  - `title` string, required: The title of the video
  - `description` string, nullable: The description of the video
  - `dateUploaded` string, date-time, required: The date when the video was uploaded
  - `views` integer, required: The number of views the video received
  - `isPublic` boolean, required: Determines if the video is publically accessible
  - `length` integer, required: The duration of the video in seconds
  - `status` union, required
    - 0
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
  - `framerate` number, double, required: The framerate of the video
  - `rotation` integer, nullable: Rotation of the source file in degrees as read from container metadata (e.g. 90, -90, 180, 270); null when no rotation metadata is present.
  - `width` integer, required: The width of the original video file
  - `height` integer, required: The height of the original video file
  - `availableResolutions` string, nullable: Comma-separated list of resolution labels (e.g. "360p,720p,1080p") that have finished encoding and are available for playback.
  - `outputCodecs` string, required: Comma-separated list of output codecs generated for this video (e.g. "x264,vp9"). See EncoderOutputCodec for possible values.
  - `thumbnailCount` integer, required: The number of thumbnails generated for this video
  - `encodeProgress` integer, required: Encoding progress as a percentage from 0 to 100; reaches 100 when transcoding finishes.
  - `storageSize` integer, required: Total storage used by this video, in bytes.
  - `captions` CaptionModel[], nullable: The list of captions available for the video
    - `srclang` string, nullable: The unique srclang shortcode for the caption
    - `label` string, nullable: The text description label for the caption
    - `version` integer: Increments each time this caption is replaced; useful as a cache-busting value for the caption file URL.
  - `hasMP4Fallback` boolean, required: Determines if the video has MP4 fallback files generated
  - `collectionId` string, nullable: The ID of the collection where the video belongs
  - `thumbnailFileName` string, nullable: The file name of the thumbnail inside of the storage
  - `thumbnailUrl` string, nullable: The CDN URL of the thumbnail
  - `thumbnailBlurhash` string, nullable: Thumbnail blurhash to show while the actual thumbnail is being loaded
  - `averageWatchTime` integer, required: The average watch time of the video in seconds
  - `totalWatchTime` integer, required: The total video watch time in seconds
  - `category` string, nullable: Automatically detected content category label; "untagged" when no category has been determined yet.
  - `chapters` ChapterModel[], nullable: The list of chapters available for the video
    - `title` string, required: The title of the chapter, up to 255 characters.
    - `start` integer: The start time of the chapter in seconds. Must be less than End and within the video's duration; chapters must not overlap each other.
    - `end` integer: The end time of the chapter in seconds. Must be greater than Start and within the video's duration; chapters must not overlap each other.
  - `moments` MomentModel[], nullable: The list of moments available for the video
    - `label` string, required: The text description label for the moment, up to 255 characters.
    - `timestamp` integer: The timestamp of the moment in seconds. Must be within the video's duration.
  - `metaTags` MetaTagModel[], nullable: The list of meta tags that have been added to the video
    - `property` string, nullable: The meta tag key. Must match ^[A-Za-z0-9._:'"-]+$. Setting a tag with the property "description" also updates the video's Description field.
    - `value` string, nullable: The meta tag value. HTML/markup is stripped and the value is stored as plain text.
  - `transcodingMessages` TranscodingMessageModel[], nullable: The list of transcoding messages that describe potential issues while the video was transcoding
    - `timeStamp` string, date-time: Date and time when this message was added (UTC).
    - `level` union
      - 0: Shouldn't be used
      - 1: An info message to the user, shouldn't break anythying
      - 2: A warning message, for example that the transcoded video may break when playing
      - 3: An error, meaning that the video will most likely not be playable
    - `issueCode` union
      - 0: Shouldn't be used
      - 1: Marks that there is a mismatch between lengths of audio and video streams in the transcoded file
      - 2: Marks that transcoding completed with warnings
      - 3: Marks that original video file has incompatible resolution or isn't a video stream
      - 4: Marks that original video file has invalid framerate
      - 5: Marks that video stream exceeded max duration
      - 6: Marks that audio stream exceeded max duration
      - 7: Marks that video file is corrupted and couldn't be processed properly
      - 8: Marks that video transcription finished with errors and might not be complete
      - 9: Marks that video file is not compatible with JIT encoding
      - 10: Marks that video failed JIT encoding
      - 11: Marks that captions generation failed
      - 12: Marks that the uploaded or fetched file is not video or audio, for example a photo or a document
    - `message` string, nullable: Human-readable description of the issue.
    - `value` string, nullable: Additional context value for the issue, if applicable; otherwise empty.
  - `jitEncodingEnabled` boolean, nullable: Whether just-in-time encoding is enabled for this specific video, overriding the video library's default JitEncodingEnabled setting when set. Null means the library default applies.
  - `smartGenerateStatus` union
    - 0
    - 1
    - 2
    - 3
    - 4
  - `smartGenerateFeaturesStatus` SmartGenerateFeaturesStatusModel
    - `title` union
      - 0
      - 1
      - 2
      - 3
      - 4
    - `description` union
      - 0
      - 1
      - 2
      - 3
      - 4
    - `chapters` union
      - 0
      - 1
      - 2
      - 3
      - 4
    - `moments` union
      - 0
      - 1
      - 2
      - 3
      - 4
  - `hasOriginal` boolean, nullable: Determines if video has the original file available in storage
  - `originalHash` string, nullable: Original uploaded file SHA256 hash
  - `hasHighQualityPreview` boolean, nullable: Whether a high-quality animated preview has been generated for this video.

## Other responses

- `400`: Request was invalid
- `401`: The request authentication failed
- `403`: The request authorization failed
- `500`: Internal Server Error

## Changes

- **2026-11-12** `83116184952f`: 6 breaking, 34 info
  - added `#/components/schemas/IssueCodes` to the `transcodingMessages/items/issueCode` response property `oneOf` list for the response status `200`
  - added `#/components/schemas/Severity` to the `transcodingMessages/items/level` response property `oneOf` list for the response status `200`
  - added `subschema #1: Created, subschema #2: Uploaded, subschema #3: Processing, subschema #4: Transcoding, subschema #5: Finished, subschema #6: Error, subschema #7: UploadFailed, subschema #8: JitSegmenting, subschema #9: JitPlaylistsCreated` to the `status/oneOf[#/components/schemas/VideoModelStatus]/` response property `oneOf` list for the response status `200`
  - added `subschema #1: None, subschema #2: Queued, subschema #3: InProgress, subschema #4: Finished, subschema #5: Failed` to the `smartGenerateStatus/oneOf[#/components/schemas/SmartGenerateStatus]/` response property `oneOf` list for the response status `200`
  - …36 more

[Operation history](https://skmtc.dev/bunny/apis/stream-api/changes/library/:libraryId/videos/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)
