docs
Webhooks

Create a webhook endpoint

POST
/v1/webhooks

Creates an endpoint and returns its signing secret. The secret is shown only once. Free.

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Create a key in the app under Developers. Keys start with dcd_live_.

Request Body

application/json
  1. body
url*string

Where we send events. Must be a public https URL.

Formaturi
Lengthlength <= 2000
events*array<>

Events to send to this URL.

Items1 <= items
audience_ids?array<>|

Only send audience events for these audiences. Null for all audiences.

Response Body

Success.

application/json
  1. response

A new webhook endpoint, including its signing secret. This is the only time the secret is shown.

id*string

Webhook endpoint id. Starts with wh_.

Match^wh_
url*string

Where we send events.

events*array<>

Events to send to this URL.

Items1 <= items
audience_ids*array<>|

Only send audience events for these audiences. Null for all audiences.

status*string

'disabled' after 3 events in a row fail all their retries. Re-enable it with PATCH.

Value in"active""disabled"
failure_count*integer

Events in a row that have failed all their retries.

Range0 <= value <= 9007199254740991
created_at*string

When the endpoint was created.

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
secret*string

Signing secret, starts with whsec_. Shown once. Use it to verify the Diced-Signature header.

Match^whsec_
request_id*string

Id of the request that produced this response. A replayed idempotent response keeps the original id.

Example Request
curl -X POST 'https://api.diced.si/v1/webhooks' \  -H 'Authorization: Bearer dcd_live_your_key' \  -H 'Content-Type: application/json' \  -d '{  "url": "https://example.com/webhooks/diced",  "events": [    "audience.ready",    "audience.new_leads"  ]}'
Example Response
{  "id": "string",  "url": "string",  "events": [    "audience.ready"  ],  "audience_ids": [    "string"  ],  "status": "active",  "failure_count": 0,  "created_at": "2019-08-24T14:15:22Z",  "secret": "string",  "request_id": "string"}