# Read your first stage timer

> Make a read-only runofsho API request with cURL or Node.js. Find a room ID, read its countdown and diagnose authentication, permission and rate-limit errors.

- Canonical: https://runofsho.com/developers/quickstart/
- Last updated: 2026-11-22
- Publisher: runofsho

## 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`:

```bash
export API=https://api.runofsho.com/v1
read -rs -p 'API key: ' RUNOFSHO_KEY; printf '\n'
export RUNOFSHO_KEY
```

## Find the room ID

```bash
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](https://runofsho.com/developers/rundowns/).

## Read the current cue

```bash
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](https://runofsho.com/developers/playback/).

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`:

```js
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](https://runofsho.com/developers/live-events/) instead of polling each second. |

## Endpoint reference

- [Server clock for client clock sync](https://api.runofsho.com/docs/#tag/state/GET/v1/time): `GET /v1/time` (`getTime`).
- [List rooms](https://api.runofsho.com/docs/#tag/rooms/GET/v1/rooms): `GET /v1/rooms` (`listRooms`).
- [Get everything a display needs](https://api.runofsho.com/docs/#tag/state/GET/v1/rooms/{roomId}/state): `GET /v1/rooms/{roomId}/state` (`getRoomState`).
