Skip to content
gist.link ↗

sessions

Query Agent Workforce API — POST https://agentworkforce.api.gist.link/graphql

Work sessions, optionally scoped to one workforce.

agentworkforce:query:sessions

The calling IAM key must hold this permission (or a wildcard that covers it: agentworkforce:query:* or agentworkforce:*) and the access token must have been minted with audience=agentworkforce. See Permissions.

type Query {
sessions(workforceUuid: ID, status: String, first: Int, after: String): WorkSessionConnection!
}
Argument Type Required Description
workforceUuid ID No —
status String No —
first Int No —
after String No —

WorkSessionConnection! — see the Agent Workforce types reference.

Terminal window
curl https://agentworkforce.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "query Sessions($workforceUuid: ID, $status: String, $first: Int, $after: String) { sessions(workforceUuid: $workforceUuid, status: $status, first: $first, after: $after) { totalCount edges { cursor node { uuid workforceUuid triggerKind goal status stepsUsed tokensIn tokensOut } } } }",
"variables": {
"workforceUuid": "01a01234-abcd-7000-9000-0123456789ab",
"status": "example",
"first": 10,
"after": "cursor"
}
}
JSON