Skip to content

Agents

List Agents

List agents in the organization. Requires membership.

Omit limit to get every agent; total is the full count either way.

Every filter and the sort are applied inside the statement, before LIMIT. So the returned page is a genuine page of the filtered, ordered set, and total is the count of that filtered set — not of the org. A caller must not re-filter or re-sort the page it gets back: doing so over one loaded page is what this signature exists to stop.

Parameters

NameInTypeRequiredDescription
deployedquerybooleannotrue returns only agents with an active revision, false only those without one. Omit for both. Mirrors has_active_revision on the row.
execution_modequeryAgentExecutionModenoFilter by execution mode. Omit to get every mode.
limitqueryintegernoMax rows to return (1-100). Omit to return every row.
offsetqueryintegernoRows to skip — pass the previous response’s next_offset.
org_idpathstring (uuid)yes
project_idquerystringnoFilter by project id, or ‘none’ for uncategorized agents.
qquerystringnoCase-insensitive substring match over agent name, slug and description. Blank or whitespace-only is treated as absent.
sortquery"display_order" | "name" | "created_at" | "last_activity_at"noSort key. display_order (default) is the org’s manual arrangement. last_activity_at is the agent’s most recent chat activity of all time — never-run agents sort last in both directions. Window-scoped rankings (runs / failures / spend over 24h-30d) are not offered here; GET /agents/activity answers those for every agent, unpaginated.
sort_orderquery"asc" | "desc"noSort direction. Omit for the natural direction of the chosen sort: asc for display_order and name, desc for created_at and last_activity_at.
statusqueryAgentStatusnoFilter by lifecycle status. Omit to get both active and archived.

Responses

StatusDescriptionBody
200Successful ResponsePage_AgentResponse_
422Validation ErrorHTTPValidationError

Create Agent

Create a new agent in the organization. Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
allowed_knowledge_basesstring[]no
allowed_toolsstring[]no
always_forward_chat_filesbooleanno
auto_pin_enabledbooleanno
avatar_seedstringno
can_manage_integrationsbooleanno
can_rememberbooleanno
can_request_human_inputbooleanno
descriptionstringno
environment_idstring (uuid)no
execution_modestringno
instructionstringno
modelstringno
model_modestringnoEffort level for an org whose plan selects effort rather than models: ‘trivial’ (Trivial), ‘normal’ (Standard) or ‘high_effort’ (High). The platform decides what each level runs (model + reasoning effort + thinking). No level is plan-gated. Rejected with 422 for an org whose plan has direct model choice, where a level would have no effect — such an org sets model/reasoning_effort instead. Null clears it.
mounted_skillsstring[]no
namestringyes
outcome_schemaobjectno
per_chat_cost_limit_usdnumberno
per_chat_credit_limitnumberno
permissionsobjectno
pinned_toolsstring[]no
reasoning_effortstringno
reply_to_incoming_emailbooleanno
sandbox_enabledbooleanno
statusstringno
system_promptstringno
tagsstring[]no
team_idstring (uuid)no

Responses

StatusDescriptionBody
201Successful ResponseAgentResponse
422Validation ErrorHTTPValidationError

Get Agent

Get agent details. Accepts UUID or slug. Requires membership.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentResponse
422Validation ErrorHTTPValidationError

PATCH /api/orgs/{org_id}/agents/{agent_id}

Section titled “PATCH /api/orgs/{org_id}/agents/{agent_id}”

Update Agent

Update agent settings. Accepts UUID or slug. Instruction edits are routed to the draft revision.

