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:
| Field | Meaning |
|---|---|
created_at | Unix seconds. |
expires_at | Unix seconds; the session ends here at the latest. |
seconds_left | Until 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:
| Field | Meaning |
|---|---|
idle_timeout_seconds | Idle limit that was set. |
clients | Clients attached over CDP right now. A person in the live view is not a client. |
live_viewers | Viewers 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.
| Value | Plain meaning |
|---|---|
expired | Hit TTL / time limit. |
idle | Hit idle timeout. |
stopped_by_user | You deleted the session. |
session_traffic_cap | Hit per-session residential traffic cap. |
quota | Monthly quota path. |
failed_to_start | Never came up. |
out_of_memory | Memory guard path. |
browser_crashed | Browser crash. |
closed | Closed. |
error can hold a sentence when a session failed or ended early.
Next
Was this page helpful?