Skip to main content
POST
Create a session

Authorizations

Authorization
string
header
required

Phone Harness account API key (pck_…). The dashboard may use a Clerk session JWT with the same header. Never put an account key in a URL.

Headers

Idempotency-Key
string

Same key plus same parsed JSON body reuses the session. Optional but recommended.

Pattern: ^[A-Za-z0-9_-]{16,128}$

Body

application/json
profile_id
string

Your account's profile id, from GET /me. The session then uses your own phone: its apps, logins and screen are saved when the session ends and restored for the next session started with the same profile_id. Only one session at a time may hold it, including the save after a session ends (409 profile_running). Omit for a temporary phone.

timeout_seconds
integer
default:300

Total session lifetime from admission, including provisioning. Omitting it uses 300 seconds. No unlimited mode; must fit a supported absolute timestamp.

Required range: x >= 1
provider
enum<string>

Optional provider selector. Omit it to use the service default. The current production service uses shlut.

Available options:
shlut

Response

Admitted or replayed session.

id
string
required

Opaque session ID.

state
enum<string>
required
Available options:
provisioning,
ready,
error,
closing
provider
string
required

Provider selected for this session.

device
string | null
required

Display label; not a device connection address.

close_requested
number | null
required

Time closure was requested. Unix time in seconds.

cleanup_pending
boolean
required
cleanup_status
enum<string> | null
required
Available options:
complete,
allocation_uncertain,
pending,
null
billing_mode
enum<string>
required
Available options:
metered,
disabled
phone
string | null
required

Legacy saved-phone ID. Null for a new disposable session.

watch_url
string<uri>
required

Sensitive read-only snapshot link. Not the interactive owner viewer.

screen
object | null
required
age_s
integer
required

Rounded seconds since creation.

ready_age_s
integer
required

Rounded seconds since readiness, stopped at closure; zero before readiness.

idle_s
integer
required

Rounded seconds since the last activity recorded by the API. Does not extend or replace a selected session deadline.

profile
string | null

The profile id this session holds, or null for a temporary phone.

progress
object

Only while state is provisioning: where the phone is. queued means every boot slot is busy and the phone starts as soon as one frees; booting means the phone is starting. eta_seconds is a typical remaining time from recent boots on this worker, not a promise.

error
string

Public startup failure, if present.

expires_at
number

Absolute session expiry, including provisioning. Unix time in seconds.

timeout_seconds
integer

Selected finite duration from creation, in seconds.

Required range: x >= 1
startup
object

Optional startup provenance. Presence is not a latency measurement or a guarantee that prepared starts are available.

request_key
string

Returned in a creation response when an idempotency key was supplied.

adb
object | null

Present once the session is ready and ADB is enabled.