api.video
  1. Videos
api.video
  • Account
    • Show account
      GET
  • Analytics
    • List live stream player sessions
      GET
    • List player session events
      GET
    • List video player sessions
      GET
  • Authentication
    • Authenticate
      POST
    • Refresh token
      POST
  • Live
    • List all live streams
      GET
    • Create live stream
      POST
    • Delete a live stream
      DELETE
    • Show live stream
      GET
    • Update a live stream
      PATCH
    • Delete a thumbnail
      DELETE
    • Upload a thumbnail
      POST
  • Players
    • List all players
      GET
    • Create a player
      POST
    • Delete a player
      DELETE
    • Show a player
      GET
    • Update a player
      PATCH
    • Delete logo
      DELETE
    • Upload a logo
      POST
  • Videos - Delegated upload
    • Upload with an upload token
    • List all active upload tokens.
    • Generate an upload token
    • Delete an upload token
    • Show upload token
  • Videos
    • List all videos
      GET
    • Create a video
      POST
    • Delete a video
      DELETE
    • Show a video
      GET
    • Update a video
      PATCH
    • Upload a video
      POST
    • Show video status
      GET
    • Pick a thumbnail
      PATCH
    • Upload a thumbnail
      POST
  • Captions
    • List video captions
    • Delete a caption
    • Show a caption
    • Update caption
    • Upload a caption
  • Chapters
    • List video chapters
    • Delete a chapter
    • Show a chapter
    • Upload a chapter
  • Webhooks
    • List all webhooks
    • Create Webhook
    • Delete a Webhook
    • Show Webhook details
  1. Videos

Create a video

POST
/videos
To create a video, you create its container&parameters first, before adding the video file (exception - when using an existing HTTP source).
Videos are public by default. Learn about Private videos
Up to 6 responsive video streams will be created (from 240p to 4k)
Mp4 encoded versions are created at the highest quality (max 1080p) by default.
Panoramic videos are for videos recorded in 360 degrees. You can toggle this after your 360 video upload.
Searchable parameters: title, description, tags and metadata

add an URL to upload on creation#

You can also create a video directly from a video hosted on a third-party server by giving its URI in source parameter:
In this case, the service will respond 202 Accepted and ingest the video asynchronously.

Track users with Dynamic Metadata#

Metadata values can be a key:value where the values are predefined, but Dynamic metadata allows you to enter any value for a defined key. To defined a dynamic metadata pair use:
"metadata":[{"dynamicKey": "__dynamicKey__"}]
The double underscore on both sides of the value allows any variable to be added for a given video session. Added the the url you might have:
<iframe type="text/html" src="https://embed.api.video/vod/vi6QvU9dhYCzW3BpPvPsZUa8?metadata[classUserName]=Doug" width="960" height="320" frameborder="0" scrollling="no"></iframe>
This video session will be tagged as watched by Doug - allowing for in-depth analysis on how each viewer interacts with the videos.

We have tutorials on:#

Creating and uploading videos
Uploading large videos
Using tags with videos
Private videos
Using Dynamic Metadata
Full list of tutorials that demonstrate this endpoint.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://ws.api.video/videos' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "An amazing video explaining string theory.",
    "metadata": [
        {
            "key": "Author",
            "value": "John Doe"
        },
        {
            "key": "Format",
            "value": "Tutorial"
        }
    ],
    "mp4Support": true,
    "panoramic": false,
    "playerId": "pl45KFKdlddgk654dspkze",
    "public": false,
    "tags": [
        "maths",
        "string theory",
        "video"
    ],
    "title": "Maths video"
}'
Response Response Example
201 - response
{
    "assets": {
        "hls": "https://cdn.api.video/stream/831a9bd9-9f50-464c-a369-8e9d914371ae/hls/manifest.m3u8",
        "iframe": "<iframe src=\"//embed.api.video/vi4k0jvEUuaTdRAEjQ4Jfrgz?token=831a9bd9-9f50-464c-a369-8e9d914371ae\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
        "mp4": "https://cdn.api.video/vod/vi4k0jvEUuaTdRAEjQ4Jfrgz/token/8fd70443-d9f0-45d2-b01c-12c8cfc707c9/mp4/720/source.mp4",
        "player": "https://embed.api.video/vi4k0jvEUuaTdRAEjQ4Jfrgz?token=831a9bd9-9f50-464c-a369-8e9d914371ae",
        "thumbnail": "https://cdn.api.video/stream/831a9bd9-9f50-464c-a369-8e9d914371ae/thumbnail.jpg"
    },
    "description": "An amazing video explaining the string theory",
    "metadata": [
        {
            "key": "Author",
            "value": "John Doe"
        },
        {
            "key": "Format",
            "value": "Tutorial"
        }
    ],
    "mp4Support": true,
    "panoramic": false,
    "playerId": "pl4k0jvEUuaTdRAEjQ4Jfrgz",
    "public": false,
    "publishedAt": "4665-07-14T23:36:18.598Z",
    "source": {
        "uri": "/videos/vi4k0jvEUuaTdRAEjQ4Jfrgz/source"
    },
    "tags": [
        "maths",
        "string theory",
        "video"
    ],
    "title": "Maths video",
    "videoId": "vi4k0jvEUuaTdRAEjQ4Jfrgz"
}

Request

Body Params application/json

Examples

Responses

🟢201Created
application/json
Body

🟢202Accepted
🟠400Bad Request
Modified at 2023-08-15 05:52:15
Previous
List all videos
Next
Delete a video
Built with