Narrowing allowed_tools also unpins: any pinned_tools entry the new grants no longer admit is dropped, because a pin is scope-unioned into the effective allow-set at run time and would otherwise survive the revocation.

Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
allowed_knowledge_basesstring[]no
allowed_toolsstring[]no
always_forward_chat_filesbooleanno
auto_pin_enabledbooleanno
auto_pinned_toolsstring[]no
avatar_seedstringno
can_manage_integrationsbooleanno
can_rememberbooleanno
can_request_human_inputbooleanno
descriptionstringno
environment_idstring (uuid)no
execution_modestringno
instructionstringno
modelstringno
model_modestringnoEffort level for an org whose plan selects effort rather than models: ‘trivial’ (Trivial), ‘normal’ (Standard) or ‘high_effort’ (High). The platform decides what each level runs (model + reasoning effort + thinking). No level is plan-gated. Rejected with 422 for an org whose plan has direct model choice, where a level would have no effect — such an org sets model/reasoning_effort instead. Null clears it.
mounted_skillsstring[]no
namestringno
outcome_schemaobjectno
owner_user_idstring (uuid)no
per_chat_cost_limit_usdnumberno
per_chat_credit_limitnumberno
permissionsobjectno
pinned_toolsstring[]no
reasoning_effortstringno
reply_to_incoming_emailbooleanno
run_asstringno
sandbox_enabledbooleanno
settingsobjectno
statusstringno
system_promptstringno
tagsstring[]no
team_idstring (uuid)no
toolsobject[]no

Responses

StatusDescriptionBody
200Successful ResponseAgentResponse
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/agents/{agent_id}

Section titled “DELETE /api/orgs/{org_id}/agents/{agent_id}”

Delete Agent

Soft-delete an agent. Accepts UUID or slug. Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/agents/{agent_id}/artifacts

Section titled “GET /api/orgs/{org_id}/agents/{agent_id}/artifacts”

Get Agent Artifacts

Get artifacts produced by an agent.

Accepts UUID or slug. Returns artifacts ordered by created_at desc. Requires membership in the organization.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
limitqueryintegerno
offsetqueryintegerno
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentArtifactListResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/agents/{agent_id}/deploy

Section titled “POST /api/orgs/{org_id}/agents/{agent_id}/deploy”

Deploy Agent

Deploy the draft revision: activate it.

Accepts UUID or slug. Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentResponse
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/agents/{agent_id}/draft

Section titled “DELETE /api/orgs/{org_id}/agents/{agent_id}/draft”

Discard Draft

Discard the draft revision for an agent.

Accepts UUID or slug. Requires ADMIN or OWNER role. Returns 422 if no draft exists.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/agents/{agent_id}/events

Section titled “GET /api/orgs/{org_id}/agents/{agent_id}/events”

Get Agent Events

Get the activity timeline for an agent.

Accepts UUID or slug. Returns events ordered by created_at desc (newest first). Requires membership in the organization.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
limitqueryintegernoMax events to return
offsetqueryintegernoPagination offset
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentEventTimelineResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/agents/{agent_id}/revisions

Section titled “GET /api/orgs/{org_id}/agents/{agent_id}/revisions”

List Revisions

List all revisions for an agent, newest first.

Accepts UUID or slug. Requires membership in the organization.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentRevisionListResponse
422Validation ErrorHTTPValidationError

Get Agents Activity

Current state, sparkline and window totals for every agent in the org.

One entry per agent — including agents that have never run — so a grid can key straight off this without deciding what a missing row meant. The three facts a caller needs to tell “loading” from “never ran” from “quiet lately” are last_activity_at (null = never), ran_in_window, and the totals; see services/agent_activity.py.

Money comes back in one unit, named by spend_unit: a BYO org reads cost_usd, everyone else reads credits.

Deliberately not paginated. It is bounded by the org’s agent count, it backs a page that draws all of them at once, and a paged sparkline would just be N round trips wearing a different hat.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes
windowquerystringnoWindow ending now. One of 24h, 7d, 14d, 30d.

Responses

StatusDescriptionBody
200Successful ResponseAgentsActivityResponse
422Validation ErrorHTTPValidationError

List Deleted Agents

List soft-deleted agents in the organization. Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
limitqueryintegernoMax rows to return (1-100). Omit to return every row.
offsetqueryintegernoRows to skip — pass the previous response’s next_offset.
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponsePage_AgentResponse_
422Validation ErrorHTTPValidationError