Create a webhook
const url = 'https://optlo.com/api/v1/webhooks';const options = { method: 'POST', headers: { 'idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"url":"https://example.com/webhooks/optlo","types":["message.created"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://optlo.com/api/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: example' \ --data '{ "url": "https://example.com/webhooks/optlo", "types": [ "message.created" ] }'Requires webhooks:manage and the read scope for every selected event. Idempotency-Key is required and retained for 24 hours, scoped to this key and POST /webhooks. Retrying identical validated input returns the original response, including its signing secret. Different input returns 409. At most 50 subscriptions per workspace; creating more returns 402 limit_exceeded. Store the signing secret securely; list responses omit it. Active subscriptions receive matching new events asynchronously. Destinations must use HTTPS and a public DNS hostname.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Show child attributes
HTTPS endpoint with a public hostname. Credentials and URL fragments are not allowed.
Event types to subscribe to. The API key must have the read scope for each type.
Response
Section titled “Response”Created
Show child attributes
Unique identifier for the webhook subscription.
HTTPS endpoint that receives matching events.
Event types this subscription receives.
Time the subscription was created.
Whether the subscription is active or disabled. Disabled subscriptions receive no new events.
Time the subscription was disabled, or null while active.
Reason the subscription was disabled: manually, an HTTP 410 response, or repeated failures. Null while active.
Secret used to verify webhook signatures. Store it securely; only creation and retained idempotent retries return it.
Example
{ "id": "hook_mR9kL3xN6pB2vQ8z_B8kN4pR6xZ2", "url": "https://example.com/webhooks/optlo", "types": [ "message.created" ], "createdAt": "2026-10-13T08:00:00.000Z", "status": "active", "disabledAt": null, "disabledReason": null, "signingSecret": "example_secret_replace_with_your_own_12345678"}