Duration and idle timeout

Two clocks matter: how long the session may live, and how long it may sit with nobody driving it.

In the dashboard: Session duration and Idle timeout. In the API: ttl_seconds and idle_timeout_seconds.

ttl_seconds (session duration)

SessionRequest.ttl_seconds: integer, minimum 60, maximum 3600, default 1800.

The plan can set a lower max in PlanBlock.max_ttl_seconds. Asking above the plan max can refuse with plan_ttl (ttl_seconds, max_ttl_seconds on the error).

{
  "country": "us",
  "ttl_seconds": 1800
}

On the response:

FieldMeaning
created_atUnix seconds.
expires_atUnix seconds; the session ends here at the latest.
seconds_leftUntil expires_at.

When the TTL hits, ended_reason can be expired.

idle_timeout_seconds

SessionRequest.idle_timeout_seconds: integer, minimum 30, default 300.

OpenAPI on the response field: the session ends (idle) after this many seconds with nobody attached or driving it, as asked at create.

Related response fields:

FieldMeaning
idle_timeout_secondsIdle limit that was set.
clientsClients attached over CDP right now. A person in the live view is not a client.
live_viewersViewers watching the live view. Watching keeps nothing alive.

So watching the live stream alone does not reset idle timeout. Driving the browser (or a CDP client attached) does.

{
  "country": "us",
  "ttl_seconds": 1800,
  "idle_timeout_seconds": 600
}

ended_reason

Once the session has ended, ended_reason is one word. Null while it lives.

Values from OpenAPI: expired, idle, stopped_by_user, session_traffic_cap, quota, failed_to_start, out_of_memory, browser_crashed, or closed.

ValuePlain meaning
expiredHit TTL / time limit.
idleHit idle timeout.
stopped_by_userYou deleted the session.
session_traffic_capHit per-session residential traffic cap.
quotaMonthly quota path.
failed_to_startNever came up.
out_of_memoryMemory guard path.
browser_crashedBrowser crash.
closedClosed.

error can hold a sentence when a session failed or ended early.

Next

Was this page helpful?

On this page