Active Sessions
Monitor and control active agent sessions running in the swarm
Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
Response Body
application/json
curl -X GET "http://localhost:3013/api/active-sessions"{
"sessions": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"agentId": "string",
"taskId": "string",
"triggerType": "string",
"inboxMessageId": "string",
"taskDescription": "string",
"runnerSessionId": "string",
"providerSessionId": "string",
"startedAt": "2019-08-24T14:15:22Z",
"lastHeartbeatAt": "2019-08-24T14:15:22Z"
}
]
}Authorization
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
curl -X POST "http://localhost:3013/api/active-sessions" \ -H "Content-Type: application/json" \ -d '{ "agentId": "string", "triggerType": "string" }'{
"session": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"agentId": "string",
"taskId": "string",
"triggerType": "string",
"inboxMessageId": "string",
"taskDescription": "string",
"runnerSessionId": "string",
"providerSessionId": "string",
"startedAt": "2019-08-24T14:15:22Z",
"lastHeartbeatAt": "2019-08-24T14:15:22Z"
}
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
curl -X DELETE "http://localhost:3013/api/active-sessions/string"{
"deleted": true
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
curl -X DELETE "http://localhost:3013/api/active-sessions/by-task/string"{
"deleted": true
}Authorization
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
curl -X POST "http://localhost:3013/api/active-sessions/cleanup" \ -H "Content-Type: application/json" \ -d '{}'{
"cleaned": 0
}Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Path Parameters
Response Body
application/json
curl -X PUT "http://localhost:3013/api/active-sessions/heartbeat/string"{
"updated": true
}Authorization
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
curl -X PUT "http://localhost:3013/api/active-sessions/provider-session/string" \ -H "Content-Type: application/json" \ -d '{ "providerSessionId": "string" }'{
"updated": true
}Authorization
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
curl -X POST "http://localhost:3013/api/active-sessions/recover-orphaned-tasks" \ -H "Content-Type: application/json" \ -d '{ "agentId": "string" }'{
"recovered": 0,
"tasks": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key": "string",
"agentId": "string",
"creatorAgentId": "string",
"task": "string",
"title": "string",
"status": "backlog",
"source": "mcp",
"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",
"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,
"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": []
}
}
]
}{
"error": "string",
"property1": null,
"property2": null
}