Is there a way to setup webhooks from livekit?
# ask-ai
b
Is there a way to setup webhooks from livekit?
g
Yes, you can set up webhooks in LiveKit to notify your server when specific room events occur. According to the LiveKit Webhooks documentation, webhooks can be configured in the settings section of your project's dashboard if you are using LiveKit Cloud. For self-hosting, you can enable webhooks by setting the webhook section in your configuration file. Webhook requests are sent as HTTP POST requests to the URLs you specify, and they include an Authorization header with a signed JWT token for validation. Would you like more details on how to configure or handle these webhooks? Sources: - LiveKit Webhooks documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
b
@millions-hair-24956 when I receive a webhook for room finished, can you give what an example request body looks like I see this in the docs
Copy code
interface WebhookEvent {
  event: 'room_finished';
  room: Room;
}
g
It seems likely that the request body for a "room_finished" webhook event in LiveKit would include details about the room that has finished. Based on the LiveKit Webhooks documentation, the
WebhookEvent
interface for a "room_finished" event would look like this:
Copy code
{
  "event": "room_finished",
  "room": {
    "sid": "RM_xxx",
    "name": "example-room",
    "metadata": "optional-metadata"
  }
}
This JSON object includes the event type (
room_finished
) and a
room
object containing the room's SID, name, and any optional metadata associated with the room. Would you like more detailed information on handling this webhook event? Sources: - LiveKit Webhooks documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.