Create a webhook
/v1/webhooksNo “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.
ApiKeyAuthx-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.
application/json- body
A new webhook.
name?stringA 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.
1 <= length <= 150url*stringThe 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.
urilength <= 2048events*array<>The event types to send to this webhook.
1 <= items"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?stringpaused creates the webhook without sending it anything until you set it to active. Defaults to active.
"active""active""paused"secretToken?stringA 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.
^[A-Za-z0-9_-]{1,256}$1 <= length <= 256The webhook was created.
application/json- response
A URL Knock POSTs events to.
id*stringID of the webhook, sent as the knock-webhook-id header.
uuidname*|The label you gave the webhook. Null when it has none.
url*stringThe URL Knock POSTs events to.
urievents*array<>The event types sent to this webhook.
"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*stringWhether Knock sends events to this webhook: active, or paused (Knock sends it nothing until you set it back to active).
"active""paused"hasSecretToken*booleanWhether 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*stringWhen the webhook was created.
date-timecurl -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" ]}'{ "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"}