agent-swarm.devagent-swarm.dev

Events

Stream and query swarm lifecycle events — task transitions, agent state changes, and audit log

GET
/api/events

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

category?string
Value in"tool" | "skill" | "session" | "api" | "task" | "workflow" | "system"
event?string
Value in"tool.start" | "tool.end" | "skill.invoke" | "skill.complete" | "session.start" | "session.end" | "session.resume" | "session.cost" | "api.request" | "api.error" | "task.poll" | "task.assign" | "task.timeout" | "workflow.step.start" | "workflow.step.end" | "workflow.run.start" | "workflow.run.end" | "system.boot" | "system.migration" | "system.error" | "script.global_upsert" | "schedule.deleted"
status?string
Value in"ok" | "error" | "timeout" | "skipped"
source?string
Value in"worker" | "api" | "hook" | "scheduler" | "cli"
agentId?string
taskId?string
sessionId?string
since?string
until?string
limit?integer
Range1 <= value <= 1000

Response Body

application/json

curl -X GET "http://localhost:3013/api/events"
{
  "events": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "category": "tool",
      "event": "tool.start",
      "status": "ok",
      "source": "worker",
      "agentId": "string",
      "taskId": "string",
      "sessionId": "string",
      "parentEventId": "string",
      "numericValue": 0,
      "durationMs": 0,
      "data": {
        "property1": null,
        "property2": null
      },
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ]
}
POST
/api/events

Authorization

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

curl -X POST "http://localhost:3013/api/events" \  -H "Content-Type: application/json" \  -d '{    "category": "tool",    "event": "tool.start",    "source": "worker"  }'
{
  "success": true,
  "event": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "category": "tool",
    "event": "tool.start",
    "status": "ok",
    "source": "worker",
    "agentId": "string",
    "taskId": "string",
    "sessionId": "string",
    "parentEventId": "string",
    "numericValue": 0,
    "durationMs": 0,
    "data": {
      "property1": null,
      "property2": null
    },
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/events/batch

Authorization

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

curl -X POST "http://localhost:3013/api/events/batch" \  -H "Content-Type: application/json" \  -d '{    "events": [      {        "category": "tool",        "event": "tool.start",        "source": "worker"      }    ]  }'
{
  "success": true,
  "count": 0
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/events/counts

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

category?string
Value in"tool" | "skill" | "session" | "api" | "task" | "workflow" | "system"
source?string
Value in"worker" | "api" | "hook" | "scheduler" | "cli"
agentId?string
taskId?string
sessionId?string
since?string
until?string

Response Body

application/json

curl -X GET "http://localhost:3013/api/events/counts"
{
  "counts": [
    {
      "event": "string",
      "count": 0
    }
  ]
}