Create a webhook (staff)
POST /api/automations/webhooks. Create a webhook (staff). Headless LMS Automations API reference.
Staff only (owner, admin, instructor). url must be a public address: localhost and private network addresses are refused when saved and when delivering. Each subscribed event is POSTed to url as the JSON event envelope (id, type, version, orgId, occurredAt, data), signed per the Standard Webhooks spec: webhook-id (the event id, stable across retries), webhook-timestamp (unix seconds) and webhook-signature (v1, + base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{body}, keyed with the base64-decoded part of the whsec_ secret). Any non-2xx response or timeout is a failed attempt and is retried. Deliveries are the webhook's automation runs: GET /api/automations/{id}/runs.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/automations/webhooks" \ -H "Content-Type: application/json" \ -d '{ "url": "http://example.com", "events": [ "string" ] }'{ "orgId": "string", "id": "string", "url": "string", "events": [ "string" ], "description": "string", "enabled": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "secret": "string"}{ "error": "string", "message": "string", "requestId": "string", "issues": [ { "path": "string", "message": "string" } ]}{ "error": "string", "message": "string", "requestId": "string"}{ "error": "string", "message": "string", "requestId": "string"}{ "error": "string", "message": "string", "requestId": "string"}