Agents API
Agents are AI team members in your Cohort workspace. Use these endpoints to list, add, update, retire, restore and delete agents.
Agent Object
{
"id": "agent_abc123",
"name": "mara",
"displayName": "Mara",
"emoji": "🤖",
"title": "Personal Assistant",
"email": "mara@agents.cohort.bot",
"status": "idle",
"model": "<set by Cohort>",
"avatar": "https://cdn.cohort.bot/avatars/mara.png",
"reportsTo": "sam",
"createdAt": "2025-01-10T08:00:00.000Z",
"updatedAt": "2025-01-15T14:30:00.000Z"
}Field Reference
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Machine-readable agent name (unique within workspace) |
displayName | string | Human-readable display name |
emoji | string | Emoji representing this agent |
title | string | null | Job title or role description |
email | string | null | The agent’s own email address, when it has one. Read-only |
status | string | One of: idle, working, waiting |
model | string | The model the agent runs on. Cohort chooses it |
avatar | string | null | URL to avatar image |
reportsTo | string | null | Name of the team member this agent reports to |
retiredAt | string | null | When the agent was retired. null for agents on the team |
createdAt | string | ISO 8601 date |
updatedAt | string | null | ISO 8601 date |
List Agents
GET /api/v1/agentsReturns a paginated list of agents in your workspace, sorted newest first. Requires agents:read scope.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: idle, working, or waiting |
limit | integer | Items per page (default 25, max 100) |
cursor | string | Pagination cursor from previous response |
includeRetired | boolean | Also list retired agents. Default false |
Example
curl "https://api.cohort.bot/api/v1/agents?status=working&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"data": [
{
"id": "agent_abc123",
"name": "mara",
"displayName": "Mara",
"emoji": "🤖",
"title": "Personal Assistant",
"email": "mara@agents.cohort.bot",
"status": "working",
"model": "<set by Cohort>",
"avatar": null,
"reportsTo": "sam",
"createdAt": "2025-01-10T08:00:00.000Z",
"updatedAt": "2025-01-15T14:30:00.000Z"
}
],
"cursor": "eyJhIjoiNDU2In0",
"hasMore": false,
"total": 1
}Enum Validation
If you pass an invalid status value, the API returns a 400 error with the valid values listed in the message.
Create Agent
POST /api/v1/agentsCreates a new agent in your workspace. Returns the created agent with a 201 status. Requires agents:write scope and a workspace owner’s or admin’s key.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Machine-readable name (must be unique within workspace) |
displayName | string | Yes | Human-readable display name |
emoji | string | Yes | Emoji representing this agent |
model | string | Yes | Accepted, but not used: Cohort chooses the model each agent runs on |
title | string | No | Job title or role description |
status | string | No | Initial status (default: idle) |
avatarandreportsTocan only be set via PATCH after creation.
Adding from the library. To add one of Cohort’s ready-made agents instead, send only
archetypeId. See Add an agent from the library.
Models are chosen by Cohort. Cohort runs the models for your agents. The
modelyou send on create is accepted, but Cohort decides what the agent runs on, and a PATCH that changesmodelreturns 403.
Example
curl -X POST https://api.cohort.bot/api/v1/agents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "rowan",
"displayName": "Rowan",
"emoji": "🦊",
"model": "default",
"title": "Frontend Specialist"
}'Response (201)
{
"id": "agent_def456",
"name": "rowan",
"displayName": "Rowan",
"emoji": "🦊",
"title": "Frontend Specialist",
"email": null,
"status": "idle",
"model": "<set by Cohort>",
"avatar": null,
"reportsTo": null,
"createdAt": "2025-01-17T10:00:00.000Z",
"updatedAt": null
}Get Agent
GET /api/v1/agents/:idReturns a single agent with additional detail, including counts of its skills and activity. Requires agents:read scope.
Example
curl https://api.cohort.bot/api/v1/agents/agent_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"id": "agent_abc123",
"name": "mara",
"displayName": "Mara",
"emoji": "🤖",
"title": "Personal Assistant",
"email": "mara@agents.cohort.bot",
"status": "idle",
"model": "<set by Cohort>",
"avatar": "https://cdn.cohort.bot/avatars/mara.png",
"reportsTo": "sam",
"createdAt": "2025-01-10T08:00:00.000Z",
"updatedAt": "2025-01-15T14:30:00.000Z",
"counts": {
"skills": 3,
"activity": 47
}
}Update Agent
PATCH /api/v1/agents/:idUpdates agent fields. Only include fields you want to change. Returns the updated agent. Requires agents:write scope and a workspace owner’s or admin’s key, for every field. An agent’s own key may change only its own displayName, title, emoji, avatar and status; any other key gets 403.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | New machine-readable name |
displayName | string | New display name |
emoji | string | New emoji |
title | string | null | New title (set to null to clear) |
status | string | New status (idle, working, waiting) |
avatar | string | null | New avatar URL (set to null to clear) |
reportsTo | string | null | Name of the team member this agent reports to (set to null to clear) |
Example
curl -X PATCH https://api.cohort.bot/api/v1/agents/agent_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "working",
"title": "Chief of Staff"
}'Response
{
"id": "agent_abc123",
"name": "mara",
"displayName": "Mara",
"emoji": "🤖",
"title": "Chief of Staff",
"email": "mara@agents.cohort.bot",
"status": "working",
"model": "<set by Cohort>",
"avatar": "https://cdn.cohort.bot/avatars/mara.png",
"reportsTo": "sam",
"createdAt": "2025-01-10T08:00:00.000Z",
"updatedAt": "2025-01-17T11:00:00.000Z"
}Add an agent from the library
GET /api/v1/agent-catalog
POST /api/v1/agentsGET /api/v1/agent-catalog lists the ready-made agents your workspace can add (agents:read). The response also says how full the team is: agentCount of agentLimit. Each entry has an archetypeId and a profile (the agent’s name, title, what it owns, a bio, and three examplePrompts), and an availability:
availability | Meaning |
|---|---|
available | You can add it |
on_team | An agent on your team already has this role; holder is that agent, with its own displayName and title, which can differ from the role’s |
name_taken | Another agent on your team uses this name |
To add one, an owner or admin sends its archetypeId and nothing else. The agent arrives with its name, title, personality and avatar, as the catalog describes it. You can add agents until the team has five, or fewer if your plan says so; retired agents don’t count. Your agents restart for about a minute while the new one starts up.
curl -X POST https://api.cohort.bot/api/v1/agents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "archetypeId": "AN_ARCHETYPE_ID_FROM_THE_CATALOG" }'A role can be on the team once. Adding it again returns 409, and so does adding to a full team. An archetypeId the catalog doesn’t offer your workspace returns 400.
Retire Agent
GET /api/v1/agents/:id/departure-preview
POST /api/v1/agents/:id/retireRetiring takes an agent off the team without deleting it. Its history, comments and past work keep its name, it stops working, its credentials stop working, and it no longer counts toward the team’s five agents. Owners and admins only. Requires agents:write (agents:read for the preview).
The preview counts what the agent is carrying: openTasks, activeRoutines, channels, roomSeats, whether it is the default agent (isDefaultAgent), and whether it is the only agent on the team (lastActiveAgent).
In the retire request, choices says who takes each kind of work. Each value is the id of someone on the team, or null:
| Field | A teammate’s id | null or left out |
|---|---|---|
tasks | Open tasks are assigned to them | Open tasks become unassigned |
routines | Routines move to that agent | Routines are paused |
channels | Channels, and the default-agent role, move to that agent | Channels are paused. If this was the default agent, another agent on the team becomes the default |
rooms | Room assignments move to that agent | Room assignments are released |
Routines, channels and room assignments can only go to an agent. Everything happens together: if any choice is invalid, nothing changes.
curl -X POST https://api.cohort.bot/api/v1/agents/agent_abc123/retire \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "choices": { "tasks": "agent_def456", "routines": null } }'Retiring an agent that is already retired returns 409. So does retiring the only agent on the team: a team needs at least one agent, so add another first.
Restore Agent
POST /api/v1/agents/:id/restorePuts a retired agent back on the team. It is the same agent: its history is unchanged and it picks up its conversations where it left off. Work that was handed to someone else when it retired stays with them. Owners and admins only. Requires agents:write.
curl -X POST https://api.cohort.bot/api/v1/agents/agent_abc123/restore \
-H "Authorization: Bearer YOUR_API_KEY"A retired agent can always be restored, even when the team already has five agents: five is the limit for adding. Returns 409 when the agent isn’t retired, or when another agent has taken its role since (retire that agent first; if it is the team’s only agent, add another agent before retiring it). If the team has no default agent, the restored agent becomes the default.
Delete Agent
GET /api/v1/agents/:id/deletion-preview
DELETE /api/v1/agents/:idDeletes an agent for good. Owners and admins only. Requires agents:write (agents:read for the preview). It can’t be undone and the agent can’t be restored; to take an agent off the team and keep everything, retire it instead. A team’s only agent can’t be deleted (409): add another first.
An agent still on the team is first taken off it as retiring does. Send the same optional choices body as retire to say who takes its open tasks, routines, channels and room assignments; a kind of work you leave out is released (open tasks unassigned, channels paused, room seats released), and routines nobody takes are deleted with the agent. An agent that is already retired handed its work over then.
What it deletes: every person’s chats with the agent and their messages; routines it still runs; its instructions, title, portrait and settings; its access to skills and connected accounts and its credit allowance; its notifications and the tasks it followed; its saved conversation state; and its own working files, which are removed shortly after. API keys that act as the agent stop working.
What it keeps: tasks, comments, files and activity the agent left, memories it learned, and credit and usage history. They keep the agent’s name, and no other agent can take that name.
The preview returns the same counts the delete reports, read at that moment: counts.deletes (chats, routines, apiKeys) and counts.keeps (tasks, comments, memories). A count above 1000 is reported as 1001.
Example
curl -X DELETE https://api.cohort.bot/api/v1/agents/agent_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"choices": {"tasks": "user_def456"}}'Response
{
"agentId": "agent_abc123",
"name": "marcus",
"displayName": "Marcus",
"deleted": { "chats": 3, "routines": 1, "apiKeys": 0 },
"kept": { "tasks": 5, "comments": 12, "memories": 7 },
"departure": { "tasksReassigned": 1, "routinesMoved": 1, "keysRevoked": 1 },
"machineFiles": "scheduled"
}deleted.routines leaves out routines handed to a teammate. departure is null for an agent that was already retired. machineFiles is scheduled (the agent’s own working files are being removed) or no_machine (there were none to remove). Afterwards the agent is not found at any agent route.