Overview
A webhook delivers the events from a project to a URL you control. A project can subscribe to its room, participant, track, egress, and ingress events. For what each event means, see Webhooks.
When you leave signingKey empty, LiveKit signs deliveries with the oldest key of the project that isn't an agent key, and stores that key as the webhook's signing key. Adding keys later doesn't change it. If the project has no such key, the request returns 400.
Listing webhooks and event types needs the Read role on the project. Creating, updating, deleting, and sending a test event need the Write role.
To call these endpoints from the CLI, use the lk project webhook commands, for example lk project webhook list --user-auth.
The webhook object
A webhook destination of a project.
idstringThe webhook ID.
namestringA label for the destination.
urlstringThe URL that receives the events.
signingKeystringThe API key of this project whose secret signs each delivery. It is a key ID, not a secret. Empty signs with the oldest key in the project.
filterParamsFilterParamsThe events to send, named by includeEvents or excludeEvents. Read the names from List webhook events.
To learn more, see FilterParams.
List webhooks
/v0/projects/{projectId}/webhooksLists the webhook destinations for the project, in the order that they were added. The list is always one page.
Returns the full list of Webhook objects.
Path parameters
projectIdstringThe project ID (p_...).
Query parameters
page.cursorstringThe cursor of the page to return: the nextCursor of the previous page. When empty, the list starts at the first item.
page.pageSizeint32The maximum number of items to return. When 0, the list uses its default page size.
Create webhook
/v0/projects/{projectId}/webhooksReturns the Webhook object.
Path parameters
projectIdstringThe project ID (p_...).
Request body
namestringA label for the destination.
urlstringThe HTTP or HTTPS URL that receives the deliveries as POST requests.
signingKeystringThe API key of this project whose secret signs the deliveries. Optional. When empty, the API uses the oldest API key of the project and saves it on the webhook.
filterParamsFilterParamsThe names of the events to deliver, from ListWebhookEvents. When unset, the webhook gets every event.
To learn more, see FilterParams.
Update webhook
/v0/projects/{projectId}/webhooks/{webhookId}Returns the Webhook object.
Path parameters
projectIdstringThe project ID (p_...).
webhookIdstringThe webhook ID.
Request body
The changes to a webhook. An unset field keeps its value.
namestringThe project name.
urlstringThe URL that receives the events.
signingKeystringThe API key of this project whose secret signs the deliveries. When unset or empty, the signing key does not change.
filterParamsFilterParamsThe names of the events to deliver. A set filter replaces the whole filter. An empty filter delivers every event.
To learn more, see FilterParams.
Delete webhook
/v0/projects/{projectId}/webhooks/{webhookId}Path parameters
projectIdstringThe project ID (p_...).
webhookIdstringThe webhook ID.
Send test webhook
/v0/projects/{projectId}/webhooks/{webhookId}:testPath parameters
projectIdstringThe project ID (p_...).
webhookIdstringThe webhook ID.
Request body
eventstringThe event to send: one of the names from ListWebhookEvents. The API sends it with sample data and ignores the webhook filter.
Response fields
statusCodeint32The HTTP status of the response from the receiver. 0 when no response arrived.
errorstringThe reason that no response arrived, such as a timeout or a refused connection. Empty when statusCode is set.
List webhook events
/v0/projects/{projectId}/webhook-eventsLists the event names that the webhooks of a project can receive. The list is always one page.
Returns the full list of string values.
Path parameters
projectIdstringThe project ID (p_...).
Query parameters
page.cursorstringThe cursor of the page to return: the nextCursor of the previous page. When empty, the list starts at the first item.
page.pageSizeint32The maximum number of items to return. When 0, the list uses its default page size.