Skip to content

Webhooks and event feeds let another service take part in your stream’s automation. For example, a service can notify the bot when something happens, or a heart-rate feed can supply a value for a pipeline or overlay. You configure them under Developers in the settings sidebar.

A webhook is an automatic message sent to a web address. An outbound webhook sends the bot’s events to another system; an inbound webhook accepts events sent to the bot. A custom event feed is useful when you need to extract particular values from incoming data, including data the bot checks repeatedly or receives over a persistent connection.

These are advanced connections: you need the receiving address, access details and data format from the other service. For a supported tip or membership service, start with Supporter sources, which chooses those connection details for you. You can also use API and devices when a tool only needs to run bot actions.

PageWhat it does
WebhooksSends the channel’s events out to your server, and takes in calls that outside providers post.
Custom event feedsBrings outside data in, such as a heart-rate sensor, and turns it into a custom event.

Who can use these pages

WhoWebhooksCustom event feeds
Moderator, Lead moderatorSees the webhooks, the deliveries and the approved hosts.Sees, makes, changes and deletes feeds.
Editor, BroadcasterAlso makes, changes, tests and deletes webhooks and approved hosts.The same.

These are the default permission floors; the channel’s configured permissions still apply. The roles are explained on the permissions settings page.

Approve a host first

Before you save an outbound webhook or a feed with an address, its host must be enabled on the channel’s Approved hosts list. The list is the last card on the Webhooks page.

  1. Type the host name in Host, for example hooks.example.com.
  2. Choose Add host. The host shows in the list, switched on.

The switch Allow posts to the host turns it off or on. A host that is off stays on the list and cannot be used for new connections you save. Polling feeds also check this switch before fetching. Existing outbound webhooks and socket feeds do not recheck it while sending or listening: switch off the webhook or feed itself to stop it.

The address must be public HTTPS. The bot refuses a host that points to a private or local network address, and it does not follow redirects. This holds even when the host is approved.

Remove asks first, and names the outbound webhooks and custom event feeds that use the host. Removing a host also switches off the outbound webhooks that use it.

Send events out

An outbound webhook posts the channel’s events to an address you control.

  1. Open Webhooks in the settings sidebar and choose New webhook. The New outbound webhook dialog opens.
  2. Type a Name.
  3. Type the Host: only the host name, without https://. The host must be on Approved hosts.
  4. Type a Path, for example /hooks/stream, or leave it empty.
  5. Tick the events under Events to send. They are grouped, for example Stream, Chat and Moderation.
  6. Optional: set Message body, Body is JSON and Custom headers in the same dialog (see the table below).
  7. Choose Create webhook. The Your signing secret dialog shows the secret.
  8. Choose Copy secret, keep it safe, then choose I saved it. The dialog shows the secret only this once.

The bot posts to https:// plus the host and the path. A path that would move the post to a different host is refused.

FieldWhat it doesDefault
Message bodyWhat each delivery sends. On a new webhook, empty sends the event’s values as one JSON object.Empty
Body is JSONOn, the body is checked as JSON when you save, and sent as JSON. Off, it is sent as plain text.On
Custom headersExtra headers, one per line, as Name: value.None

Saved headers stay hidden. On an edit, leave Custom headers empty to keep them, or type new lines to replace them.

Verify delivery signatures on your receiving server

Each delivery carries three headers: webhook-id, webhook-timestamp and webhook-signature. The signature is HMAC-SHA256 over the id, a dot, the timestamp, a dot and the body, made with your complete signing secret. It is written as v1, and the result in base64.

When you make a new signing secret, the bot signs with the new secret and with the one before it. The webhook-signature header then holds two signatures, split by a space. Your server can accept either while you change it over. The developer contract includes a verifier and the exact key encoding.

What happens when a delivery fails

A delivery counts as delivered when your server answers with a 2xx code. Any other answer is retried later. The first retry is scheduled 15–30 seconds later; the bot checks due retries every 30 seconds, so the actual send can be later. Later retries use an increasing delay with some randomness, capped at between 30 and 60 minutes per wait.

After 20 failed attempts in a row across the webhook’s deliveries, the bot switches it off. The row shows Switched off and the reason. Choose Turn back on to start again. Previously abandoned deliveries need Send again; turning the webhook back on does not reschedule them automatically.

Manage an outbound webhook

