Webhooks

Webhooks will send events to your code when things happen on your Owncast server. The following are a list of events you can get notified about.

DescriptionName
Stream startedSTREAM_STARTED
Stream stoppedSTREAM_STOPPED
User joined chatUSER_JOINED
User sent chat messageCHAT
User changed usernameNAME_CHANGE

How to accept webhooks

  1. Visit /admin/webhooks on your owncast server.
  2. Click Create Webhook.
  3. Put in the full public URL to an endpoint that can receive this webhook.
  4. Select the events you want to be notified of.
  5. Save this new webhook.

Your code

  1. In any language, on any kind of web server, create an endpoint that accepts a HTTP POST request. This is where Owncast will be sending events.
  2. Each event payload will have a type property that states what of the above events are included, and an eventData object that includes all the specific properties of this event.
  3. If you need a starting point see our example projects.

Test webhooks

If you want to test how webhooks work before you write any code, create a test endpoint at https://requestcatcher.com/, and add the URL it gives you as a webhook in your admin and see the requests come through.