api.video
  1. Webhooks
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
    • Create a video
    • Delete a video
    • Show a video
    • Update a video
    • Upload a video
    • Show video status
    • Pick a thumbnail
    • Upload a thumbnail
  • 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
      GET
    • Create Webhook
      POST
    • Delete a Webhook
      DELETE
    • Show Webhook details
      GET
  1. Webhooks

Create Webhook

POST
/webhooks
Webhooks
Webhooks can push notifications to your server, rather than polling api.video for changes. We currently offer four events:
video.encoding.quality.completed When a new video is uploaded into your account, it will be encoded into several different HLS sizes/bitrates. When each version is encoded, your webhook will get a notification. It will look like { \"type\": \"video.encoding.quality.completed\", \"emittedAt\": \"2021-01-29T16:46:25.217+01:00\", \"videoId\": \"viXXXXXXXX\", \"encoding\": \"hls\", \"quality\": \"720p\"} . This request says that the 720p HLS encoding was completed.
live-stream.broadcast.started When a livestream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires.
live-stream.broadcast.ended This event fores when the livestream has finished broadcasting, and the broadcasting parameter flips from false to true.
video.source.recorded This event is similar to video.encoding.quality.completed, but tells you if a livestream has been recorded as a VOD.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://ws.api.video/webhooks' \
--header 'Content-Type: application/json' \
--data-raw '{
    "events": [
        "video.encoding.quality.completed"
    ],
    "url": "http://clientnotificationserver.com/notif?myquery=query"
}'
Response Response Example
201 - response
{
  "createdAt": "2021-01-08T14:12:18.000Z",
  "events": [
    "video.encoding.quality.completed"
  ],
  "url": "http://clientnotificationserver.com/notif?myquery=query",
  "webhookId": "webhook_XXXXXXXXXXXXXXX"
}

Request

Body Params application/json
events
array[string]
required
A list of the webhooks that you are subscribing to. There are Currently four webhook options:
video.encoding.quality.completed When a new video is uploaded into your account, it will be encoded into several different HLS sizes/bitrates. When each version is encoded, your webhook will get a notification. It will look like { \"type\": \"video.encoding.quality.completed\", \"emittedAt\": \"2021-01-29T16:46:25.217+01:00\", \"videoId\": \"viXXXXXXXX\", \"encoding\": \"hls\", \"quality\": \"720p\"} . This request says that the 720p HLS encoding was completed.
live-stream.broadcast.started When a livestream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires.
live-stream.broadcast.ended This event fores when the livestream has finished broadcasting, and the broadcasting parameter flips from false to true.
video.source.recorded This event is similar to video.encoding.quality.completed, but tells you if a livestream has been recorded as a VOD.
Example:
video.encoding.quality.completed
url
string 
required
The the url to which HTTP notifications are sent. It could be any http or https URL.
Example:
https://example.com/webhooks
Examples

Responses

🟢201Created
application/json
Body
createdAt
string <date-time>
optional
When an webhook was created, presented in ISO-8601 format.
Example:
2019-06-24T11:45:01.109Z
events
array[string]
optional
A list of events that will trigger the webhook.
Example:
["video.encoding.quality.completed"]
url
string 
optional
URL of the webhook
Example:
http://clientnotificationserver.com/notif?myquery=query
webhookId
string 
optional
Unique identifier of the webhook
Example:
webhook_XXXXXXXXXXXXXXX
🟠400Bad Request
Modified at 2023-08-15 05:52:15
Previous
List all webhooks
Next
Delete a Webhook
Built with