Each row shows how many events it sends, its address, and Last delivery, or Nothing delivered yet.

ActionWhat it does
The switchTurns the webhook on or off.
Send a testCurrently reports that test delivery is unavailable. Use a deliberately triggered subscribed event to check a receiver.
DeliveriesOpens the list of sent deliveries beside the page.
EditOpens the same dialog, with Save webhook. Host and Path cannot be changed after you make the webhook. To send to a new address, make a new webhook.
Make a new signing secretAsks first, then shows the new secret once.
DeleteAsks first, with the counts of what uses the webhook.

In Deliveries, each line shows its status, the answer code, the attempt and the time it took.

StatusMeaning
WaitingNot sent yet.
DeliveredYour server answered with a 2xx code.
FailedThe attempt was not confirmed successful. Check its error and next retry time; your server may still have received the request.
Gave upThe bot stopped trying, because the webhook was switched off.

Send again, on a line in Deliveries, sends that delivery once more. A webhook that is switched off must be turned back on first.

A pipeline can also send to an outbound webhook with its Send webhook step.

Receive calls from a provider

An inbound webhook is a link that an outside provider posts to. Each call can start a pipeline or raise an event.

  1. On Webhooks, choose New inbound webhook. The New inbound webhook dialog opens.
  2. Type a Name.
  3. Choose the Provider. You cannot change it after you make the webhook.
  4. Type the Secret that the provider signs its calls with.
  5. For the Generic provider only, fill in two paths in the body of a call:
    • Event kind path: where the kind of event sits, for example $.event.
    • Event id path: where the event’s id sits, for example $.id.
  6. Open Advanced, then choose a Pipeline to start, or type an Event to raise, or leave both empty. Event to raise is an event type that event responses can listen for.
  7. Choose Create webhook. The dialog closes and the new row shows Copy link. Until every needed field is filled in, the dialog names the missing fields after “Still needed to create”.
  8. Choose Copy link and paste the link into the provider’s webhook settings.
ProviderUse for
GenericAny service. You fill in where its signature and event fields sit.
KofiKo-fi.
GithubGithub.
FourthwallFourthwall.
ShopifyShopify.
PatreonPatreon.
BuymeacoffeeBuy Me a Coffee.

When a pipeline is chosen, it takes precedence over Event to raise. Without a pipeline, the call raises the Event to raise for event responses. With both empty, the webhook records the call without starting a pipeline or event response selected here. Connections managed by a supporter source or custom event feed can still have their own processing.

The bot takes a call only as JSON or as a form post, up to 256 KiB. A matching delivery already found in its event journal is acknowledged without running the automation again. The provider must supply a stable event id for this to work reliably; this acknowledgement is not a guarantee that the pipeline completed successfully.

Fields for a Generic provider

These optional fields are under Advanced in the dialog, next to Pipeline to start and Event to raise.

FieldWhat it does
Signature headerThe header that holds the signature. Empty means the secret is checked in the body instead.
Signature prefixText in front of the signature, such as sha256=.
Signing stringWhat is signed. Default: {id}.{timestamp}.{body}.
Timestamp headerThe header with the time of the call. A signed call needs it.
Secret field in the bodyThe field in the body that must hold the secret, when there is no signature header.

A signed call is checked with HMAC-SHA256, written in lowercase hex. A call more than 10 minutes older or newer than the bot’s clock is refused.

Manage an inbound webhook

Each row shows how many calls came in and when the last one came, or Nothing received yet. The switch turns it on or off. A webhook that is off refuses every call.

Make a new link asks first. The old link stops working at once. Update the provider with the new link.

Edit opens the dialog with Save webhook. On an edit, leave Secret empty to keep the saved secret. Delete asks first, and shows how many things use the webhook.

Bring in outside data

A custom event feed takes data from outside and makes a custom event from it. The event can start pipelines, fill variables and feed overlays.

  1. Open Custom event feeds in the settings sidebar and choose New feed. The New feed dialog opens.
  2. Choose How data arrives (see the table below).
  3. Optional: choose a service under Start from a service.
  4. Type a Name, for example Heart rate.
  5. Type an Event name, for example heartrate. The bot stores the event name in lowercase.
  6. Fill in Address, Secret and Check every (seconds), as the kind needs.
  7. Under Fields, choose Add field and fill in a Field name and its Path in the data, for example bpm and $.data.heartRate.
  8. Switch On to take in data. A new feed starts off.
  9. Choose Make feed. The dialog closes and the feed shows in the list.

