Twitch bot API and webhooks — connect tools to Roadie
API and webhooks · 7 min read ·
Use Roadie's control API, automation webhooks and the Call an API action from scripts, bots, devices or Stream Deck. Learn authentication, a read-only first request, and how to verify actions.
Roadie's control API lets another tool operate specific stream controls without a dashboard browser session. An automation webhook instead starts a flow you configured. The Call an API action works the other way: a flow sends a request to your own service. Use these to connect a script, another Twitch bot, a device or a Stream Deck key to Roadie.
Pick the right interface
| Interface | Use it for | Authentication |
|---|---|---|
| Control API | Read clip-queue status or operate a documented control, such as pausing clips or switching a Stage view | API token in the Authorization header |
| Automation webhook | Run the actions in one saved automation | Webhook address plus the channel secret in X-Roadie-Secret |
| Firebot or Streamer.bot connector | Coordinate Roadie output with an existing bot queue and report scene changes | Follow the connector's pairing flow |
| Call an API action | Send a request from a flow to your own HTTPS service and use its reply in later steps | Headers and saved tokens you set in the step |
The control API is a defined set of operations, not unrestricted access to everything in the dashboard. Do not use a Stage browser-source key as an API token.
Before you start
- You need a Roadie channel and owner access to create an API token.
- Your caller must support HTTP headers. A tool that only opens a URL cannot authenticate these requests.
- The target utility and any required connector must be configured. OBS actions require an OBS connection and the relevant API permission.
- Choose a read-only first request so you can verify authentication without changing the stream.
Create a token
Open Settings › API Commands. Give the token a name identifying its caller, choose Create API token, and copy it when shown. Give separate tools separate tokens so you can revoke one without replacing every integration.
Treat the token as a password. Keep it out of public code, screenshots, browser-source URLs and shared Stream Deck profiles. Store it in your caller's secret settings or process environment.
Make a read-only first request
Send the following request, substituting your token privately in the caller's authorization settings:
GET /api/control/clips HTTP/1.1
Host: dashboard.roadie.gg
Authorization: Bearer <YOUR_API_TOKEN>
The full address is https://dashboard.roadie.gg/api/control/clips. A successful response describes whether the clip queue is paused and how many clips are waiting or playing. The following values are illustrative, not a snapshot of your channel:
{"paused": false, "waiting": 0, "playing": 0}
This operation reads queue status; it does not start or stop a clip. Check the HTTP status before interpreting a response body as a successful result.
Choose an action
The dashboard's Commands list supplies fields and examples for the available controls. For example, POST /api/control/clips/pause pauses new clip starts, while POST /api/control/clips/resume allows the queue to continue. Those requests change stream behavior; send them when you intend that effect.
The same token presses the buttons you made on Automation › Buttons. GET /api/control/buttons lists the buttons that are on, with each one's slug and fields. POST /api/control/buttons/<slug>/press presses one, with {"fields": {…}} in the body when it asks for any. A press runs the button's actions with its own switch, cooldown and queue, and an unknown slug answers 404 with the slugs you have.
For button setup and a longer list of controls, follow Control Roadie from a Stream Deck. For a flow that combines several actions, create a webhook trigger in Automation, then follow Call a webhook from a Stream Deck.
Call a webhook
A webhook is a trigger with its own address. Send a POST with a JSON body and your channel's webhook secret in the X-Roadie-Secret header:
POST /api/hook?k=<WEBHOOK_ADDRESS> HTTP/1.1
Host: dashboard.roadie.gg
Content-Type: application/json
X-Roadie-Secret: <YOUR_WEBHOOK_SECRET>
{"message": "Thanks for the raid!", "amount": 5}
- The body holds the fields the webhook declares. Each field is text, a number, a true or false flag, or a Twitch login, and Roadie checks the kind strictly: send
5, not"5". Fields the webhook does not declare are dropped. The body can be up to 16 KB. - A
202answer means the run was accepted and queued. It does not mean every action finished; an OBS or bot action can finish after the answer. Check the webhook's run log. - A
400means a required field was missing or had the wrong kind, and nothing ran. A401means the secret was missing or wrong. A409means the webhook is switched off, and a429means it was called too often or is on its cooldown. - Keep the address private as well as the secret. Every call from the last 7 days is in the webhook's request log, with what it sent.
The flow can use any action your channel has on: chat, Stage alerts, sounds and TTS, music, polls, wheels, giveaways, currency, OBS, Discord, and flow steps such as waits, branches and variables. The action reference lists them all.
Send a request from Roadie to your service
Add the Call an API action to a flow to call your own service when something happens on stream, such as a raid, a redeem or a webhook call.
- Choose
GET,POST,PUT,PATCHorDELETE, and add up to 20 headers and a JSON, form or text body. Each can use fill-ins such as{user}. - Save a token for one host and use it as
{secret.<name>}. Roadie fills it in only when the request goes to that host, and hides it in the run log. - Later steps read the reply as
{api.status},{api.ok},{api.text}and{api.json.<path>}, such as{api.json.data.0.name}. - The address must be public HTTPS. Roadie refuses local network, loopback and private addresses. A call has 5 seconds and reads up to 64 KB of the reply, and a channel can make 60 calls a minute.
For a device on your home network, let the device call Roadie (a webhook or the control API) so nothing on your network has to be exposed. To have Roadie call the device, put a public HTTPS relay or tunnel in front of it.
Check the result and diagnose failures
| Symptom | Check |
|---|---|
| Unauthorized response | Confirm the correct token and Bearer header. A Stage key or a browser URL is not a replacement. |
| A Stream Deck key only opens a browser | Use a web-request plugin that can send headers, rather than the built-in Website action. |
| A webhook does not run | Confirm its address, X-Roadie-Secret header and enabled trigger; inspect the webhook request log. |
| A flow starts but skips an action | Check conditions, utility access, permissions, connectors and the Stream log. |
| An OBS request is accepted but nothing visibly changes | Check the OBS connection and permission, then inspect completion; acceptance is not proof the action finished. |
Do not blindly retry a write request after a timeout: the action may have happened even if the caller missed its response. Check state before repeating prize draws, currency changes or other consequential actions. Never assume every endpoint is safe to repeat.
Using an AI agent as the caller
Give an agent the operation's exact contract and only the credential it needs in an appropriate secret store. Separate reading state from changing it. Require the intended user's authorization before actions such as drawing a winner or changing the broadcast, and verify the actual result.
The public API reference should tell a caller what an operation does, how it authenticates and what success means. A private dashboard endpoint discovered in browser traffic is not automatically a supported integration API. For a bot-to-bot connection, prefer the documented Firebot or Streamer.bot setup.