Skip to content
KnockDevelopers
Webhooks

Create a webhook

Chat with a Developer
post/v1/webhooks

No “Try it” here: this call changes data. Run the code samples from your own backend.

Registers a URL, the event types Knock sends to it and, optionally, a name and the secret token Knock sends with every delivery to it. Your account can have up to 50 webhooks. Unknown fields are ignored. Ping the new webhook to check that your endpoint receives deliveries.

Needs an API key with the Admin role.

Authorization

ApiKeyAuth
headerx-api-key<token>

Your Knock API key. Reading webhooks takes a key with read access to integrations: the Admin, Editor, Viewer, CRM Admin or AI Manager role (not an Enrichment API key). Changing them takes a key with the Admin role.

Request Body

application/json
  1. body

A new webhook.

name?string

A label for the webhook, shown in the dashboard: 1 to 150 characters once Knock trims the spaces around it. Two webhooks can have the same name. Omit it for none.

Length1 <= length <= 150
url*string

The URL Knock POSTs events to: https, on port 443, with no user name or password, on a host that resolves to a public address. Each URL can be used by one webhook only, compared exactly as written: https://example.com/hook and https://example.com/hook/ are two URLs.

Formaturi
Lengthlength <= 2048
events*array<>

The event types to send to this webhook.

Items1 <= items
Value in"meeting.booked""meeting.rescheduled""meeting.declined""meeting.cancelled""meeting.completed""meeting.rejected""outreach.linkedin_invite_sent""outreach.linkedin_invite_accepted""member.linkedin_status_changed""enrichment_request.completed"
status?string

paused creates the webhook without sending it anything until you set it to active. Defaults to active.

Default"active"
Value in"active""paused"
secretToken?string

A secret you choose, sent as is in the knock-webhook-token header of every delivery to this webhook, so your endpoint can check that a delivery comes from Knock: 1 to 256 characters from A-Z, a-z, 0-9, _ and -. Omit it to send no token. Knock never returns it with the webhook: read it with GET /v1/webhooks/{webhookId}/secret-token.

Match^[A-Za-z0-9_-]{1,256}$
Length1 <= length <= 256

Response Body

The webhook was created.

application/json
  1. response

A URL Knock POSTs events to.

id*string

ID of the webhook, sent as the knock-webhook-id header.

Formatuuid
name*|

The label you gave the webhook. Null when it has none.

url*string

The URL Knock POSTs events to.

Formaturi
events*array<>

The event types sent to this webhook.

Value in"meeting.booked""meeting.rescheduled""meeting.declined""meeting.cancelled""meeting.completed""meeting.rejected""outreach.linkedin_invite_sent""outreach.linkedin_invite_accepted""member.linkedin_status_changed""enrichment_request.completed"
status*string

Whether Knock sends events to this webhook: active, or paused (Knock sends it nothing until you set it back to active).

Value in"active""paused"
hasSecretToken*boolean

Whether the webhook has a secret token. The token itself is never returned with the webhook: read it with GET /v1/webhooks/{webhookId}/secret-token.

createdAt*string

When the webhook was created.

Formatdate-time
Example Request
curl -X POST 'https://app.knock-ai.com/v1/webhooks' \  -H 'x-api-key: <YOUR_API_KEY>' \  -H 'Content-Type: application/json' \  -d '{  "url": "http://example.com",  "events": [    "meeting.booked"  ]}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "url": "http://example.com",  "events": [    "meeting.booked"  ],  "status": "active",  "hasSecretToken": true,  "createdAt": "2019-08-24T14:15:22Z"}