Find the path of a field

A path starts with $ and names each step into the data, split by dots. For data like {"data": {"heartRate": 72}}, the path is $.data.heartRate.

For a polling feed with an HTTPS Address:

  1. Save the feed, then choose Test on its row.
  2. Choose Fetch now. The dialog lists the Paths found in the answer.
  3. Copy a path into Path in the data with Edit.

For a Source posts to us feed:

  1. Get one example of what the source sends, from the source’s own documentation.
  2. Write the path of each value you want, as shown above.
  3. Make sure the feed is switched On: a test of a feed that is off takes in nothing. Then choose Test on the feed’s row, paste the example into Sample data, and choose Send test event. The dialog shows “Sent.” and the row shows Last data.
  4. If a path is wrong, the row shows “These fields failed on the last data”, with the field names. Fix the path with Edit and test again.
How data arrivesWhat the bot doesAddressSecret
Check an addressReads the address on a timer.Needed.Sent as a bearer token. Optional.
Listen on a socketKeeps a connection open and takes in text messages.A secure wss: address is needed.Appended to the address, URL-escaped. Optional.
Source posts to usGives you a link that the source posts to.None.Needed.

The host of an Address must be on Approved hosts on the Webhooks page. Otherwise the feed is not saved. The address must be public HTTPS (or wss: for a socket). The bot refuses a host that points to a private or local network address, and a polling feed does not follow redirects. For a socket feed, include the service’s required query prefix in the address, such as ?token=. The bot appends the secret there; it does not send an Authorization header for a socket.

Check every (seconds) initially offers 30 seconds for a polling feed. Saved values below 10 seconds are raised to 10; a feed created through the API without an interval uses 60 seconds.

Start from a service offers HypeRate (Heart Rate) and Pulsoid (Heart Rate) for a socket feed. Choosing one records the service name but currently does not fill in the address or field paths; enter those yourself from the service’s connection details. A channel can have up to 50 feeds, each with its own Event name.

Use the feed’s data

For the heart-rate example, a source sends {"data": {"heartRate": 72}} and your field map names bpm at $.data.heartRate. The feed turns that outside value into a named bot event, so a pipeline can respond to it without needing to understand the source’s full data format.

Pipelines use custom. plus the event name as the trigger, for example custom.heartrate. Each field is a template variable: {custom.heartrate.bpm}. With the example data above, it prints 72 in a reply.

When a field’s path finds nothing in the data, the row shows “These fields failed on the last data”, with the field names. The other fields still come through.

Post to a feed from your own code

A service that posts for you only needs the link and the secret. The following request details are for developers implementing the sender themselves.

After you save a Source posts to us feed, its row shows Copy link. Give the link and the feed’s Secret to the source. The source posts JSON to the link, in this shape:

Part of the postWhat it holds
Header x-timestampThe time in Unix seconds.
Header x-signaturesha256= and the HMAC-SHA256 of the timestamp, a dot and the body, in lowercase hex, made with the feed’s secret.
Body field eventThe kind of event.
Body field idAn id. A second post with the same id is not taken in again.

A post more than 10 minutes away from the bot’s clock is refused. When a post arrives, the feed’s row shows Last data with the time.

Test, edit or delete a feed

Test opens a dialog with Sample data. Choose Send test event to fire the custom event with your sample. A test can start the feed’s real event responses and pipelines, so use sample data suitable for those actions. A feed with an address also has Fetch now, which reads the address once and lists the paths it found. It also fills Sample data with the answer, so you can choose Send test event right away. This is an HTTPS fetch, not a test of a socket subscription.

Edit opens the same dialog, with Save feed. On an edit, leave Secret empty to keep the saved one. Delete asks first, and shows how many event responses and widgets use the feed. The switch on the row turns the feed on or off.

Troubleshooting

When something is not right

An outbound webhook cannot be saved. Add its host to Approved hosts first, and make sure the host is switched on.

Your server refuses every delivery after a new signing secret. Update your server with the new secret, or let it accept both signatures in the webhook-signature header.

A provider’s calls stop working after a new link. Copy the new link with Copy link and paste it into the provider again.

A feed takes in nothing. Check that the feed is switched On. A new feed starts off.