WoyraDocs
Get an API key

Register a webhook endpoint

POST/v1/webhook_endpoints

Webhooks · Requires an API key

Returns the signing secret **once**, like an API key. Verify every delivery against it: the signature covers the timestamp and the body, and signatures older than five minutes must be rejected.

The URL must be public HTTPS. Private, loopback and link-local destinations are refused, and the check is repeated at delivery time in case DNS is repointed afterwards.

A URL has one endpoint. Registering one that already exists sets its events and answers 200 with the same id and secret.

Body

FieldTypeDescription
urlrequiredstring
eventsarray of stringThe event types to send; empty means every one. Email sends email.sent, email.delivered, email.undelivered (a bounce), email.failed, email.complained, email.canceled, email.opened, email.clicked and email.received.

Example

curl -X POST https://api.woyra.io/v1/webhook_endpoints \
  -H "Authorization: Bearer $WOYRA_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://api.yourapp.com/hooks/woyra"
  }'

Response

200 The URL was already registered; its event filter is updated.

FieldTypeDescription
object"webhook_endpoint"
idstring
urlstring
eventsarray of string
statusstringA consistently failing endpoint is quarantined rather than hammered.
One of active, quarantined, disabled.
consecutive_failuresinteger
created_attimestamp
secretstringPresent only in the response to creation.

Errors

StatusCodes
400invalid_request, unsupported_version

Also in Webhooks