List active/recent agent sessions for a project
GET
/projects/{id}/agent-sessions
const url = 'https://example.com/api/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/agent-sessions?active=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/agent-sessions?active=true' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
Project UUID
Query Parameters
Section titled “Query Parameters ” active
string
When true (default), filters to sessions with last_activity_at within 5 minutes.
Responses
Section titled “ Responses ”Agent sessions
Media type application/json
object
sessions
required
Array<object>
object
session_id
required
string
machine_id
required
string
user_id
required
string
project_id
string | null format: uuid
caller_role
string | null
caller_origin
string | null
connected_at
string | null format: date-time
last_activity_at
required
string format: date-time
Not authenticated
Media type application/json
object
error
required
Human-readable error message
string
code
Stable machine-readable error code for client branching
string
fieldErrors
First validation message per field path
object
key
additional properties
string
issues
Structured validation issues (Zod)
Array<object>
object
path
required
string
message
required
string
retryAfter
Seconds until rate limit resets (429 responses)
number
reconnect
True if re-linking GitHub may fix the issue
boolean
Forbidden
Media type application/json
object
error
required
Human-readable error message
string
code
Stable machine-readable error code for client branching
string
fieldErrors
First validation message per field path
object
key
additional properties
string
issues
Structured validation issues (Zod)
Array<object>
object
path
required
string
message
required
string
retryAfter
Seconds until rate limit resets (429 responses)
number