Sessions
Inspect task sessions — list recent root tasks and retrieve the full descendant task chain for a session
GET
/api/sessionsAuthorization
bearerAuth AuthorizationBearer <token>
API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
limit?|
offset?|
source?string
q?string
requestedByUserId?string
Length
1 <= lengthcontextKeyPrefix?string
Length
1 <= lengthfields?string
Value in
"full" | "slim"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",
"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",
"failureReason": "string",
"output": "string",
"progress": "string",
"slackChannelId": "string",
"slackThreadTs": "string",
"slackTriggerMessageTs": "string",
"slackUserId": "string",
"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",
"claudeSessionId": "string",
"model": "string",
"modelTier": "smol",
"effort": "off",
"resolvedModel": "string",
"modelSource": "string",
"modelAlias": "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",
"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"
}
],
"total": 0,
"limit": 0,
"offset": 0
}{
"error": "string",
"property1": null,
"property2": null
}GET
/api/sessions/{rootTaskId}Authorization
bearerAuth AuthorizationBearer <token>
API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
rootTaskId*string
Response Body
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",
"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",
"failureReason": "string",
"output": "string",
"progress": "string",
"slackChannelId": "string",
"slackThreadTs": "string",
"slackTriggerMessageTs": "string",
"slackUserId": "string",
"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",
"claudeSessionId": "string",
"model": "string",
"modelTier": "smol",
"effort": "off",
"resolvedModel": "string",
"modelSource": "string",
"modelAlias": "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",
"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"
}
],
"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",
"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",
"failureReason": "string",
"output": "string",
"progress": "string",
"slackChannelId": "string",
"slackThreadTs": "string",
"slackTriggerMessageTs": "string",
"slackUserId": "string",
"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",
"claudeSessionId": "string",
"model": "string",
"modelTier": "smol",
"effort": "off",
"resolvedModel": "string",
"modelSource": "string",
"modelAlias": "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",
"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"
}
],
"isLeadTask": true,
"supportedSteerModes": [
"steer"
]
}
]
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}POST
/api/sessions/tokensAuthorization
bearerAuth AuthorizationBearer <token>
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/sessions/tokens" \ -H "Content-Type: application/json" \ -d '{ "agentId": "string", "taskId": "string", "ttlMs": 604800000 }'{
"tokenId": "string",
"plaintext": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}DELETE
/api/sessions/tokens/{tokenId}Authorization
bearerAuth AuthorizationBearer <token>
API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
tokenId*string
Response Body
application/json
curl -X DELETE "http://localhost:3013/api/sessions/tokens/string"Empty
{
"error": "string",
"property1": null,
"property2": null
}