Skip to content

Agents

All paths below are relative to the base URL https://api.agentdepot.org — for example GET https://api.agentdepot.org/api/orgs/{org_id}/agents. Authenticate with an Authorization: Bearer <token> header. See the REST API reference for details.

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.

The agent’s v1 revision starts as an undeployed draft (has_undeployed_draft: true in the response) — it cannot run a chat until deployed via POST /agents/{id}/deploy. Until then the returned agent fields mirror the v1 draft, so the detail page shows the values just submitted.

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
decision_log_enabledbooleanno
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), ‘high_effort’ (High) or ‘x_high’ (X-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
tagsstring[]no
team_idstring (uuid)no
vision_modelstringnoOptional override for the model this agent uses to describe images and scanned pages it opens with read_file (the platform’s “Image and PDF reading” feature model). Null (the default) defers to this org’s own override of that feature, if it has set one, then to the platform’s. Allowed values are the same models this agent could set as model — governed by the same platform/org allowlist chain — narrowed to those whose catalog row supports vision; a model that cannot read images is rejected with 422. Null clears it.

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.

Every behaviour field — instruction, model, reasoning_effort, model_mode, vision_model, allowed_tools, allowed_knowledge_bases, mounted_skills, pinned_tools, outcome_schema, and the capability flags — is routed to the agent’s draft revision (forked from the active one if it has none) and does not take effect until deployed. Pass deploy: true to deploy it in this same request, or call POST /agents/{id}/deploy afterwards; a 409 means the draft would be identical to what is already active. Every other field (name, description, status, execution_mode, team, budgets, tags, …) applies immediately either way.

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
decision_log_enabledbooleanno
deploybooleanno
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), ‘high_effort’ (High) or ‘x_high’ (X-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
tagsstring[]no
team_idstring (uuid)no
toolsobject[]no
vision_modelstringnoOptional override for the model this agent uses to describe images and scanned pages it opens with read_file (the platform’s “Image and PDF reading” feature model). Null (the default) defers to this org’s own override of that feature, if it has set one, then to the platform’s. Allowed values are the same models this agent could set as model — governed by the same platform/org allowlist chain — narrowed to those whose catalog row supports vision; a model that cannot read images is rejected with 422. Null clears it.

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: seal it, make it active, and mirror its full behavioural config (instruction, model, tools, skills, outcome schema, capability flags — everything PATCH can route to a draft) onto the agent’s live-reading columns.

Accepts UUID or slug. Requires ADMIN or OWNER role. 409 if the draft is identical to the revision already active — sealing it would mint a version nothing distinguishes.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAgentResponse
422Validation ErrorHTTPValidationError

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

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

Create Draft

Start (or reset) the draft from a chosen revision’s full config.

The rollback recipe: the UI’s “Restore as draft” only copies instruction text; this copies the entire behavioural config — model, effort, mode, tools, knowledge bases, mounted skills, pins, outcome schema, every capability flag — from from_version (or, if omitted, from the currently active revision) onto the draft. Follow with POST /agents/{id}/deploy to make it live.

If the agent has no draft, one is created (forking a new version). If it already has a draft, it is overwritten in place (same id/version) — unless it carries unsaved changes of its own, in which case this is refused with a 409 naming how many fields would be discarded; pass replace: true to overwrite anyway. 404 if from_version does not name a live revision on this agent (or, when omitted, if the agent has never been deployed).

Legal while an experiment is running — drafts are always fine to create; only deploying one is refused during a rollout.

Accepts UUID or slug. Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
agent_idpathstringyes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
from_versionintegerno
replacebooleanno

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