Skip to main content
GET
https://api.usedari.com
/
public
/
sessions
from dari import Dari

client = Dari(api_key="YOUR_API_KEY")

# List all active sessions
sessions = client.list_sessions(status_filter="active", limit=10)

print(f"Found {sessions['total']} active sessions")
for session in sessions['sessions']:
    print(f"- {session['session_id']}: {session['status']}")
{
  "sessions": [
    {
      "session_id": "sess_a1b2c3d4e5f6",
      "cdp_url": "ws://browser-proxy.usedari.com/devtools/browser/a1b2c3d4",
      "screen_config": {
        "width": 1920,
        "height": 1080
      },
      "status": "active",
      "expires_at": "2024-11-26T10:34:00Z",
      "metadata": {
        "purpose": "workflow-automation"
      },
      "created_at": "2024-11-26T09:34:00Z",
      "updated_at": "2024-11-26T09:34:00Z"
    }
  ],
  "total": 1
}
Retrieve a list of all browser sessions in your workspace, with optional filtering by status.

Headers

X-API-Key
string
required
Your API key for authentication

Query Parameters

status_filter
string
Optional filter by session status: active, terminated, or expired
limit
integer
Maximum number of sessions to return (default: 100)
offset
integer
Number of sessions to skip for pagination (default: 0)

Response Fields

sessions
array
Array of session objects, each containing:
  • session_id - Unique session identifier
  • cdp_url - Browser CDP URL (if managed)
  • screen_config - Screen dimensions configuration
  • status - Current status (active, terminated, expired)
  • expires_at - Expiration timestamp
  • metadata - Custom metadata
  • created_at - Creation timestamp
  • updated_at - Last update timestamp
total
integer
Total number of sessions matching the filter
from dari import Dari

client = Dari(api_key="YOUR_API_KEY")

# List all active sessions
sessions = client.list_sessions(status_filter="active", limit=10)

print(f"Found {sessions['total']} active sessions")
for session in sessions['sessions']:
    print(f"- {session['session_id']}: {session['status']}")
{
  "sessions": [
    {
      "session_id": "sess_a1b2c3d4e5f6",
      "cdp_url": "ws://browser-proxy.usedari.com/devtools/browser/a1b2c3d4",
      "screen_config": {
        "width": 1920,
        "height": 1080
      },
      "status": "active",
      "expires_at": "2024-11-26T10:34:00Z",
      "metadata": {
        "purpose": "workflow-automation"
      },
      "created_at": "2024-11-26T09:34:00Z",
      "updated_at": "2024-11-26T09:34:00Z"
    }
  ],
  "total": 1
}

Error Responses

{
  "detail": "Invalid API key"
}