Add a webhook endpoint

Adds an endpoint and chooses its events. The signing secret is in the answer, once: keep it to check each delivery.

POST/v1/webhooks

Requireswebhooks:manageon the API key

Body

urlstring, uriRequired

Where Merrin sends events, an https:// address

eventsarray of stringRequired

The events to send, at least one

Responses

201
Added. The signing secret is in data.secret, shown once.
401
Missing, wrong or revoked key
403
The key lacks webhooks:manage, with reason: "missing_ability"
422
The address or the events are not valid, with the reason beside each field
429
Past 120 requests a minute. Wait for Retry-After seconds.