Webhooks

Create Webhook

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.
post/webhooks

Request body

eventsstring[] 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.
urlstring required

The the url to which HTTP notifications are sent. It could be any http or https URL.

Example request

{
  "events": [
    "video.encoding.quality.completed"
  ],
  "url": "http://clientnotificationserver.com/notif?myquery=query"
}

Response

Created

webhookIdstring

Unique identifier of the webhook

createdAtstring date-time

When an webhook was created, presented in ISO-8601 format.

eventsstring[]

A list of events that will trigger the webhook.

urlstring

URL of the webhook

Example response

{
  "createdAt": "2000-01-23T04:56:07.000+00:00",
  "webhookId": "webhook_XXXXXXXXXXXXXXX",
  "events": "[\"video.encoding.quality.completed\"]",
  "url": "http://clientnotificationserver.com/notif?myquery=query"
}

Changes