starting → active → completed, or error if the browser failed. A session ends when you stop it, at its duration, or when its machine goes away. One acquired from a browser pool is the same object (createdAt is when the browser was warmed) and also ends when its lease is released or expires.
Get a session
Same shape as create, plusbandwidthBytes: null while running, the metered total after (final by the time a stop returns; 0 if nothing moved). cdpUrl is null after the session ends.
List sessions
Newest first.status matches exactly (starting isn’t in ?status=active); anything outside starting, active, completed, error is a 400. page defaults to 1, pageSize to 20, max 100 (larger is clamped).
sessions, total, totalPages, page, pageSize. Items: sessionId, status, servedBy, type, country, createdAt, stoppedAt, bandwidthBytes, note. This is the only place the API reports country; type is null for the default type.
Label a session
Notes show in the dashboard’s session list and record. Set one on create, or later:{ "success": true }. Max 256 characters (longer is a 400); an empty string clears it. An ended session can’t be updated (400, Cannot update a terminal session).
Stop a session
Releases the browser and ends billing. Do it in afinally. A starting session can be stopped too.
{ "success": true }, also for a session that already ended, so a stop in a finally is always safe.
Duration
duration is the lifetime in seconds, 60 to 3600 inclusive, default 3600. There’s no extension call: pick one that covers the job, and start a new session (with a persisted profile if you need the state) when it runs out.
Waiting for active
Create returns with cdpUrl set. If you see starting, poll. The reference client has both of these.