# Devices

> Door phones authorized by a link, scoped to one event

Source: https://tickets.roostertail.com/docs/reference/devices

Every operation below is also in [the OpenAPI document](https://tickets.roostertail.com/v1/openapi.yaml). One that names an MCP tool can be called through [the MCP server](https://tickets.roostertail.com/docs/mcp.md); one that names none cannot.

## List door devices

`GET /v1/devices`

Operation id `listDevices`. MCP tool `list_devices`. SDK `tickets.devices.list`.

Door devices (phones), filtered by event or status, with their gate and whether they may sell.

**Who may call it.** Any one of: An API key with scope `full`, `read`. Any other scope answers `insufficient_scope`; A signed-in dashboard member whose role has `read` (owner, admin, staff, viewer).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `limit` | query | integer | How many to return, 1 to 100 (default 20). |
| `starting_after` | query | string | An id from the page before: the page after it. |
| `ending_before` | query | string | An id from the page after: the page before it. A list read from the database offers it as the list comes and filtered by event alone, in the default order, and answers parameter_invalid to any other… |
| `event` | query | string | An id starting with evt_. |
| `status` | query | "pending" \| "active" \| "revoked" \| "expired" | pending (made, not yet opened on a phone), active, revoked, expired. |

**Answers 200.** A page of devices.

**Fields**

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "list" |  |
| `data` * | array of Device | This page, newest first. |
| `has_more` * | boolean | True when there is another page: pass the last id as starting_after. |
| `url` * | "/v1/devices" | The path this list came from (/v1/devices). |

\* required

## Authorize a door phone (a link and QR)

`POST /v1/devices`

Operation id `createDevice`. MCP tool `create_device`. SDK `tickets.devices.create`.

Authorizes a door phone for one event. The answer carries a one-time `pairing_url`: open it on the phone (or scan its QR). `sales_allowed: true` lets the phone sell at the gate. No answer is kept for a retry, because it holds the pairing code: a call whose answer was lost may have made a device, so list the devices before you try again. A device that never paired does nothing and can be revoked.

**Who may call it.** Any one of: An API key with scope `full`. Any other scope answers `insufficient_scope`; A signed-in dashboard member whose role has `devices.manage` (owner, admin, staff).

**Request body** (`CreateDeviceInput`)

| Field | Type | Description |
| --- | --- | --- |
| `event` * | string | An id starting with evt_. |
| `name` * | string |  |
| `gate` | string | A gate or door name ("Gate B"). |
| `sales_allowed` | boolean |  |
| `expires_at` | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |

\* required

```json
{
  "event": "evt_yrd2027",
  "name": "Gate B phone",
  "gate": "Gate B",
  "sales_allowed": true
}
```

**Answers 201.** The device, with its one-time pairing_url.

**Fields** (`Device`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device" |  |
| `id` * | string | An id starting with dev_. |
| `mode` * | Mode | test or live, decided by the key (rt_test_… or rt_live_…). Test and live data never mix. |
| `event` * | string | An id starting with evt_. |
| `name` * | string |  |
| `gate` * | string \| null |  |
| `sales_allowed` * | boolean | May sell at the gate. |
| `status` * | DeviceStatus | pending (made, not yet opened on a phone), active, revoked, expired. |
| `pairing_url` * | string \| null | The one-time link (and QR) that authorizes a phone: only in the answer that made it, until it is used. |
| `expires_at` * | string (date-time) | After the event's last day by default. |
| `last_seen_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `manifest_at` * | string \| null | When it last downloaded the offline manifest (its generated_at); null: never. Older than 10 minutes while doors are open, its offline answers may be stale. |
| `pending_scans` * | integer \| null | Offline scans it holds that the server has not seen, as it last reported (each manifest refresh sends pending_scans, and each sync says what it still holds, a revoked phone's too); null: it never reported. A phone with… |
| `created_by` * | Actor | Who made a change. |
| `created_at` * | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `revoked_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `hand_in_count` | integer | Records this phone handed in after it was turned off, at most 2000. Absent: none. |
| `hand_in_settled` | integer | How many of those a manager has dealt with (POST /v1/devices/{id}/hand_in): the Check-in page speaks up while hand_in_count is above it. |
| `hand_in_ended_at` | string (date-time) | A manager ended the phone's hand-in early. |

\* required

**Errors of its own.** [`invalid_state_transition`](https://tickets.roostertail.com/docs/errors.md#invalid_state_transition). The errors every operation can answer are on [the errors page](https://tickets.roostertail.com/docs/errors.md).

## The calling device

`GET /v1/devices/me`

Operation id `getThisDevice`.

The device making the call, with its event, gate and whether it may sell. A door app calls this on start.

**Who may call it.** A door device, for its own event.

**Answers 200.** This device.

**Fields** (`Device`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device" |  |
| `id` * | string | An id starting with dev_. |
| `mode` * | Mode | test or live, decided by the key (rt_test_… or rt_live_…). Test and live data never mix. |
| `event` * | string | An id starting with evt_. |
| `name` * | string |  |
| `gate` * | string \| null |  |
| `sales_allowed` * | boolean | May sell at the gate. |
| `status` * | DeviceStatus | pending (made, not yet opened on a phone), active, revoked, expired. |
| `pairing_url` * | string \| null | The one-time link (and QR) that authorizes a phone: only in the answer that made it, until it is used. |
| `expires_at` * | string (date-time) | After the event's last day by default. |
| `last_seen_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `manifest_at` * | string \| null | When it last downloaded the offline manifest (its generated_at); null: never. Older than 10 minutes while doors are open, its offline answers may be stale. |
| `pending_scans` * | integer \| null | Offline scans it holds that the server has not seen, as it last reported (each manifest refresh sends pending_scans, and each sync says what it still holds, a revoked phone's too); null: it never reported. A phone with… |
| `created_by` * | Actor | Who made a change. |
| `created_at` * | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `revoked_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `hand_in_count` | integer | Records this phone handed in after it was turned off, at most 2000. Absent: none. |
| `hand_in_settled` | integer | How many of those a manager has dealt with (POST /v1/devices/{id}/hand_in): the Check-in page speaks up while hand_in_count is above it. |
| `hand_in_ended_at` | string (date-time) | A manager ended the phone's hand-in early. |

\* required

**Errors of its own.** [`device_token_invalid`](https://tickets.roostertail.com/docs/errors.md#device_token_invalid). The errors every operation can answer are on [the errors page](https://tickets.roostertail.com/docs/errors.md).

## Retrieve a device

`GET /v1/devices/{id}`

Operation id `getDevice`. MCP tool `get_device`. SDK `tickets.devices.retrieve`.

One door device with its event, gate, status, whether it may sell, and when it last called.

**Who may call it.** Any one of: An API key with scope `full`, `read`. Any other scope answers `insufficient_scope`; A signed-in dashboard member whose role has `read` (owner, admin, staff, viewer).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` * | path | string | An id starting with dev_. |

**Answers 200.** The device.

**Fields** (`Device`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device" |  |
| `id` * | string | An id starting with dev_. |
| `mode` * | Mode | test or live, decided by the key (rt_test_… or rt_live_…). Test and live data never mix. |
| `event` * | string | An id starting with evt_. |
| `name` * | string |  |
| `gate` * | string \| null |  |
| `sales_allowed` * | boolean | May sell at the gate. |
| `status` * | DeviceStatus | pending (made, not yet opened on a phone), active, revoked, expired. |
| `pairing_url` * | string \| null | The one-time link (and QR) that authorizes a phone: only in the answer that made it, until it is used. |
| `expires_at` * | string (date-time) | After the event's last day by default. |
| `last_seen_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `manifest_at` * | string \| null | When it last downloaded the offline manifest (its generated_at); null: never. Older than 10 minutes while doors are open, its offline answers may be stale. |
| `pending_scans` * | integer \| null | Offline scans it holds that the server has not seen, as it last reported (each manifest refresh sends pending_scans, and each sync says what it still holds, a revoked phone's too); null: it never reported. A phone with… |
| `created_by` * | Actor | Who made a change. |
| `created_at` * | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `revoked_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `hand_in_count` | integer | Records this phone handed in after it was turned off, at most 2000. Absent: none. |
| `hand_in_settled` | integer | How many of those a manager has dealt with (POST /v1/devices/{id}/hand_in): the Check-in page speaks up while hand_in_count is above it. |
| `hand_in_ended_at` | string (date-time) | A manager ended the phone's hand-in early. |

\* required

## Rename, move to a gate, allow sales

`PATCH /v1/devices/{id}`

Operation id `updateDevice`. MCP tool `update_device`. SDK `tickets.devices.update`.

Renames a device, moves it to another gate, or turns gate sales on or off.

**Who may call it.** Any one of: An API key with scope `full`. Any other scope answers `insufficient_scope`; A signed-in dashboard member whose role has `devices.manage` (owner, admin, staff).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` * | path | string | An id starting with dev_. |

**Request body** (`UpdateDeviceInput`)

| Field | Type | Description |
| --- | --- | --- |
| `name` | string |  |
| `gate` | string \| null | A gate or door name ("Gate B"). |
| `sales_allowed` | boolean |  |

```json
{
  "gate": null
}
```

**Answers 200.** Updated.

**Fields** (`Device`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device" |  |
| `id` * | string | An id starting with dev_. |
| `mode` * | Mode | test or live, decided by the key (rt_test_… or rt_live_…). Test and live data never mix. |
| `event` * | string | An id starting with evt_. |
| `name` * | string |  |
| `gate` * | string \| null |  |
| `sales_allowed` * | boolean | May sell at the gate. |
| `status` * | DeviceStatus | pending (made, not yet opened on a phone), active, revoked, expired. |
| `pairing_url` * | string \| null | The one-time link (and QR) that authorizes a phone: only in the answer that made it, until it is used. |
| `expires_at` * | string (date-time) | After the event's last day by default. |
| `last_seen_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `manifest_at` * | string \| null | When it last downloaded the offline manifest (its generated_at); null: never. Older than 10 minutes while doors are open, its offline answers may be stale. |
| `pending_scans` * | integer \| null | Offline scans it holds that the server has not seen, as it last reported (each manifest refresh sends pending_scans, and each sync says what it still holds, a revoked phone's too); null: it never reported. A phone with… |
| `created_by` * | Actor | Who made a change. |
| `created_at` * | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `revoked_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `hand_in_count` | integer | Records this phone handed in after it was turned off, at most 2000. Absent: none. |
| `hand_in_settled` | integer | How many of those a manager has dealt with (POST /v1/devices/{id}/hand_in): the Check-in page speaks up while hand_in_count is above it. |
| `hand_in_ended_at` | string (date-time) | A manager ended the phone's hand-in early. |

\* required

**Errors of its own.** [`invalid_state_transition`](https://tickets.roostertail.com/docs/errors.md#invalid_state_transition). The errors every operation can answer are on [the errors page](https://tickets.roostertail.com/docs/errors.md).

## Deal with what a turned-off phone handed in

`POST /v1/devices/{id}/hand_in`

Operation id `settleDeviceHandIn`. MCP tool `settle_device_hand_in`. SDK `tickets.devices.settleHandIn`.

Deals with what a turned-off phone handed in (at most 2,000 records). `take_back` corrects every admission it handed in, each with your reason, so each is on the record and the count moves: while the answer says `more`, send it again with a new Idempotency-Key. `keep` lets them stand. `end_window` stops its sync now.

**Who may call it.** Any one of: An API key with scope `full`. Any other scope answers `insufficient_scope`; A signed-in dashboard member whose role has `devices.manage` (owner, admin, staff).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` * | path | string | An id starting with dev_. |

**Request body** (`SettleHandInInput`)

| Field | Type | Description |
| --- | --- | --- |
| `action` * | "take_back" \| "keep" \| "end_window" | take_back: every admission this phone handed in, each corrected with this reason, so each is on the record and the count moves; send it again while `more` is true. keep: they stand. end_window: its sync stops now. |
| `reason` | string | Required for take_back. |

\* required

```json
{
  "action": "take_back",
  "reason": "A stolen phone"
}
```

**Answers 200.** What was done.

**Fields** (`DeviceHandIn`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device_hand_in" |  |
| `device` * | Device | A door phone. Its token is scoped to one event (and a gate), expires, and can be revoked. Door staff need no account. |
| `taken_back` * | integer |  |
| `skipped` * | integer | Admissions that could not be taken back (a later re-entry came first). |
| `more` * | boolean | Out of time on this call: send it again. |

\* required

**Errors of its own.** [`invalid_state_transition`](https://tickets.roostertail.com/docs/errors.md#invalid_state_transition). The errors every operation can answer are on [the errors page](https://tickets.roostertail.com/docs/errors.md).

## Revoke a device now

`POST /v1/devices/{id}/revoke`

Operation id `revokeDevice`. MCP tool `revoke_device`. SDK `tickets.devices.revoke`.

Revokes a device now: every call answers `device_token_invalid`, but for one. For 24 hours it can still send the scans it saved offline (`POST /v1/checkins/sync`), so people it let in aren't lost. Each one is named by the device, and a manager can take it back.

**Who may call it.** Any one of: An API key with scope `full`. Any other scope answers `insufficient_scope`; A signed-in dashboard member whose role has `devices.manage` (owner, admin, staff).

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` * | path | string | An id starting with dev_. |

**Answers 200.** Revoked: its token stops working, but for sending its offline scans for 24 hours.

**Fields** (`Device`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device" |  |
| `id` * | string | An id starting with dev_. |
| `mode` * | Mode | test or live, decided by the key (rt_test_… or rt_live_…). Test and live data never mix. |
| `event` * | string | An id starting with evt_. |
| `name` * | string |  |
| `gate` * | string \| null |  |
| `sales_allowed` * | boolean | May sell at the gate. |
| `status` * | DeviceStatus | pending (made, not yet opened on a phone), active, revoked, expired. |
| `pairing_url` * | string \| null | The one-time link (and QR) that authorizes a phone: only in the answer that made it, until it is used. |
| `expires_at` * | string (date-time) | After the event's last day by default. |
| `last_seen_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `manifest_at` * | string \| null | When it last downloaded the offline manifest (its generated_at); null: never. Older than 10 minutes while doors are open, its offline answers may be stale. |
| `pending_scans` * | integer \| null | Offline scans it holds that the server has not seen, as it last reported (each manifest refresh sends pending_scans, and each sync says what it still holds, a revoked phone's too); null: it never reported. A phone with… |
| `created_by` * | Actor | Who made a change. |
| `created_at` * | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `revoked_at` * | string \| null | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |
| `hand_in_count` | integer | Records this phone handed in after it was turned off, at most 2000. Absent: none. |
| `hand_in_settled` | integer | How many of those a manager has dealt with (POST /v1/devices/{id}/hand_in): the Check-in page speaks up while hand_in_count is above it. |
| `hand_in_ended_at` | string (date-time) | A manager ended the phone's hand-in early. |

\* required

**Errors of its own.** [`invalid_state_transition`](https://tickets.roostertail.com/docs/errors.md#invalid_state_transition). The errors every operation can answer are on [the errors page](https://tickets.roostertail.com/docs/errors.md).

## A phone trades its pairing code for its token

`POST /v1/devices/pair`

Operation id `pairDevice`.

A phone trades its one-time pairing code for its device token, which is shown once. No key needed: the code is the proof.

**Who may call it.** Anyone: no key or sign-in is needed.

**Request body** (`PairDeviceInput`)

| Field | Type | Description |
| --- | --- | --- |
| `pairing_code` * | string | From the pairing link. |

\* required

```json
{
  "pairing_code": "abcdefghijklmnopqrst"
}
```

**Answers 200.** The device token, shown once.

**Fields** (`DevicePairing`)

| Field | Type | Description |
| --- | --- | --- |
| `object` * | "device_pairing" |  |
| `device` * | Device | A door phone. Its token is scoped to one event (and a gate), expires, and can be revoked. Door staff need no account. |
| `token` * | string | The device's bearer token: kept on the phone, shown once. |
| `expires_at` * | string (date-time) | An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC. |

\* required

**Errors of its own.** [`pairing_code_invalid`](https://tickets.roostertail.com/docs/errors.md#pairing_code_invalid). The errors every operation can answer are on [the errors page](https://tickets.roostertail.com/docs/errors.md).
