- Home
- Developers
- API quickstart
API guide
Read your first stage timer
This quickstart reads the same room state a stage display needs. It does not start, stop or change a cue.
ON THIS PAGE
Get a read-only key
Ask a team admin to open API keys in the app menu and create a key with the read scope. Limit it to the room if that is all the integration needs. The full key is shown once. Keep it in your secret store; never put it in a URL, client-side JavaScript or a shared command transcript.
In Bash, read the key without putting it in shell history. The examples use cURL and jq:
export API=https://api.runofsho.com/v1
read -rs -p 'API key: ' RUNOFSHO_KEY; printf '\n'
export RUNOFSHO_KEY
Find the room ID
curl -sS --fail-with-body "$API/rooms?limit=50" \
-H "Authorization: Bearer $RUNOFSHO_KEY" |
jq '{rooms: [.data[] | {id, name}], next_cursor: .meta.next_cursor}'
Choose the stage by name and copy its id, not its rundown ID. If next_cursor is not null, request the next page using --get --data-urlencode "cursor=$CURSOR" with the returned cursor. An empty final page means there are no more rooms visible to this credential. If you have no room yet, create a rehearsal.
Read the current cue
read -rp 'Room ID: ' ROOM
export ROOM
curl -sS --fail-with-body "$API/rooms/$ROOM/state" \
-H "Authorization: Bearer $RUNOFSHO_KEY" |
jq '.data | {version, cue: .current_timer.name, phase, remaining_ms}'
For example, {"version":14,"cue":"Welcome","phase":"green","remaining_ms":90000} means the selected cue has 90 seconds left at the time of that snapshot. remaining_ms can be negative in overrun or null when there is no remaining time to report. Keep version if you later send a command.
For Node.js with built-in fetch, run this in a .mjs file on your server with the same environment variables. Check the HTTP status before reading data:
const { API, ROOM, RUNOFSHO_KEY } = process.env;
const response = await fetch(`${API}/rooms/${encodeURIComponent(ROOM)}/state`, {
headers: { Authorization: `Bearer ${RUNOFSHO_KEY}` }
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${body.error?.code}`);
console.log(body.data.current_timer?.name ?? 'No cue selected', body.data.remaining_ms);
Troubleshoot a request
| Status | What to check |
|---|---|
| 401 | The key is missing, invalid or revoked. Check the bearer header; a successful call to the public clock does not validate a key. |
| 403 | The credential lacks permission for this operation. A display token cannot operate playback. |
| 404 | Verify the resource type, ID and team. A resource owned by another team is not disclosed. |
| 402 | Check error.code and the team's plan or quota before retrying. |
| 429 | Wait for the Retry-After interval. For a continuously updating screen, use a live event stream instead of polling each second. |
Endpoint reference
- Server clock for client clock sync:
GET /v1/time(getTime). - List rooms:
GET /v1/rooms(listRooms). - Get everything a display needs:
GET /v1/rooms/{roomId}/state(getRoomState).