Create Webhook
Creates a new webhook listener. Gumlet POSTs JSON to url for each matching event and sends secret_token in the x-gumlet-token header. Payload schemas are documented in the webhooks section.
Body
application/json
- Type: stringsecret
_token requiredSecret sent back in the
x-gumlet-tokenheader of each webhook POST so you can confirm the request came from Gumlet. - Type: array of stringsourcesrequired
List of video collection identifiers for which webhooks are needed to be invoked.
- Type: array of stringenumtriggersrequired
Events that invoke this webhook.
statussubscribes to every video asset status event.live-video-statussubscribes to every live video status event. Any other value subscribes to that event only.values- status
- live
-video -status - video
.status .created - video
.status .downloaded - video
.status .optimized - video
.status .ready - video
.status .errored - video
.status .deleted
- Type: stringurlrequired
URL from the application you want to send data to.
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
Request Example for post/org/webhooks
import Gumlet from '@gumlet/nodejs-sdk';
const client = new Gumlet({
apiKey: process.env['API_KEY'], // defaults to the API_KEY env var
});
const webhookEndpoint = await client.webhookEndpoints.create({
url: '',
secret_token: '',
triggers: ['status'],
sources: [''],
});
console.log(webhookEndpoint);
{
"id": "65eed75eadeea8478f14ebd4",
"url": "https://webhook.site/16df065a-b398-48bc-b825-b0804979c5f1",
"triggers": [
"status"
],
"created_at": "2024-03-11T10:05:18.316Z",
"updated_at": "2024-03-11T10:05:18.316Z",
"sources": [
"5f462c1561cf8a766464ffc4"
],
"secret_token": "rnVNfIKgnH"
}
