Phones

Allocate a phone

Changed on

Allocates an Android phone and opens a session you drive directly. Pass phone_id to pin a specific dedicated phone. If allocation setup fails the claim is rolled back, so you are never billed for a session that never starts.

post/phones:allocate

Request

Request body

accessibilityboolean

Accessibility mode for this session, which lets locators resolve against the phone's accessibility tree. Defaults to false. true requires a phone that supports it: only such phones are claimed, and a phone_id that does not support it is refused with an accessibility_unavailable conflict. It also needs your organization to have access to accessibility mode; without it the request is refused with a 403 whose message starts with accessibility_unavailable. While on, the accessibility service is visible to apps on the phone.

captureboolean

Capture media this session produces on the phone into the org's file library (default true). false disables capture for this session entirely.

namestring

Optional session label (letters, numbers, dots, hyphens, underscores; max 64). Unique among the org's active sessions - allocating with a name already in use returns a conflict.

phone_idstring

PhoneID pins allocation to a specific device (for dedicated devices).

phone_type'android' required

Category of device to allocate.

pool'shared' | 'dedicated'

Which pool to draw the phone from. Omit for shared. 'dedicated' claims any idle phone your organization rents; combine with phone_id to pin a specific one.

recordingboolean

Record this session's screen (default false). true stores a video of the session, available from the session's recording once it ends.

tagsobject

Optional key->value labels for organizing sessions (max 50 tags; keys up to 40 chars, values up to 128).

telemetryboolean

Emit this session's telemetry (default true). false suppresses telemetry entirely - no live trace stream and no durable trace store; the session dashboard shows a 'telemetry disabled' state.

Response

OK

accessibilityboolean required

Whether accessibility mode is on for this session, as requested. The phone confirms the state before the session goes live; if it cannot, the session ends with reason accessibility_unavailable.

allocated_atstring date-time required

When the session started.

control_urlstring

WebSocket URL for driving the phone over the device control protocol.

live_view_urlstring

Hosted live-view page URL (live screen + interaction, iframe-embeddable). Contains a session-scoped capability token; treat as a secret. Dies with the session.

phone_idstring required

Allocated device's identifier.

regionstring

Physical region or location of the device.

session_idstring required

Device_allocations row id — the canonical session identifier (WS-ID2).

telemetry_urlstring

URL of the session's telemetry event stream (Server-Sent Events; see GET /realtime/sessions/{session_id}/events), carrying a read-only token for this one session. Live while the session runs; afterwards it replays the trace and closes. Omitted when telemetry is off.

Changes

    • breaking

      removed the required property from the response with the status

    • warning

      removed the request property

    • info

      added the required property to the response with the status

    • info

      the request property default value false was added

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status