Sessions
Inspect task sessions — list recent root tasks and retrieve the full descendant task chain for a session
/api/agents/{id}/tokenAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
1 <= lengthResponse Body
application/json
application/json
curl -X DELETE "http://localhost:3013/api/agents/string/token"{
"revoked": 0
}{
"error": "string",
"property1": null,
"property2": null
}/api/agents/{id}/tokenAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/agents/string/token" \ -H "Content-Type: application/json" \ -d '{}'{
"agentId": "string",
"tokenId": "string",
"plaintext": "string",
"expiresAt": "string",
"agentCreated": true
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/agents/{id}/token/rotateAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/agents/string/token/rotate" \ -H "Content-Type: application/json" \ -d '{}'{
"agentId": "string",
"tokenId": "string",
"plaintext": "string",
"expiresAt": "string",
"previousExpiresAt": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/session-movesAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/session-moves" \ -H "Content-Type: application/json" \ -d '{ "rootTaskIds": [ "string" ], "groupKey": "string" }'{
"moved": [
"string"
],
"skipped": [
{
"rootTaskId": "string",
"reason": "string"
}
]
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/session-moves/prefixAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/session-moves/prefix" \ -H "Content-Type: application/json" \ -d '{ "from": "string", "to": "string" }'{
"moved": [
"string"
],
"skipped": [
{
"rootTaskId": "string",
"reason": "string"
}
],
"remaining": 0
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/session-treeAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
Sessions v2 view, for a user viewer with tree scope. mine (default): roots the user started from a human channel (not workflow, schedule, or system) plus sessions shared with the user. all: every tree session. Lists only: access is unchanged.
"mine" | "all"Comma-separated root sources to leave out, e.g. slack,chat. Older sessions v2 clients send this; showSource replaces it.
Comma-separated root sources to keep (the sessions v2 source filter), e.g. ui,slack. Present and empty keeps none; omit to keep every source.
Response Body
application/json
application/json
curl -X GET "http://localhost:3013/api/session-tree"{
"labels": {
"property1": "string",
"property2": "string"
},
"groups": [
{
"total": 0,
"unread": 0,
"running": 0,
"needsYou": 0,
"key": "string",
"lastActivityAt": "string"
}
],
"inbox": {
"total": 0,
"unread": 0,
"running": 0,
"needsYou": 0
},
"working": {
"total": 0,
"unread": 0,
"running": 0,
"needsYou": 0
},
"later": {
"total": 0,
"unread": 0,
"running": 0,
"needsYou": 0
},
"done": {
"total": 0,
"unread": 0,
"running": 0,
"needsYou": 0
},
"noGroup": {
"total": 0,
"unread": 0,
"running": 0,
"needsYou": 0
},
"sources": [
{
"source": "string",
"total": 0
}
]
}{
"error": "string",
"property1": null,
"property2": null
}/api/session-triageAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/session-triage" \ -H "Content-Type: application/json" \ -d '{ "action": "done" }'{
"updated": 0
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/sessionsAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
1 <= length1 <= length"true" | "false""inbox" | "working" | "later" | "done" | "unread""running" | "failed" | "needs"1 <= length"full" | "slim"mine: owned sessions. shared: sessions shared with me. tree: Sessions that GET /api/session-tree counts: mine plus shared with me, no ownerless roots. A bypass actor sees every root with tree scope. all: every user's sessions, read-only, for a user whose role lists session.read.all (the built-in auditor role; the grant-all admin role alone does not count); ignored for anyone else. The X-Swarm-Session-Scope: all header opts in the same way, also for tree.
"mine" | "shared" | "tree" | "all"Sessions v2 view, for a user viewer with tree scope. mine (default): roots the user started from a human channel (not workflow, schedule, or system) plus sessions shared with the user. all: every tree session. Lists only: access is unchanged.
"mine" | "all"Comma-separated root sources to leave out, e.g. slack,chat. Older sessions v2 clients send this; showSource replaces it.
Comma-separated root sources to keep (the sessions v2 source filter), e.g. ui,slack. Present and empty keeps none; omit to keep every source.
Response Body
application/json
application/json
curl -X GET "http://localhost:3013/api/sessions"{
"sessions": [
{
"root": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key": "string",
"agentId": "string",
"creatorAgentId": "string",
"task": "string",
"title": "string",
"status": "draft",
"source": "mcp",
"routingReason": "skill",
"routingSource": "declared",
"routingNote": "string",
"poolWakeAt": "string",
"taskType": "string",
"tags": [],
"priority": 50,
"dependsOn": [],
"offeredTo": "string",
"offeredAt": "2019-08-24T14:15:22Z",
"acceptedAt": "2019-08-24T14:15:22Z",
"rejectionReason": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastUpdatedAt": "2019-08-24T14:15:22Z",
"finishedAt": "2019-08-24T14:15:22Z",
"notifiedAt": "2019-08-24T14:15:22Z",
"statusKind": "agent",
"failureReason": "string",
"output": "string",
"progress": "string",
"slackChannelId": "string",
"slackThreadTs": "string",
"slackTriggerMessageTs": "string",
"slackUserId": "string",
"slackParticipants": {
"people": [
{
"slackUserId": "string",
"userId": "string",
"trust": "internal",
"starter": true,
"newest": true,
"asked": true
}
],
"more": 0
},
"slackReplySent": false,
"slackProgressMessageTs": "string",
"slackTreeRootMessageTs": "string",
"vcsProvider": "github",
"vcsRepo": "string",
"vcsEventType": "string",
"vcsNumber": 0,
"vcsCommentId": 0,
"vcsAuthor": "string",
"vcsUrl": "string",
"vcsInstallationId": 0,
"vcsNodeId": "string",
"agentmailInboxId": "string",
"agentmailMessageId": "string",
"agentmailThreadId": "string",
"mentionMessageId": "string",
"mentionChannelId": "string",
"dir": "string",
"parentTaskId": "string",
"dispatchedByTaskId": "string",
"claudeSessionId": "string",
"model": "string",
"modelTier": "smol",
"effort": "off",
"resolvedModel": "string",
"modelSource": "string",
"modelAlias": "string",
"resolvedEffort": "off",
"profile": "string",
"resolvedProfile": "string",
"modelGroup": "string",
"fallbackHops": [
{
"from": "string",
"profile": "string",
"errorClass": "rate_limit",
"at": "string",
"skipped": [
{
"profile": "string",
"reason": "string"
}
]
}
],
"scheduleId": "string",
"workflowRunId": "5ca99e95-15bc-4b23-a2d2-f5f4060373ab",
"workflowRunStepId": "87990b6e-ec5d-4b37-8b4e-9ef25c331b99",
"contextKey": "string",
"outputSchema": {
"property1": null,
"property2": null
},
"followUpConfig": {
"disabled": true,
"onCompleted": "string",
"onFailed": "string"
},
"wasPaused": false,
"deferredAt": "2019-08-24T14:15:22Z",
"deferredUntil": "2019-08-24T14:15:22Z",
"compactionCount": 0,
"peakContextPercent": 100,
"peakContextTokens": 0,
"contextWindowSize": 0,
"credentialKeySuffix": "string",
"credentialKeyType": "string",
"requestedByUserId": "string",
"swarmVersion": "string",
"provider": "claude",
"providerMeta": {
"property1": null,
"property2": null
},
"harnessVariant": "string",
"harnessVariantMeta": {
"property1": null,
"property2": null
},
"totalCostUsd": 0,
"routingAffinity": {
"sourceAgentId": "string",
"role": "string",
"harnessProvider": "claude",
"capabilities": [],
"leadOnly": true
},
"routingAffinityInvalid": true
},
"chainTaskCount": 0,
"lastActivityAt": "string",
"latestStatus": "draft",
"readState": "unread",
"snoozeUntil": "string",
"needsYou": true,
"groupKey": "string",
"shared": true,
"people": [
{
"id": "string",
"name": "string"
}
],
"peopleCount": 0,
"preview": "string",
"shares": [
{
"userId": "string",
"name": "string",
"access": "read"
}
]
}
],
"total": 0,
"limit": 0,
"offset": 0
}{
"error": "string",
"property1": null,
"property2": null
}/api/sessions/{rootTaskId}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
curl -X GET "http://localhost:3013/api/sessions/string"{
"root": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key": "string",
"agentId": "string",
"creatorAgentId": "string",
"task": "string",
"title": "string",
"status": "draft",
"source": "mcp",
"routingReason": "skill",
"routingSource": "declared",
"routingNote": "string",
"poolWakeAt": "string",
"taskType": "string",
"tags": [],
"priority": 50,
"dependsOn": [],
"offeredTo": "string",
"offeredAt": "2019-08-24T14:15:22Z",
"acceptedAt": "2019-08-24T14:15:22Z",
"rejectionReason": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastUpdatedAt": "2019-08-24T14:15:22Z",
"finishedAt": "2019-08-24T14:15:22Z",
"notifiedAt": "2019-08-24T14:15:22Z",
"statusKind": "agent",
"failureReason": "string",
"output": "string",
"progress": "string",
"slackChannelId": "string",
"slackThreadTs": "string",
"slackTriggerMessageTs": "string",
"slackUserId": "string",
"slackParticipants": {
"people": [
{
"slackUserId": "string",
"userId": "string",
"trust": "internal",
"starter": true,
"newest": true,
"asked": true
}
],
"more": 0
},
"slackReplySent": false,
"slackProgressMessageTs": "string",
"slackTreeRootMessageTs": "string",
"vcsProvider": "github",
"vcsRepo": "string",
"vcsEventType": "string",
"vcsNumber": 0,
"vcsCommentId": 0,
"vcsAuthor": "string",
"vcsUrl": "string",
"vcsInstallationId": 0,
"vcsNodeId": "string",
"agentmailInboxId": "string",
"agentmailMessageId": "string",
"agentmailThreadId": "string",
"mentionMessageId": "string",
"mentionChannelId": "string",
"dir": "string",
"parentTaskId": "string",
"dispatchedByTaskId": "string",
"claudeSessionId": "string",
"model": "string",
"modelTier": "smol",
"effort": "off",
"resolvedModel": "string",
"modelSource": "string",
"modelAlias": "string",
"resolvedEffort": "off",
"profile": "string",
"resolvedProfile": "string",
"modelGroup": "string",
"fallbackHops": [
{
"from": "string",
"profile": "string",
"errorClass": "rate_limit",
"at": "string",
"skipped": [
{
"profile": "string",
"reason": "string"
}
]
}
],
"scheduleId": "string",
"workflowRunId": "5ca99e95-15bc-4b23-a2d2-f5f4060373ab",
"workflowRunStepId": "87990b6e-ec5d-4b37-8b4e-9ef25c331b99",
"contextKey": "string",
"outputSchema": {
"property1": null,
"property2": null
},
"followUpConfig": {
"disabled": true,
"onCompleted": "string",
"onFailed": "string"
},
"wasPaused": false,
"deferredAt": "2019-08-24T14:15:22Z",
"deferredUntil": "2019-08-24T14:15:22Z",
"compactionCount": 0,
"peakContextPercent": 100,
"peakContextTokens": 0,
"contextWindowSize": 0,
"credentialKeySuffix": "string",
"credentialKeyType": "string",
"requestedByUserId": "string",
"swarmVersion": "string",
"provider": "claude",
"providerMeta": {
"property1": null,
"property2": null
},
"harnessVariant": "string",
"harnessVariantMeta": {
"property1": null,
"property2": null
},
"totalCostUsd": 0,
"routingAffinity": {
"sourceAgentId": "string",
"role": "string",
"harnessProvider": "claude",
"capabilities": [],
"leadOnly": true
},
"routingAffinityInvalid": true,
"citations": [
{
"index": 1,
"kind": "task",
"ref": "string",
"label": "string",
"quote": "string",
"general": true,
"resolvedUrl": "string",
"verified": "true"
}
],
"uiSpec": {
"spec": {
"root": "string",
"elements": {
"property1": null,
"property2": null
},
"state": {
"property1": null,
"property2": null
}
},
"actions": {
"property1": {
"kind": "follow_up",
"prompt": "string"
},
"property2": {
"kind": "follow_up",
"prompt": "string"
}
},
"fallbackText": "string"
},
"isLeadTask": true,
"supportedSteerModes": [
"steer"
]
},
"chain": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key": "string",
"agentId": "string",
"creatorAgentId": "string",
"task": "string",
"title": "string",
"status": "draft",
"source": "mcp",
"routingReason": "skill",
"routingSource": "declared",
"routingNote": "string",
"poolWakeAt": "string",
"taskType": "string",
"tags": [],
"priority": 50,
"dependsOn": [],
"offeredTo": "string",
"offeredAt": "2019-08-24T14:15:22Z",
"acceptedAt": "2019-08-24T14:15:22Z",
"rejectionReason": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastUpdatedAt": "2019-08-24T14:15:22Z",
"finishedAt": "2019-08-24T14:15:22Z",
"notifiedAt": "2019-08-24T14:15:22Z",
"statusKind": "agent",
"failureReason": "string",
"output": "string",
"progress": "string",
"slackChannelId": "string",
"slackThreadTs": "string",
"slackTriggerMessageTs": "string",
"slackUserId": "string",
"slackParticipants": {
"people": [
{
"slackUserId": "string",
"userId": "string",
"trust": "internal",
"starter": true,
"newest": true,
"asked": true
}
],
"more": 0
},
"slackReplySent": false,
"slackProgressMessageTs": "string",
"slackTreeRootMessageTs": "string",
"vcsProvider": "github",
"vcsRepo": "string",
"vcsEventType": "string",
"vcsNumber": 0,
"vcsCommentId": 0,
"vcsAuthor": "string",
"vcsUrl": "string",
"vcsInstallationId": 0,
"vcsNodeId": "string",
"agentmailInboxId": "string",
"agentmailMessageId": "string",
"agentmailThreadId": "string",
"mentionMessageId": "string",
"mentionChannelId": "string",
"dir": "string",
"parentTaskId": "string",
"dispatchedByTaskId": "string",
"claudeSessionId": "string",
"model": "string",
"modelTier": "smol",
"effort": "off",
"resolvedModel": "string",
"modelSource": "string",
"modelAlias": "string",
"resolvedEffort": "off",
"profile": "string",
"resolvedProfile": "string",
"modelGroup": "string",
"fallbackHops": [
{
"from": "string",
"profile": "string",
"errorClass": "rate_limit",
"at": "string",
"skipped": [
{
"profile": "string",
"reason": "string"
}
]
}
],
"scheduleId": "string",
"workflowRunId": "5ca99e95-15bc-4b23-a2d2-f5f4060373ab",
"workflowRunStepId": "87990b6e-ec5d-4b37-8b4e-9ef25c331b99",
"contextKey": "string",
"outputSchema": {
"property1": null,
"property2": null
},
"followUpConfig": {
"disabled": true,
"onCompleted": "string",
"onFailed": "string"
},
"wasPaused": false,
"deferredAt": "2019-08-24T14:15:22Z",
"deferredUntil": "2019-08-24T14:15:22Z",
"compactionCount": 0,
"peakContextPercent": 100,
"peakContextTokens": 0,
"contextWindowSize": 0,
"credentialKeySuffix": "string",
"credentialKeyType": "string",
"requestedByUserId": "string",
"swarmVersion": "string",
"provider": "claude",
"providerMeta": {
"property1": null,
"property2": null
},
"harnessVariant": "string",
"harnessVariantMeta": {
"property1": null,
"property2": null
},
"totalCostUsd": 0,
"routingAffinity": {
"sourceAgentId": "string",
"role": "string",
"harnessProvider": "claude",
"capabilities": [],
"leadOnly": true
},
"routingAffinityInvalid": true,
"citations": [
{
"index": 1,
"kind": "task",
"ref": "string",
"label": "string",
"quote": "string",
"general": true,
"resolvedUrl": "string",
"verified": "true"
}
],
"uiSpec": {
"spec": {
"root": "string",
"elements": {
"property1": null,
"property2": null
},
"state": {
"property1": null,
"property2": null
}
},
"actions": {
"property1": {
"kind": "follow_up",
"prompt": "string"
},
"property2": {
"kind": "follow_up",
"prompt": "string"
}
},
"fallbackText": "string"
},
"isLeadTask": true,
"supportedSteerModes": [
"steer"
]
}
],
"access": "owner",
"owner": {
"id": "string",
"name": "string"
},
"groupKey": "string",
"approvals": [
{
"id": "string",
"status": "pending",
"sourceTaskId": "string",
"title": "string"
}
],
"readState": "unread",
"lastActivityAt": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/sessions/{rootTaskId}/sharesAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
curl -X GET "http://localhost:3013/api/sessions/string/shares"{
"everyone": "none",
"users": [
{
"userId": "string",
"access": "read",
"createdAt": "string"
}
]
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/sessions/{rootTaskId}/sharesAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "http://localhost:3013/api/sessions/string/shares" \ -H "Content-Type: application/json" \ -d '{ "everyone": "none", "users": [ { "userId": "string", "access": "read" } ] }'{
"everyone": "none",
"users": [
{
"userId": "string",
"access": "read",
"createdAt": "string"
}
]
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/sessions/tokensAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/sessions/tokens" \ -H "Content-Type: application/json" \ -d '{ "agentId": "string" }'{
"tokenId": "string",
"plaintext": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/sessions/tokens/{tokenId}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
application/json
curl -X DELETE "http://localhost:3013/api/sessions/tokens/string"{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}