Docs
/
/

Webhooks mAPI reference

Complete reference documentation for the Webhooks resource.

Webhooks

#

Outbound webhooks send event notifications from a Knock environment to an HTTP endpoint.

List webhooks

#

Returns a paginated list of outbound webhooks for a given environment.

Endpoint

GET/v1/webhooks

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

event_type
string

Filter webhooks by event type in dotted format (e.g. message.sent).

active
boolean

Filter webhooks by active status.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

Returns

PaginatedWebhookResponse

A paginated list of Webhook. Contains a list of entries and page information.

entries

A list of entries.

active
boolean
Required

Whether the webhook is currently active.

created_at
string(date-time)
Required

The timestamp of when the webhook was created.

description
string

An optional description of the webhook.

event_types
string[]
Required

The list of event types that this webhook is subscribed to, in dotted format (e.g. message.sent).

id
string(uuid)
Required

The unique identifier for the webhook.

secret_key
string

The secret key used to sign webhook payloads. Only returned when a webhook is first created.

updated_at
string(date-time)
Required

The timestamp of when the webhook was last updated.

url
string
Required

The URL that the webhook will send events to.

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

Create a webhook

#

Creates a new outbound webhook in the given environment. The response includes the secret_key which is only revealed at creation time.

Endpoint

POST/v1/webhooks

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

Request body

The request body for creating or updating an outbound webhook.

active
boolean

Whether the webhook should be active.

description
string

An optional description of the webhook.

event_types
string[]
Required

The list of event types that this webhook should be subscribed to, in dotted format (e.g. message.sent).

url
string
Required

The URL that the webhook will send events to.

Returns

WrappedWebhookResponse

Wraps the Webhook response under the webhook key.

webhook

An outbound webhook that receives event notifications.

active
boolean

Whether the webhook is currently active.

created_at
string(date-time)

The timestamp of when the webhook was created.

description
string

An optional description of the webhook.

event_types
string[]

The list of event types that this webhook is subscribed to, in dotted format (e.g. message.sent).

id
string(uuid)

The unique identifier for the webhook.

secret_key
string

The secret key used to sign webhook payloads. Only returned when a webhook is first created.

updated_at
string(date-time)

The timestamp of when the webhook was last updated.

url
string

The URL that the webhook will send events to.

Archive a webhook

#

Archives an outbound webhook.

Endpoint

DELETE/v1/webhooks/{id}

Path parameters

id
string(uuid)

The ID of the webhook to archive.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

Returns

ArchiveWebhookResponse

The response from archiving a webhook.

result
string

The result of the archive operation.

Get a webhook

#

Retrieves a single outbound webhook by its ID.

Endpoint

GET/v1/webhooks/{id}

Path parameters

id
string(uuid)

The ID of the webhook to retrieve.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

Returns

An outbound webhook that receives event notifications.

active
boolean

Whether the webhook is currently active.

created_at
string(date-time)

The timestamp of when the webhook was created.

description
string

An optional description of the webhook.

event_types
string[]

The list of event types that this webhook is subscribed to, in dotted format (e.g. message.sent).

id
string(uuid)

The unique identifier for the webhook.

secret_key
string

The secret key used to sign webhook payloads. Only returned when a webhook is first created.

updated_at
string(date-time)

The timestamp of when the webhook was last updated.

url
string

The URL that the webhook will send events to.

Update a webhook

#

Updates an existing outbound webhook.

Endpoint

PUT/v1/webhooks/{id}

Path parameters

id
string(uuid)

The ID of the webhook to update.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

Request body

The request body for creating or updating an outbound webhook.

active
boolean

Whether the webhook should be active.

description
string

An optional description of the webhook.

event_types
string[]
Required

The list of event types that this webhook should be subscribed to, in dotted format (e.g. message.sent).

url
string
Required

The URL that the webhook will send events to.

Returns

WrappedWebhookResponse

Wraps the Webhook response under the webhook key.

webhook

An outbound webhook that receives event notifications.

active
boolean

Whether the webhook is currently active.

created_at
string(date-time)

The timestamp of when the webhook was created.

description
string

An optional description of the webhook.

event_types
string[]

The list of event types that this webhook is subscribed to, in dotted format (e.g. message.sent).

id
string(uuid)

The unique identifier for the webhook.

secret_key
string

The secret key used to sign webhook payloads. Only returned when a webhook is first created.

updated_at
string(date-time)

The timestamp of when the webhook was last updated.

url
string

The URL that the webhook will send events to.

Webhook

#

An outbound webhook that receives event notifications.

Attributes

active
boolean

Whether the webhook is currently active.

created_at
string(date-time)

The timestamp of when the webhook was created.

description
string

An optional description of the webhook.

event_types
string[]

The list of event types that this webhook is subscribed to, in dotted format (e.g. message.sent).

id
string(uuid)

The unique identifier for the webhook.

secret_key
string

The secret key used to sign webhook payloads. Only returned when a webhook is first created.

updated_at
string(date-time)

The timestamp of when the webhook was last updated.

url
string

The URL that the webhook will send events to.

WebhookRequest

#

The request body for creating or updating an outbound webhook.

Attributes

active
boolean

Whether the webhook should be active.

description
string

An optional description of the webhook.

event_types
string[]

The list of event types that this webhook should be subscribed to, in dotted format (e.g. message.sent).

url
string

The URL that the webhook will send events to.

New chat