Webhooks allow you to subscribe to an event triggered by our system.
So far, we support there types of events:
Event | Description |
---|---|
video_ready string | Triggered when any video's status is changed to "ready" |
video_error string | Triggered when any video has a validation or a rendering error |
video_moderation string | Triggered when any video is sent to moderation |
Example of a webhook payload:
Delivery-ID: xQHSyokZ
Elai-Timestamp: 1652706345008
Elai-Signature: bd72f3294000e64ac62724836071483fc6abcb9b1ab4e39e446e04d8314c3334
{
"event": "video_ready",
"error": null,
"video": {
"_id": "627e1c5ef461482766f35f4a",
"status": "ready",
"public": false,
"name": "Hello John!",
"tags": [],
"deleted": false,
"status": "draft",
"public": false,
"userId": "61b1529d2055d2805c0",
"accountId": "61b1529d2055d2805c",
"createdAt": "2022-08-25T09:25:56.228Z",
"updatedAt": "2022-08-26T09:40:03.337Z",
"data": {},
"duration": 3.456,
"thumbnail": "https://elai-media.s3.eu-west-2.amazonaws.com/staging/videos/630740247ca13c26ac13886d/slide733399051519_screenshot_1661506361822.jpg",
"url": "https://elai-media.s3.eu-west-2.amazonaws.com/staging/videos/630740247ca13c26ac13886d/kreativnyi-brif_kama.mp4"
}
}
Payload generally contains these fields:
Webhook Field | Desription |
---|---|
event string | One of specified event types. |
error string | If an error occurs during video processing, its summary description will be in this field. |
requestId string | If the video was created using Personalization API, this field would contain related request ID |
batchRowId string | If the video was created using Personalization API, this field would contain related index of video in a batch request |
video object | Actual video information. |
We expect a non-error response code (2xx) within 10 seconds in order to consider event delivery a success.
In case of error
After 10 failed deliveries (webhook returns non 2xx status) we temporarily disable a webhook. Then you should fix your endpoint and reactivate a webhook by resubscribing using API or visiting your API settings page.
In case you want to verify the origin of the request, to make sure Elai made the request, we sign each event with a specific header. To learn more about how to verify the signature, see this guide.
You can enable webhooks using API settings page.
Or you can also subscribe to webhooks via related API method.