Agents
REST endpoints for agents. Bearer-auth required.
GET /api/agents
List agents.
Query parameters
limit(optional): Page size (1–100, default 100).after(optional): Keyset cursor — return the page after this row (next page).before(optional): Keyset cursor — return the page before this row (prev page).ids(optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).filter(optional): Nested filter expression (<Entity>Filter): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.orderBy(optional): Multi-key sort (<Entity>OrderBy[]): array of{ field: direction }applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.workspace_id(optional): Filter to agents in this workspace. When omitted, returns agents across every workspace the caller is a member of (admins see all). System agents are always included.source(optional): Narrow by source.workspace= this workspace's agents plus those visible via installed integrations;system= only global system agents;integration= only agents made visible by installed integrations; omit = union.include_deleted(optional): Soft-deleted agent visibility.false(default) — active rows only.true— active plus soft-deleted.only— soft-deleted only (trash view).name(optional): Case-insensitive substring match on name.system(optional): Shorthand: filter wheresystemequals this value.default_version_id(optional): Shorthand: filter wheredefaultVersionIdequals this value.created_by(optional): Shorthand: filter wherecreatedByequals this value.runtime_user_id(optional): Shorthand: filter whereruntimeUserIdequals this value.retention_tier(optional): Shorthand: filter whereretentionTierequals this value.
Response
JSON
{
"data": [
{
"id": "<...>",
"workspaceId": "<...>",
"name": "<...>",
"description": "<...>",
"system": "<...>",
"defaultVersionId": "<...>",
"createdBy": "<...>",
"runtimeUserId": "<...>",
"deletedAt": "<...>",
"retentionTier": "<...>",
"createdAt": "<...>",
"updatedAt": "<...>"
}
],
"pageInfo": {
"total": "number",
"hasNextPage": "boolean",
"hasPreviousPage": "boolean",
"startCursor": "string",
"endCursor": "string"
}
}POST /api/agents
Create agent
Request body
JSON
{
"workspaceId": "string",
"name": "string",
"description?": "string",
"instructions?": "string",
"models?": ["string"],
"inputSchemaId?": "string",
"outputSchemaId?": "string",
"toolIds?": ["string"]
}Response
JSON
{
"id": "string",
"workspaceId": "string",
"name": "string",
"description": "string",
"system": "boolean",
"defaultVersionId": "string",
"createdBy": "string",
"runtimeUserId": "string",
"deletedAt": "string",
"retentionTier": "short | medium | long | none",
"createdAt": "string",
"updatedAt": "string"
}GET /api/agents/{id}
Get an agent by ID.
Path parameters
id(required): Agent to retrieve.
Response
JSON
{
"id": "string",
"workspaceId": "string",
"name": "string",
"description": "string",
"system": "boolean",
"defaultVersionId": "string",
"createdBy": "string",
"runtimeUserId": "string",
"deletedAt": "string",
"retentionTier": "short | medium | long | none",
"createdAt": "string",
"updatedAt": "string"
}PATCH /api/agents/{id}
Update agent
Path parameters
id(required): The agent's prefixed ID (e.g.agt_...).
Request body
JSON
{
"name?": "string",
"description?": "string",
"runtimeUserId?": "string"
}Response
JSON
{
"id": "string",
"workspaceId": "string",
"name": "string",
"description": "string",
"system": "boolean",
"defaultVersionId": "string",
"createdBy": "string",
"runtimeUserId": "string",
"deletedAt": "string",
"retentionTier": "short | medium | long | none",
"createdAt": "string",
"updatedAt": "string"
}DELETE /api/agents/{id}
Soft-delete an agent.
Path parameters
id(required): Agent to soft-delete.
Response
JSON
{
"success": "boolean"
}PUT /api/agents/{id}/mcp-servers
Sync MCP server assignments
Path parameters
id(required): The agent's prefixed ID (e.g.agt_...).
Request body
JSON
{
"mcpServerIds": ["string"]
}Response
JSON
{
"count": "number"
}DELETE /api/agents/{id}/purge
Permanently delete a soft-deleted agent.
Path parameters
id(required): Soft-deleted agent to permanently delete.
Response
JSON
{
"success": "boolean"
}POST /api/agents/{id}/restore
Restore a soft-deleted agent.
Path parameters
id(required): Soft-deleted agent to restore.
Response
JSON
{
"id": "string",
"workspaceId": "string",
"name": "string",
"description": "string",
"system": "boolean",
"defaultVersionId": "string",
"createdBy": "string",
"runtimeUserId": "string",
"deletedAt": "string",
"retentionTier": "short | medium | long | none",
"createdAt": "string",
"updatedAt": "string"
}PUT /api/agents/{id}/skills
Sync skill assignments
Path parameters
id(required): The agent's prefixed ID (e.g.agt_...).
Request body
JSON
{
"skillIds": ["string"]
}Response
JSON
{
"count": "number"
}PUT /api/agents/{id}/tools
Sync tool assignments
Path parameters
id(required): The agent's prefixed ID (e.g.agt_...).
Request body
JSON
{
"toolIds": ["string"]
}Response
JSON
{
"count": "number"
}