Register a webhook endpoint
The endpoint receives a signed POST for each event of event_types (empty or absent:
every type). The response carries the signing secret (whsec_...), shown only here
(Cache-Control: no-store). The URL must be https and must not point at a private,
loopback or link-local address, unless the instance sets OHS_WEBHOOK_ALLOW_PRIVATE=true.
At most 20 endpoints per tenant. Idempotency-Key is ignored here. See docs/webhooks.md.
tenantKeyAuthorizationBearer <token>Tenant API key, ohs_sk_ + 43 base62 characters.
application/json- body
url*stringurilength <= 2048description?stringlength <= 255event_types?array<>Empty or absent means every type, including types added later.
Registered.
application/json- response
id*stringuuidurl*stringdescription*stringevent_types*array<>status*stringAn endpoint that has accepted nothing for 5 days is disabled when one more delivery runs out of attempts.
"active""disabled"disabled_reason*string|nullfailing_since*|Start of the current run of failed attempts; null after a success.
date-timelast_success_at*|date-timecreated_at*stringdate-timeupdated_at*stringdate-timesecret*stringwhsec_ signing secret. Shown only once.
curl -X POST 'http://localhost:8080/v1/webhooks' \ -H 'Authorization: Bearer ohs_sk_...' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://app.example.com/hooks/health"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "url": "string", "description": "string", "event_types": [ "data.written" ], "status": "active", "disabled_reason": "string", "failing_since": "2019-08-24T14:15:22Z", "last_success_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"}