Releasesv0.1.0
Api referenceEndpointsAdmin

Register a webhook endpoint (instance admin, one tenant)

POST
/v1/admin/tenants/{tenant_id}/webhooks

POST /v1/webhooks (createWebhook) for the tenant of tenant_id, run with an instance admin key: the same body, parameters and answer as the tenant's own key gets; a Location points at the admin route. Recorded in the caller's audit log and, actor admin, in the tenant's. See docs/admin-api.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

tenant_id*string

The id of a tenant; any other value is a 404.

Formatuuid

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Request Body

application/json
  1. body
url*string
Formaturi
Lengthlength <= 2048
description?string
Lengthlength <= 255
event_types?array<>

Empty or absent means every type, including types added later.

Response Body

Registered.

application/json
  1. response
id*string
Formatuuid
url*string
description*string
event_types*array<>
status*string

An endpoint that has accepted nothing for 5 days is disabled when one more delivery runs out of attempts.

Value in"active""disabled"
disabled_reason*string|null
failing_since*|

Start of the current run of failed attempts; null after a success.

Formatdate-time
last_success_at*|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
secret*string

whsec_ signing secret. Shown only once.

curl -X POST 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/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"}
Edit on GitHub