API Reference

Public endpoints generated from the reviewed external OpenAPI spec. Use this page for human scanning, and use openapi.json for SDKs, tools, and automation.

65 paths89 operations30 channel eventsOpenAPI 3.0.0external scope

Base URL

https://developers.archastro.ai

Authentication

Use the auth scheme declared on each endpoint.

Channels

Realtime channels use bearer auth.

/api/v1/activity_feed

Activity Feed

1 operations
GET/api/v1/activity_feed

List activity feed entries

Returns a cursor-paginated list of activity feed entries visible to the authenticated user. Entries are ordered from newest to oldest by default. Use `before_cursor` to page backward and `after_cursor` to page forward. Results are scoped to the caller's app. All filter params are optional and can be combined. Passing multiple values in an array filter returns entries matching any of the supplied values (OR semantics). Invalid `kind` or `level` values return a 400 error listing the accepted values rather than being silently ignored.

Bearer tokenPublishable key

Parameters

NameTypeDescription
limitqueryintegerMaximum number of entries to return per page. Defaults to 50; maximum is 100.
kindqueryarray<string>One or more entry kinds to include. Accepted values: routine_run, automation_run, thread_story, agent_quality_verdict, generic. Omit to return all kinds.
levelqueryarray<string>One or more severity levels to include. Accepted values: debug, info, warn, error, audit. Omit to return all levels.
after_cursorquerystringOpaque cursor from a previous response's `after_cursor` field. Returns entries newer than the cursor's position.
before_cursorquerystringOpaque cursor from a previous response's `before_cursor` field. Returns entries older than the cursor's position.
agentqueryarray<string>Restrict results to entries associated with these agent IDs (`agt_...`). Accepts multiple values.
orgqueryarray<string>Restrict results to entries associated with these organization IDs (`org_...`). Accepts multiple values.
teamqueryarray<string>Restrict results to entries associated with these team IDs (`tem_...`). Accepts multiple values.
threadqueryarray<string>Restrict results to entries associated with these thread IDs (`thr_...`). Accepts multiple values.
correlation_idquerystringRestrict results to entries that share this correlation group identifier. Useful for tracing a chain of related events.

Responses

  • 200Successful response
  • 400Invalid cursor
  • 401Unauthorized
  • 403App-scoped token required. Use a token scoped to the target app.

/api/v1/agents

Agents

24 operations
GET/api/v1/agents

List agents

Returns a paginated list of agents visible to the authenticated caller. Results are ordered by creation time descending. Use `search` to filter by name, org, team, or owner fields. Use `user` or `org_id` to scope the list to a specific owner. Use `template_config` to find agents whose last applied template matches a given config ID. Pagination is page-based: pass `page` and `page_size` to navigate through large result sets. When called under a developer app scope, only agents belonging to that app are returned.

Bearer tokenPublishable key

Parameters

NameTypeDescription
template_configquerystringConfig ID (`cfg_...`) or `lookup_key` of an AgentTemplate. Returns only agents whose last applied template matches.
searchquerystringFree-text search string matched against the agent name, org, team, and owner fields.
page_sizequeryintegerNumber of agents to return per page. Defaults to `25`.
org_idquerystringOrganization ID (`org_...`) to filter by. Returns only agents owned by this org.
pagequeryintegerPage number to retrieve, 1-indexed. Defaults to `1`.
userquerystringUser ID (`usr_...`) to filter by. Returns only agents owned by this user.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
POST/api/v1/agents

Create an agent

Creates a new agent. Supports two mutually exclusive provisioning modes. **Template mode** — pass `template` with the ID or `lookup_key` of an existing AgentTemplate config. The agent's tools, routines, skills, and installations are provisioned from that template's `config_ref` entries. **Bundle mode** — pass `template_bundle` with a self-contained install payload (AgentTemplate body plus every skill, script, and config it references). The entire bundle commits in a single transaction; any failure rolls back the whole install and the response includes `installed_configs[]` — one entry per persisted config. Pass exactly one of `template` or `template_bundle`. If neither is supplied, `name` is required and a blank agent is created. Requires authentication; when called under a developer app scope (`/developer/apps/:app/...`), the caller must hold the app scope for the target app.

Bearer tokenPublishable key

Request body

NameTypeDescription
aclobjectAccess control list controlling which users, teams, or orgs can read or manage this agent.
emailstringEmail address assigned to the agent. Used as the agent's contact identity.
identitystringSystem-prompt identity string describing who the agent is. Passed verbatim to the model on each conversation turn.
lookup_keystringStable, unique slug used to look up this agent by name instead of ID. Must be unique within the owning app or org.
metadataobjectArbitrary key-value map stored on the agent. Not interpreted by the platform.
modelstringDefault AI model identifier for this agent, e.g. `claude-sonnet-4-5`. Overridden per-request when the caller specifies a model.
namestringDisplay name for the agent. Required when neither `template` nor `template_bundle` is provided.
orgstringOrganization ID (`org_...`) that should own this agent. Mutually exclusive with `team` and `user`.
originatorstringFree-form label identifying the source or author of the agent, e.g. a user ID, a deploy pipeline, or a slug.
phone_numberstringPhone number assigned to the agent in E.164 format, e.g. `+15550001234`.
profile_pictureobjectProfile picture to attach to the agent. All three subfields are required when this object is present.
teamstringTeam ID (`team_...`) that should own this agent. Mutually exclusive with `org` and `user`.
templatestringID (`cfg_...`) or `lookup_key` of an existing AgentTemplate config to provision from. Mutually exclusive with `template_bundle`.
template_bundleobjectSelf-contained install bundle containing an AgentTemplate plus all referenced skills and configs. The entire bundle is committed atomically. Mutually exclusive with `template`.
userstringUser ID (`usr_...`) that should own this agent. Mutually exclusive with `org` and `team`.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden — app scope required
  • 404Template not found
  • 409Conflict
  • 422Validation failed
GET/api/v1/agents/{agent}

Retrieve an agent

Returns the agent identified by ID or `lookup_key`. The authenticated caller must own the agent or hold sufficient permissions within its owning org or team. When called under a developer app scope, the agent must belong to that app. Use the list endpoint to retrieve many agents at once.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent to retrieve.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
PATCH/api/v1/agents/{agent}

Update an agent

Updates one or more fields on an existing agent. Only the fields you supply are changed; omitted fields retain their current values. To clear the agent's default model, pass `model` as an empty string. The authenticated caller must own the agent or hold write permissions within its owning org or team. When called under a developer app scope, the caller must hold the app scope for the target app.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent to update.

Request body

NameTypeDescription
aclobjectReplacement access control list. Fully replaces the existing ACL.
emailstringNew email address for the agent.
identitystringReplacement identity system-prompt string describing who the agent is.
lookup_keystringNew `lookup_key` slug. Must be unique within the owning app or org.
metadataobjectReplacement key-value metadata map. The entire map is replaced, not merged.
modelstringNew default AI model identifier, e.g. `claude-sonnet-4-5`. Pass an empty string to clear the agent's default model.
namestringNew display name for the agent.
orgstringOrganization ID (`org_...`) to transfer ownership to.
originatorstringReplacement originator label identifying the source or author of the agent.
phone_numberstringNew phone number for the agent in E.164 format, e.g. `+15550001234`.
profile_pictureobjectReplacement profile picture. All three subfields are required when this object is present.
teamstringTeam ID (`team_...`) to transfer ownership to.
userstringUser ID (`usr_...`) to transfer ownership to.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
  • 422Validation failed
DELETE/api/v1/agents/{agent}

Delete an agent

Permanently deletes an agent and all of its associated resources. This action cannot be undone. The authenticated caller must own the agent or hold sufficient permissions within its owning org or team. When called under a developer app scope, the caller must hold the app scope for the target app.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent to delete.

Responses

  • 204No content
  • 401Unauthorized
  • 403App-scoped token required. Use a token scoped to the target app.; Permission denied. The connected account may not have the required permissions. Try reconnecting your account.
  • 404Agent not found
GET/api/v1/agents/{agent}/agent_computers

List computers

Returns all computers belonging to the authenticated app, ordered by creation time descending. Pass `agent` to scope the results to a single agent's computers. When `agent` is omitted, computers for all agents in the app are returned. Requires an app-scoped API key. If the specified agent does not exist or does not belong to the app, the endpoint returns 404.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`). When provided, only computers belonging to this agent are returned.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
POST/api/v1/agents/{agent}/agent_computers

Provision a computer for an agent

Creates and provisions a new computer resource associated with the specified agent. The computer is allocated in the requested region (defaulting to `iad`) and its status transitions from `provisioning` to `running` once it is ready. Requires an app-scoped API key. The agent identified by `agent` must belong to the same app. Supplying a `lookup_key` lets you retrieve this computer later without storing its ID — the key must be unique within the app.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`). The computer is associated with this agent.

Request body

NameTypeDescription
configobjectProvider-specific configuration for the computer. Supported keys vary by region and plan.
lookup_keystringStable, user-defined key for this computer. Must be unique within the app. Use it to look up the computer without storing its ID.
metadataobjectArbitrary key-value metadata to attach to the computer. Not interpreted by the platform; returned as-is on all subsequent reads.
namerequiredstringHuman-readable display name for the computer.
regionstringRegion in which to provision the computer, e.g. `"iad"`. Defaults to `"iad"` when omitted.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
  • 422Validation failed
GET/api/v1/agents/{agent}/agent_env_vars

List an agent's environment variables

Returns all environment variables defined for the specified agent. Variable values are always masked in the response; only the last four characters are visible. To inspect a specific variable, use the retrieve endpoint. The authenticated user must have access to the agent's parent app. Pass the app scope via the `app` parameter when calling with an API key that is scoped to a specific app. Results are returned in an unordered flat list.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`). Returns environment variables belonging to this agent.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403App-scoped token required. Use a token scoped to the target app.; Forbidden
  • 404Agent not found
POST/api/v1/agents/{agent}/agent_env_vars

Create an agent environment variable

Creates a new environment variable for the specified agent. The variable is stored securely and the plaintext `value` is never returned after creation; subsequent reads return a masked representation showing only the last four characters. The authenticated user must have access to the agent's parent app. Pass the app scope via the `app` parameter when calling with an API key that is scoped to a specific app. Each `key` must be unique within the agent; attempting to create a duplicate key returns a validation error.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`). The agent must belong to an app the caller can access.

Request body

NameTypeDescription
descriptionstringOptional human-readable note describing what the variable is used for.
keyrequiredstringEnvironment variable name, e.g. `WEBHOOK_SECRET`. Must be unique within the agent.
valuerequiredstringPlaintext secret value to store. The value is encrypted at rest and never returned in full.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403App-scoped token required. Use a token scoped to the target app.; Forbidden
  • 404Not found
  • 422Validation failed
GET/api/v1/agents/{agent}/agent_health_actions

List health actions for an agent

Returns all health actions associated with a given agent. Health actions represent required or recommended steps — such as setting environment variables, completing OAuth installations, or running custom verifiers — that an agent needs to reach a healthy state. Results are not paginated; the full list for the agent is returned. Use the `source`, `status`, and `kind` filters to narrow results to the subset your UI or workflow needs. Multiple values for the same filter are treated as OR (e.g. passing two statuses returns actions matching either). The caller must be authenticated and scoped to the app that owns the agent.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`) or lookup key of the agent whose health actions you want to list.
sourcequeryarray<string>Filter results to actions from one or more lifecycle stages. Accepted values: `"setup"` (actions created during agent installation) and `"health"` (ongoing health checks). Omit to return actions from all stages.
statusqueryarray<string>Filter results to actions in one or more statuses. Accepted values: `"pending"`, `"completed"`, `"skipped"`, and `"degraded"`. Omit to return actions in all statuses.
kindqueryarray<string>Filter results to actions of one or more kinds. Accepted values: `"env_var"` (a required secret or config value), `"install"` (an OAuth or integration install step), and `"custom"` (a platform-defined check). Omit to return all kinds.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403App-scoped token required. Use a token scoped to the target app.; Forbidden
  • 404Agent not found
GET/api/v1/agents/{agent}/agent_installations

List installations for an agent

Returns all installations belonging to the specified agent, across all kinds and states. Use this endpoint to inspect which external services and enablement channels an agent is connected to. Results are scoped to the authenticated app and are returned in an unordered array. To list installations across all agents in an app, use the top-level List Installations endpoint instead. The caller must have app scope for the app that owns the agent.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`) whose installations you want to retrieve.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
POST/api/v1/agents/{agent}/agent_installations

Create an installation

Creates a new installation for an agent, connecting it to an external service or enablement channel via the specified `kind`. The installation begins in a pending state unless an integration is supplied at creation time, in which case it is activated immediately. Supply `shared_integration` to bind an existing org- or app-level integration, or supply `integration` to create a new integration inline and activate the installation in a single request. Supplying both fields returns 422. Use `lookup_key` to assign a stable identifier you can reference later in knowledge search `source_refs`. The key must be unique within the app, org, and sandbox combination. The caller must have app scope for the app that owns the agent.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`) that will own this installation.

Request body

NameTypeDescription
configobjectKind-specific configuration object. Shape varies by `kind`; omit if the kind requires no initial configuration.
integrationobjectInline integration fields to create for `integration/*` kinds. When provided, a new Integration record is created and the installation is activated immediately. Mutually exclusive with `shared_integration`.
kindrequiredstringInstallation kind that determines the external service being connected. Examples: `"enablement/github_app"`, `"enablement/slack_bot"`, `"integration/github"`, `"integration/gmail"`, `"web/site"`. Use the List Kinds endpoint to retrieve all supported values.
lookup_keystringStable identifier you assign to this installation. Propagated to backing context source rows so they can be referenced via knowledge search `source_refs`. Must contain only lowercase letters, numbers, underscores, or hyphens (max 100 characters). Must be unique within the same app, org, and sandbox combination. Omit to skip stable referencing.
shared_integrationstringID of an existing shared org- or app-level integration to bind to this installation. Mutually exclusive with `integration`.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
  • 422Validation failed
GET/api/v1/agents/{agent}/agent_installations/kinds

List available installation kinds

Returns the full catalogue of installation kinds supported by the platform. Use the returned `kind` values when calling the Create Installation endpoint. The list is platform-wide and does not vary by agent. The `agent` parameter is accepted for future per-agent filtering but is currently unused. The caller must have app scope to call this endpoint.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`). Accepted for forward compatibility but currently does not filter the response.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
POST/api/v1/agents/{agent}/agent_routines

Create a routine

Creates a new routine and attaches it to the specified agent. Routines define how an agent responds to events or a cron schedule; the `handler_type` controls which execution model is used. The routine is created in `"draft"` status by default. To start processing events immediately, either pass `status: "active"` or call the activate endpoint after creation. Scheduled routines must run no more frequently than once per hour. Requires app scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`) that this routine will be attached to.

Request body

NameTypeDescription
aclobjectAccess control list governing who can read or manage this routine.
configstringWorkflow config ID (`cfg_...`). Required when `handler_type` is `"workflow_graph"`.
descriptionstringOptional human-readable description of what this routine does.
event_configobjectMapping of event types to trigger configuration. Each key is an event type string; each value is an object with a `"filters"` map and an optional `"dedupe_key_path"` (a JSON path used to deduplicate events, e.g. `"$.thread.id"`).
event_typestringEvent type that triggers this routine. Deprecated — use `event_config` instead.
handler_typerequiredstringExecution model for this routine. One of `"workflow_graph"`, `"script"`, `"preset"`, or `"chain"`.
lookup_keystringStable, unique key you assign to this routine for deterministic lookup. Must be unique within the app.
metadataobjectArbitrary key-value metadata you can attach to the routine. Not interpreted by the platform.
namerequiredstringHuman-readable display name for the routine.
preset_configobjectConfiguration passed to the preset at runtime. Used when `handler_type` is `"preset"`.
preset_namestringName of the registered preset to use. Required when `handler_type` is `"preset"`.
schedulestringCron expression for time-triggered routines (e.g. `"0 9 * * 1"`). Must not be more frequent than once per hour.
scriptstringInline script source. Required when `handler_type` is `"script"`.
statusstringInitial lifecycle status. One of `"draft"` or `"active"`. Defaults to `"draft"`.
stepsarray<object>Ordered list of steps for a chain handler. Required when `handler_type` is `"chain"`; must be omitted or empty otherwise. Each step must have exactly one handler body field (`preset_name`, `script`, or `config`) matching that step's `handler_type`.
trigger_contextstringContext in which the routine is triggered. One of `"chat_session"` or `"event"`. Defaults to `"event"`.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
  • 422Validation failed
GET/api/v1/agents/{agent}/agent_tools

List agent tools

Returns all tools for the authenticated app, optionally filtered by agent or tool kind. Both explicitly created tools and tools derived from connected integrations (installation-sourced tools) are included in the response. Installation-sourced tools appear with `source: "installation"` and `status: "active"`. They are synthesized at request time from connected integrations and do not have a persistent tool ID of the `atl_...` form; their `id` is a composite of the installation ID and server tool type. Use the `agent` filter to retrieve tools for a specific agent. Supplying an `agent` ID that does not belong to the authenticated app returns 404. Requires app scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
kindquerystringFilter by tool kind. One of `"builtin"` or `"custom"`. Omit to return tools of all kinds.
agentpathrequiredstringFilter results to tools belonging to this agent (`agt_...`). Omit to return tools across all agents in the app.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
POST/api/v1/agents/{agent}/agent_tools

Create an agent tool

Creates a new tool and attaches it to the specified agent. Tools can be either `"builtin"` (a platform-provided capability identified by `builtin_tool_key`) or `"custom"` (a caller-defined tool with its own name, description, parameter schema, and handler). New tools are created in `"draft"` status by default unless `status: "active"` is explicitly supplied. Draft tools are not exposed to the LLM during agent runs; call the activate endpoint to promote them. For built-in tools that support multiple instances per agent (those whose catalog entry has a `multi_instance_mode`), supply `name_prefix` to namespace the LLM-facing tool names. Requires app scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`) to attach the tool to.

Request body

NameTypeDescription
asyncbooleanWhen `true`, the tool executes asynchronously and the agent does not block waiting for a result. Applies to `"custom"` tools.
builtin_tool_configobjectConfiguration object for the built-in tool. Shape is defined by the catalog entry's `config_schema` for the chosen `builtin_tool_key`. Applies only to `"builtin"` tools.
builtin_tool_keystringKey identifying the built-in tool type to add (e.g. `"knowledge_search"`). Required when `kind` is `"builtin"`. Must match a key in the tool catalog.
configstringConfig ID (`cfg_...`) referencing the script or workflow graph that implements the tool handler. Applies to `"custom"` tools.
descriptionstringHuman-readable description of what the tool does. Shown to the LLM as context. Applies primarily to `"custom"` tools.
handler_typestringExecution handler for the tool. One of `"script"` or `"workflow_graph"`. Applies to `"custom"` tools.
kindrequiredstringTool kind. One of `"builtin"` or `"custom"`.
lookup_keystringOptional stable identifier you can use to look up this tool without its ID. Must be unique within the app. Useful for idempotent provisioning.
metadataobjectArbitrary key-value metadata to attach to the tool. Not interpreted by the platform.
namestringDisplay name for the tool. Required when `kind` is `"custom"`.
name_prefixstringPer-instance namespace for built-in tools that support multiple instances per agent. Stamped onto LLM-facing tool names (e.g. `"org"` produces `"org_knowledge_search"`). Must match `^[a-z][a-z0-9_]*$` and be at most 24 characters. Required for `"namespaced"` multi-instance tools; omit for single-instance tools.
parametersobjectJSON Schema object describing the tool's input parameters. Used by the LLM to construct valid tool calls. Applies to `"custom"` tools.
statusstringInitial status of the tool. One of `"draft"` or `"active"`. Defaults to `"draft"` when omitted.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
  • 422Validation failed
GET/api/v1/agents/{agent}/agent_working_memory

List working memory entries for an agent

Returns a paginated list of working memory entries belonging to the specified agent. Entries are key-value pairs the agent stores for context between interactions. Results are ordered by creation time descending (newest first) and can be filtered with a substring search against the key name. Requires an app-scoped API key. The authenticated caller must have access to the app the agent belongs to. Returns 403 if the key is not app-scoped, and 404 if the agent does not exist within the accessible scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`) whose working memory entries to retrieve.
page_sizequeryintegerNumber of entries to return per page. Defaults to 25.
pagequeryintegerPage number to retrieve, starting at 1. Defaults to 1.
searchquerystringSubstring filter applied to entry keys (case-insensitive). Omit to return all keys.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
GET/api/v1/agents/{agent}/export

Export an agent as an AgentTemplate

Reconstructs an AgentTemplate config from a deployed agent and all of its sub-resources (tools, routines, skills, installations). Returns the template definition together with every dependent config file (scripts, workflows, skills, schemas) and their raw content, producing a fully self-contained export bundle. Use this endpoint to snapshot an agent's current configuration for backup, migration, or to seed a new Solution template. Pass `remove_identity: true` to strip instance-specific fields (email, phone number) before export. The authenticated caller must own the agent or hold sufficient permissions within its owning org or team. When called under a developer app scope, the caller must hold the app scope for the target app.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent to export.
remove_identityquerybooleanWhen `true`, strips instance-unique identity fields (`email`, `phone_number`) from the exported template so it can be reused as a generic blueprint.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
GET/api/v1/agents/{agent}/health

Retrieve an agent's health profile

Returns an aggregate health profile for the specified agent, including an overall status, a numeric health score, recent activity metrics, and a list of recommended remediation actions. The health check is computed on demand at request time. The `checked_at` timestamp in the response reflects when the evaluation ran. Use this endpoint to surface diagnostics about tool availability, model configuration, and runtime activity in dashboards or monitoring workflows. The authenticated caller must own the agent or hold sufficient permissions within its owning org or team. When called under a developer app scope, the caller must hold the app scope for the target app.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent to evaluate.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
GET/api/v1/agents/{agent}/schedules

List schedules for an agent

Returns all schedules belonging to the specified agent in any status. Use the `status` parameter to narrow results to a single lifecycle state. Requires an app-scoped API key. The agent must belong to the app identified by the key.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agi_...`). The agent whose schedules you want to retrieve.
statusquerystringFilter results by schedule status. One of `"active"`, `"paused"`, `"completed"`, `"cancelled"`, or `"expired"`. Omit to return schedules in all statuses.

Responses

  • 200Successful response
  • 400Invalid status value
  • 401Unauthorized
  • 403Forbidden - app scope required
GET/api/v1/agents/{agent}/schedules/{schedule}

Retrieve a schedule

Returns a single schedule belonging to the specified agent. Use this endpoint to fetch the current state, next run time, and configuration of an individual schedule. Requires an app-scoped API key. Both the agent and the schedule must belong to the app identified by the key. Returns 404 if the schedule does not exist or belongs to a different agent.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agi_...`). The agent that owns the schedule.
schedulepathrequiredstringSchedule ID (`asc_...`). The schedule to retrieve.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Schedule not found
POST/api/v1/agents/{agent}/search

Search an agent's knowledge base

Performs a semantic search over an agent's knowledge base and returns a ranked, `kind`-discriminated list of matching items. Two item kinds may appear in `data`: - `"chunk"` — chunk-level results from the agent's context store. Present for all agents. - `"document"` — document-level results. Present only when the agent has an active `archastro/knowledge` installation. Results from both kinds are scored with Reciprocal Rank Fusion (RRF), normalized to be comparable across kinds, then merged into a single ranked list. On a relevance tie, chunks appear before documents. The total number of results is capped at `max_results` across both kinds. Use `mode` to choose the retrieval strategy: `"hybrid"` (default) combines vector and full-text search; `"vector"` and `"fulltext"` select each strategy independently.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent whose knowledge base to search.

Request body

NameTypeDescription
max_resultsintegerMaximum total results to return across all kinds. Chunks and documents are ranked together and the list is capped at this value. Defaults to `20`; maximum is `100`.
modestringRetrieval strategy. One of `"hybrid"` (default), `"vector"`, or `"fulltext"`.
queryrequiredstringNatural-language search query used to retrieve relevant knowledge items.
recency_daysintegerWhen set, restricts results to items indexed within the last N days.
source_typesarray<string>Array of source-type slugs used to filter chunk results, e.g. `["web", "file"]`. Omit to include all source types.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Agent not found
  • 422Invalid parameters
POST/api/v1/agents/{agent}/threads

Create a thread for an agent

Creates a new thread owned by the specified agent. The thread is scoped to the agent's identity and is immediately available for messaging. The authenticated caller must have access to the agent's parent app. If your API key is scoped to a specific app, pass that app's ID via the `app` parameter. Attempting to create a thread for an agent you cannot access returns 404. By default the platform may send an automatic welcome message into the new thread. Pass `skip_welcome_message: true` to suppress this behavior.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringAgent ID (`agt_...`). The thread will be owned by this agent.

Request body

NameTypeDescription
skip_welcome_messagebooleanWhen `true`, suppresses the automatic welcome message that the platform sends when a new thread is created. Defaults to `false`.
threadrequiredobjectAttributes for the new thread.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Agent not found
  • 422Validation failed
POST/api/v1/agents/{agent}/upgrade

Upgrade an agent from an AgentTemplate

Upgrades an existing agent by reconciling it against an AgentTemplate from a Solution. Supports two modes: - `"reapply"` (default) — re-applies the agent's currently tracked template, picking up any changes the template author has made since the last apply. - `"replace"` — moves the agent to a different template. `template` is required in this mode. Set `dry_run: true` to compute and return the full upgrade diff (adds, updates, removes, noops) without writing any changes. The response includes a `review_fingerprint` you can pass back via `expected_review_fingerprint` on the live apply to guard against the diff changing between review and execution. Safe overrides (`name`, `email`, `phone_number`, `metadata`, `identity`, `originator`, `model`) let you pin instance-specific values that should not be overwritten by the template during the upgrade. The authenticated caller must own the agent or hold write permissions within its owning org or team. When called under a developer app scope, the caller must hold the app scope for the target app.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentpathrequiredstringID (`agi_...`) or `lookup_key` of the agent to upgrade.

Request body

NameTypeDescription
dry_runbooleanWhen `true`, computes and returns the full upgrade diff without persisting any changes. Use with `expected_review_fingerprint` to guard the live apply.
emailstringInstance-specific email address override. Pins this value so the template upgrade does not overwrite it.
expected_review_fingerprintstringStale-review guard. Pass the `review_fingerprint` returned by a prior `dry_run` response to ensure the diff has not changed between review and live apply. Returns an error if the fingerprint no longer matches.
identitystringInstance-specific identity system-prompt override. Pins this value so the template upgrade does not overwrite it.
metadataobjectInstance-specific metadata override. Pins this value so the template upgrade does not overwrite it.
modestringUpgrade mode. `"reapply"` (default) refreshes the agent's tracked template; `"replace"` moves the agent to a different template (requires `template`).
modelstringInstance-specific default model override. Pins this value so the template upgrade does not overwrite it. Pass an empty string to clear the model.
namestringInstance-specific name override. Pins this value so the template upgrade does not overwrite it.
originatorstringInstance-specific originator label override. Pins this value so the template upgrade does not overwrite it.
phone_numberstringInstance-specific phone number override in E.164 format. Pins this value so the template upgrade does not overwrite it.
templatestringID (`cfg_...`) or `lookup_key` of the target AgentTemplate config. Optional in `"reapply"` mode; required in `"replace"` mode.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 403App-scoped token required. Use a token scoped to the target app.; Forbidden
  • 404Agent not found; Template not found
  • 409Agent template changed since review; prepare the diff again.
  • 422Agent has no tracked template; Template has no parent Solution; Config is not an agent template; Validation failed

/api/v1/auth

Authentication

9 operations
GET/api/v1/auth/allowed_auth_methods

List supported auth methods

Returns the complete catalogue of authentication methods the platform supports, including each method's stable slug, user-facing name, and description. Use this endpoint to render method labels in sign-in UIs or org settings screens without hardcoding copy or maintaining your own enum list. Results reflect the platform's source-of-truth catalogue and are consistent across all orgs. This endpoint requires only a publishable key and is accessible without an active user session, making it suitable for pre-authentication flows such as login page rendering or onboarding configuration.

Publishable key

Responses

  • 200Successful response
POST/api/v1/auth/login

Authenticate with email and password

Authenticates a user with an email address and password and returns a short-lived access token, a refresh token, and the authenticated user object. Use the refresh token with the `/auth/refresh` endpoint to obtain new access tokens without re-authenticating. Password login must be enabled for the app; apps that have disabled password authentication return HTTP 403. Requests are rate-limited per IP (10 per minute) and per email-IP pair (5 per minute) — exceeding either limit returns HTTP 429.

Publishable key

Request body

NameTypeDescription
emailrequiredstringEmail address of the user to authenticate.
passwordrequiredstringPassword for the account associated with the given email.

Responses

  • 200Successful response
  • 401Invalid credentials
  • 403Password login is not enabled for this organization
  • 429Rate limited
POST/api/v1/auth/login/link

Request a magic link for login

Sends a magic link to the given email address so an existing user can sign in without a password. The user clicks the link in their email and is redirected to `redirect_uri` with a token; pass that token to `/auth/verify_link` to obtain session tokens. If no account exists for the email, the endpoint still returns success to prevent email enumeration — no link is sent in that case. Both `email` and `redirect_uri` are required. Requests are rate-limited per IP (10 per minute) and per email-IP pair (3 per minute) — exceeding either limit returns HTTP 429. Returns HTTP 204 on success.

Publishable key

Request body

NameTypeDescription
emailstringEmail address of the account to send the magic link to.
redirect_uristringURL the user is redirected to after clicking the magic link. The token is appended as a query parameter.

Responses

  • 204No content
  • 400Missing email or redirect_uri
  • 429Rate limited
POST/api/v1/auth/refresh

Refresh an access token

Exchanges a valid refresh token for a new access token and a new refresh token, rotating the refresh token on every call. The response also includes the updated user object. Store the new refresh token and discard the old one. Refresh tokens are single-use — submitting an already-consumed token returns HTTP 401. Rate limiting is applied per (user, IP) pair when the token can be verified, and falls back to IP-only when it cannot. The limit is 30 exchanges per minute per bucket; exceeding it returns HTTP 429.

Publishable key

Request body

NameTypeDescription
refresh_tokenrequiredstringRefresh token previously issued by a login, registration, or token-refresh response.

Responses

  • 200Successful response
  • 401Invalid or expired refresh token
  • 429Rate limited
POST/api/v1/auth/register

Register a new user with email and password

Creates a new user account and returns an access token, refresh token, and the new user object. Two registration paths are supported: - **Team registration**: supply `team_invite` with a valid team invite ID. The new user is added to that team immediately upon registration. Returns HTTP 404 if the invite is not found. - **Standard registration**: supply `password`. An `invite_code` may optionally be included for invite-gated apps; an invalid code returns HTTP 404. Exactly one of `team_invite` or `password` must be provided; omitting both returns HTTP 400. Password registration must be enabled for the app; disabled apps return HTTP 403. The response status is HTTP 201 on success.

Publishable key

Request body

NameTypeDescription
aliasstringDisplay alias (handle) for the new account.
emailrequiredstringEmail address for the new account.
full_namestringFull name for the new account.
invite_codestringInvite code for invite-gated registration. Applied only in the standard registration path.
passwordstringPassword for the new account. Required for standard (non-team-invite) registration.
team_invitestringTeam invite ID. When provided, the user is added to the team on registration.
timezonestringIANA timezone name for the new account, e.g. `"America/New_York"`.

Responses

  • 200Successful response
  • 400Missing required parameters
  • 403Password registration is not enabled for this organization
  • 404Team invite not found
  • 422Validation failed
POST/api/v1/auth/register/link

Request a magic link for registration

Starts a passwordless registration flow by sending a verification link to the given email address. The recipient clicks the link and is redirected to `redirect_uri` with a token; pass that token to `/auth/verify_link` to complete registration and obtain session tokens. Profile fields (`full_name`, `alias`, `timezone`) are captured now and applied when the link is verified. Requests are rate-limited per IP (10 per minute) and per email-IP pair (3 per minute) — exceeding either limit returns HTTP 429. Returns HTTP 204 on success.

Publishable key

Request body

NameTypeDescription
aliasstringDisplay alias (handle) for the new account.
emailstringEmail address to send the registration magic link to.
full_namestringFull name for the new account.
redirect_uristringURL the user is redirected to after clicking the registration link. The token is appended as a query parameter.
timezonestringIANA timezone name for the new account, e.g. `"America/New_York"`.

Responses

  • 204No content
  • 400Missing email
  • 422Validation failed
  • 429Rate limited
POST/api/v1/auth/request/link

Request a magic link for login or registration

Sends a passwordless magic link to the given email address. If an account with that email already exists, a login link is sent. If no account exists, a registration link is sent and the recipient completes sign-up by clicking through. This unified endpoint lets you implement a single email-entry UI that handles both cases transparently. The `redirect_uri` is validated against the app's registered hosts; an unregistered URI returns HTTP 400. Both `email` and `redirect_uri` are required. Requests are rate-limited per IP (10 per minute) and per email-IP pair (3 per minute). Returns HTTP 204 on success — no body.

Publishable key

Request body

NameTypeDescription
emailstringEmail address to send the magic link to.
redirect_uristringURL the user is redirected to after clicking the magic link. Must be registered with the app.

Responses

  • 204No content
  • 400Missing email or redirect_uri
  • 422Validation failed
  • 429Rate limited
POST/api/v1/auth/token

Exchange a one-time login token for session tokens

Consumes a single-use login token delivered via email and returns an access token, refresh token, and the authenticated user object. One-time tokens are issued by the passwordless login flow and expire after a short window; submitting an expired or already-used token returns HTTP 401. If `timezone` is provided and the user's current timezone is still the default (`"America/Los_Angeles"`), the account timezone is updated in the same request. Requests are rate-limited to 10 per IP per minute; exceeding this returns HTTP 429.

Publishable key

Request body

NameTypeDescription
timezonestringIANA timezone name to apply to the account if the account timezone is still the default, e.g. `"Europe/London"`. Omit to leave the timezone unchanged.
tokenrequiredstringSingle-use login token extracted from the magic link or email code flow.

Responses

  • 200Successful response
  • 400Missing token
  • 401Invalid or expired token
  • 429Rate limited
  • 500Token exchange failed
POST/api/v1/auth/verify/link

Verify a magic link token

Consumes a single-use token from a magic link URL and returns an access token, refresh token, and the authenticated user object. This endpoint completes both the login flow (initiated by `/auth/request_login_link`) and the registration flow (initiated by `/auth/request_register_link` or `/auth/request_link`). Extract the token from the `token` query parameter of the magic link redirect URI and POST it here. Expired or already-used tokens return HTTP 401. If the app has disabled passwordless authentication the request returns HTTP 403. Rate-limited to 10 requests per IP per minute — exceeding this returns HTTP 429.

Publishable key

Request body

NameTypeDescription
tokenstringSingle-use magic link token extracted from the redirect URI query parameter.

Responses

  • 200Successful response
  • 400Missing token
  • 401Invalid or expired token
  • 403Passwordless login is not enabled for this organization
  • 429Rate limited

/api/v1/files

Files

2 operations
POST/api/v1/files

Upload a file

Creates a new file from base64-encoded content and returns the resulting file object, including a signed download URL. Use this endpoint to store images, documents, or other binary assets that can then be referenced by agents, teams, or users. App scope is derived from the authenticated viewer's bearer token or publishable key. You may optionally associate the file with an organization, team, user, or agent by passing the corresponding ID. If no owner is specified and the viewer is a user, the file is automatically attributed to that user. Returns `422` when the `data` field is not valid base64 or the changeset is invalid. Returns `403` when the request lacks the required app scope.

Bearer tokenPublishable key

Request body

NameTypeDescription
agentstringAgent ID (`agi_...`) to associate with this file. When provided, the file's organization is derived from the agent.
content_typerequiredstringMIME type of the file, e.g. `"image/png"` or `"application/pdf"`.
datarequiredstringBase64-encoded binary content of the file to upload.
filenamerequiredstringOriginal filename including extension, e.g. `"avatar.png"`.
orgstringOrganization ID (`org_...`) to associate with this file. Optional; defaults to the viewer's organization when omitted.
teamstringTeam ID (`tem_...`) that owns this file. Takes precedence over `user` when both are provided.
userstringUser ID (`usr_...`) that owns this file. Defaults to the authenticated user when neither `user` nor `team` is specified.

Responses

  • 201Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 422Validation failed or invalid base64
GET/api/v1/files/{file}/avatar

Fetch an agent avatar image

Returns the raw image bytes for an agent's profile picture identified by `file`. This endpoint is designed for integration partners (such as Slack) that fetch avatar URLs via plain GET requests without bearer token support. Authorization is performed via a short, stable capability `token` rather than an HTTP header. The `token` is an HMAC-based capability tied to the file ID. It does not expire, but it is invalidated when the agent's profile picture is replaced or the agent is deleted — shared caches may continue serving the old image until the `Cache-Control` max-age of one hour elapses. The endpoint never redirects to a signed storage URL; bytes are served inline so behavior is consistent across storage backends. All failure modes — invalid file ID, invalid token, file not currently referenced as an agent avatar — return a uniform `404` to avoid acting as an existence oracle.

No auth declared

Parameters

NameTypeDescription
filepathrequiredstringFile ID of the agent's profile picture (`fil_...`). Must be currently set as an agent's profile picture within the same app.
tokenqueryrequiredstringHMAC capability token authorizing access to this specific file. Obtained from the avatar URL minted when the profile picture was set.

Responses

  • 200Raw image bytes of the agent avatar, served with the file's original content type.
  • 404Not found

/oauth

OAuth

5 operations
POST/oauth/device/approve

Approve a device authorization request

Grants the pending device authorization identified by `user_code`, completing the OAuth Device Authorization flow on behalf of the authenticated user. Once approved, the device can exchange the `device_code` for an access token. Requires a valid user session — the request must be authenticated as an end user, not a machine client. The `user_code` must belong to a pending (not expired, not already approved or denied) authorization associated with the calling app. If the requested scopes include a `thread`-scoped permission, you must supply the `thread` parameter; omitting it returns a 400 with `error: "invalid_scope"`.

No auth declared

Request body

NameTypeDescription
threadstringThread ID (`thr_...`) to bind to the authorization. Required when the requested scopes include a thread-scoped permission.
user_coderequiredstringUser-facing verification code shown on the device. Identifies the pending authorization to approve.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
POST/oauth/device/authorize

Initiate a device authorization request

Starts the OAuth 2.0 Device Authorization flow for a device that cannot perform browser-based redirects. Returns a `device_code` (used by the device to poll for a token) and a `user_code` (shown to the user to enter at the `verification_uri`). This endpoint requires a publishable API key; secret keys are rejected with a 403. Third-party OAuth must be enabled on the app; if it is not, the response returns `error: "third_party_oauth_not_enabled"` with a 403. The endpoint is rate-limited to 10 requests per IP per minute. Excess requests receive a 429 response. The returned codes expire after `expires_in` seconds; once expired, a new authorization request must be initiated.

No auth declared

Request body

NameTypeDescription
clientrequiredstringOAuth client ID (`cli_...`) identifying the application requesting authorization.
scopestringSpace-separated list of OAuth scopes to request, e.g. `"read write"`. Omit to request only the default scopes configured for the client.

Responses

  • 200Successful response
  • 400Bad request
  • 403Forbidden
  • 429Rate limited
POST/oauth/device/deny

Deny a device authorization request

Rejects the pending device authorization identified by `user_code`, preventing the device from obtaining an access token. Once denied, the device will receive an `access_denied` error on its next token poll. Requires a valid user session. The `user_code` must belong to a pending authorization associated with the calling app. Attempting to deny an already approved, already denied, or expired authorization returns a 400.

No auth declared

Request body

NameTypeDescription
user_coderequiredstringUser-facing verification code shown on the device. Identifies the pending authorization to deny.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
GET/oauth/scopes

List available OAuth scopes

Returns the complete set of OAuth scopes that the platform supports. Use this endpoint to discover which scopes are available before constructing an authorization request or rendering a consent UI. No authentication is required. The response is the same for all callers.

No auth declared

Responses

  • 200Successful response
POST/oauth/token

Exchange a grant for OAuth tokens

Issues an access token and a refresh token in exchange for a valid grant. Three grant types are supported: `"authorization_code"`, `"refresh_token"`, and `"urn:ietf:params:oauth:grant-type:device_code"`. For `"authorization_code"` grants, supply `code`, `client`, `redirect_uri`, and optionally `code_verifier` for PKCE flows. Each authorization code is single-use; consuming it a second time returns `invalid_grant`. For `"refresh_token"` grants, supply `refresh_token`. The endpoint rotates the refresh token on every call and returns a fresh pair of tokens. For device-code grants, supply `device_code` and `client`. Poll this endpoint after receiving `authorization_pending` until the user approves or the code expires. Slow down polling if you receive `slow_down`. This endpoint is rate-limited to 20 requests per IP per 60 seconds. Exceeding the limit returns HTTP 429 with `"error": "too_many_requests"`.

No auth declared

Request body

NameTypeDescription
clientstringOAuth client ID identifying the application requesting tokens. Required for `"authorization_code"` and device-code grants.
codestringSingle-use authorization code issued by the authorization endpoint. Required for `"authorization_code"` grants.
code_verifierstringPKCE code verifier corresponding to the `code_challenge` sent in the authorization request. Required when the authorization code was issued with a code challenge; omit otherwise.
device_codestringDevice code received from the device authorization endpoint. Required for device-code grants.
grant_typerequiredstringThe OAuth 2.0 grant type. One of `"authorization_code"`, `"refresh_token"`, or `"urn:ietf:params:oauth:grant-type:device_code"`.
redirect_uristringRedirect URI that was used in the original authorization request. Must exactly match the URI on record for the client. Required for `"authorization_code"` grants.
refresh_tokenstringRefresh token received from a previous token response. Required for `"refresh_token"` grants. The token is rotated on each successful call.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 429Rate limited

/api/v1/slack_channel_bindings

Slack Channel Bindings

4 operations
GET/api/v1/slack_channel_bindings

List Slack channel bindings

Returns a page of Slack channel bindings visible to the authenticated user. Results can be filtered by integration, team, agent, or organization. Omit all filter params to retrieve every binding the caller can see. Pagination is page-based. Pass `page` and `per_page` to navigate large result sets. `page` must be a positive integer; `per_page` must be between 1 and 100. Invalid values return 400.

Bearer tokenPublishable key

Parameters

NameTypeDescription
per_pagequeryintegerNumber of bindings to return per page. Defaults to 25; maximum is 100.
pagequeryintegerPage number to retrieve, 1-indexed. Defaults to 1. Must be a positive integer.
teamqueryarray<string>Return only bindings bound to one of these team IDs. Omit to return bindings for all teams.
orgqueryarray<string>Return only bindings that belong to one of these organization IDs. Omit to return bindings across all organizations visible to the caller.
agentqueryarray<string>Return only bindings that have at least one of these agent user IDs attached. Omit to return bindings regardless of agent attachment.
integrationqueryarray<string>Return only bindings whose Slack integration matches one of these integration IDs. Omit to return bindings across all integrations.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
POST/api/v1/slack_channel_bindings

Create or update a Slack channel binding

Creates a new binding between a Slack channel and a team, or updates the existing binding if one already exists for the given channel. The caller also supplies a list of agents to attach to the binding and enroll as members of the destination team. The caller must have team-manage rights on the destination team (and on the currently bound team if the channel is being re-pointed). Returns 403 if permission is insufficient. All write steps are idempotent, so retrying after a partial failure is safe. On success the REST endpoint returns 201 Created. The script binding (`slack.channel_bindings.upsert`) returns the full binding object including the attached agents.

Bearer tokenPublishable key

Request body

NameTypeDescription
agent_user_idsrequiredarray<string>List of agent user IDs to attach to the binding and enroll as members of the destination team. Pass an empty array to bind the channel without attaching any agents.
channel_idrequiredstringSlack channel ID to bind (e.g. `C01234ABCDE`). Acts as the natural key of the binding within the workspace.
customer_labelstringHuman-readable label for the customer associated with this channel. Stored in the binding's config. `null` if omitted.
is_ext_shared_cachedbooleanCached value of Slack's `is_ext_shared` flag for the channel. When provided, this value is persisted on the binding to avoid repeated Slack API lookups. `null` if omitted.
slack_team_idrequiredstringSlack workspace team ID that the channel belongs to (e.g. `T01234ABCDE`). Identifies which Slack integration to use.
team_idrequiredstringID of the team to bind the Slack channel to. The caller must have team-manage rights on this team.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden; The Slack integration referenced by this binding is not visible to the caller
  • 404Agent not found; Team not found
  • 422Invalid parameters; Binding org_id does not match the integration's org_id
GET/api/v1/slack_channel_bindings/{channel}

Retrieve a Slack channel binding

Returns the Slack channel binding identified by a Slack channel ID and workspace team ID pair. Use this endpoint to look up the team and agents currently bound to a specific Slack channel. The `channel` path parameter is the Slack channel ID; `slack_team_id` identifies the Slack workspace the channel belongs to, disambiguating channels with the same ID across workspaces. Both parameters are required. Returns 404 if no binding exists for the given pair or the associated Slack integration is not visible to the caller.

Bearer tokenPublishable key

Parameters

NameTypeDescription
channelpathrequiredstringSlack channel ID of the binding to retrieve (e.g. `C01234ABCDE`).
slack_team_idqueryrequiredstringSlack workspace team ID that the channel belongs to (e.g. `T01234ABCDE`). Used together with `channel` to uniquely identify the binding.

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 403The Slack integration referenced by this binding is not visible to the caller
  • 404Slack channel binding not found
  • 422Invalid parameters
DELETE/api/v1/slack_channel_bindings/{channel}

Delete a Slack channel binding

Removes the binding between a Slack channel and its associated team. The channel is identified by its Slack channel ID together with the `slack_team_id` that scopes it to a specific Slack workspace. Removing the binding does not delete the bound team or any conversation threads scoped to it; decommission those resources separately if required. The caller must have team-manage rights on the team the channel is currently bound to. Returning 403 indicates insufficient permission; returning 404 indicates the binding does not exist or is not visible to the caller. The REST endpoint returns 204 No Content on success. The script binding (`slack.channel_bindings.delete`) returns a confirmation object so script callers can verify success without an additional fetch. Both paths are idempotent — retrying after a partial failure is safe.

Bearer tokenPublishable key

Parameters

NameTypeDescription
channelpathrequiredstringSlack channel ID of the binding to delete (e.g. `C01234ABCDE`).

Responses

  • 200Successful response
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden; The Slack integration referenced by this binding is not visible to the caller
  • 404Slack channel binding not found
  • 422Invalid parameters

/api/v1/teams

Teams

20 operations
GET/api/v1/teams

List teams

Returns a paginated list of teams visible to the authenticated user, ordered by creation time descending. Use `membership` to narrow results to teams the caller has joined or teams they are eligible to join based on their ACL visibility. Supports full-text search across team name and description via `search`, and structured metadata filtering via `metadata`. When `app` is present, results are scoped to that app and the caller must hold the corresponding app scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
membershipquerystringFilter teams by membership status. `"joined"` returns only teams the caller is a member of. `"joinable"` returns ACL-visible teams the caller has not yet joined. Omit to return all visible teams.
searchquerystringFull-text search string matched against team name and description.
page_sizequeryintegerNumber of teams to return per page. Defaults to 25.
pagequeryintegerPage number to retrieve, starting at 1. Defaults to 1.
metadataqueryobjectStructured metadata filter expression. Only teams whose metadata satisfies the expression are returned.

Responses

  • 200Successful response
  • 400Bad request - invalid metadata filter
  • 401Unauthorized
  • 403Forbidden - app scope required
POST/api/v1/teams

Create a team

Creates a new team and returns the created team object. The authenticated user becomes the team's owner. When `app` is supplied, the request is scoped to that app and the caller must hold the corresponding app scope. Omit `org` unless you want the team pinned to a specific organization. A default chat thread is provisioned for the team automatically after creation.

Bearer tokenPublishable key

Request body

NameTypeDescription
aclobjectAccess control configuration for the team. Controls who can discover and join the team.
descriptionstringOptional human-readable description of the team's purpose.
metadataobjectArbitrary key-value pairs you can attach to the team for your own use. Values must be strings.
namerequiredstringDisplay name for the team.
orgstringOrganization ID (`org_...`) to associate the team with. Omit to create the team without an org affiliation.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 422Validation failed
GET/api/v1/teams/{team}

Retrieve a team

Returns the full team object for the given `team` ID, including its current member list and all associated threads. The authenticated user must be a member of the team or hold a role that grants visibility (org admin, app scope). When `app` is supplied, the caller must hold the corresponding app scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`) of the team to retrieve.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Team not found
PATCH/api/v1/teams/{team}

Update a team

Updates one or more attributes of the team identified by `team`. Only the fields you provide are changed; omitted fields are left as-is. To replace the team's profile picture, supply the `profile_picture` object with base64-encoded image data. The previous picture is deleted after the new one is successfully uploaded. When `app` is present, the caller must hold the corresponding app scope. The caller must be a team owner or org admin.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`) of the team to update.

Request body

NameTypeDescription
aclobjectNew access control configuration for the team. Replaces the existing ACL.
descriptionstringNew human-readable description of the team's purpose.
metadataobjectArbitrary key-value pairs to set on the team. Replaces the existing metadata map entirely.
namestringNew display name for the team.
profile_pictureobjectNew profile picture for the team. Provide this object to upload and replace the current picture.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Team not found
  • 422Validation failed
DELETE/api/v1/teams/{team}

Delete a team

Permanently deletes the team identified by `team`. This action is irreversible — all team memberships, settings, and associated data are removed. The caller must be the team owner or an org admin. When `app` is present, the caller must also hold the corresponding app scope.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`) of the team to delete.

Responses

  • 204No content
  • 401Unauthorized
  • 403Forbidden - app scope required
  • 404Team not found
GET/api/v1/teams/{team}/artifacts

List a team's artifacts

Returns all artifacts owned by the specified team. Artifacts represent AI-generated or user-uploaded files associated with agent sessions, threads, or sandboxes — such as images, documents, and code outputs. The authenticated user must be a member of the team. Attempting to list artifacts for a team the caller does not have access to returns 404 rather than 403 to avoid leaking team existence. Results are returned in a single page without cursor pagination. Each artifact in the response reflects the state of its current version, including a short-lived signed `file_url` for direct download.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`tea_...`). The authenticated user must be a member of this team.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found
POST/api/v1/teams/{team}/artifacts

Create an artifact

Creates a new artifact and stores its file content. A file payload is required; supply it via the `artifact.file_content` (Base64-encoded), `artifact.file_name`, and `artifact.file_content_type` fields. The artifact is scoped to the owner resolved from the request context — either a team or a user. Optionally associate the artifact with an existing thread or agent by passing `artifact.thread_id` or `artifact.agent_id`. Returns 201 with the created artifact on success.

Bearer tokenPublishable key

Request body

NameTypeDescription
artifactrequiredobjectObject containing the attributes for the new artifact.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
GET/api/v1/teams/{team}/custom_objects

List a team's custom objects

Returns a paginated list of custom objects owned by the specified team, filtered to a single schema type. Results are ordered by creation time descending unless `query` is provided, in which case they are ordered by full-text relevance score descending. Use `limit` and `offset` for page-based pagination. Use `row_key` or `sort_key` to narrow results to objects matching those index values. Full-text search via `query` operates only against the fields configured as `search_fields` on the schema. The authenticated user must be a member of the team with sufficient access. Returns 404 if the team is not found, the caller lacks access, or `type` does not match a registered schema for the team's organization.

Bearer tokenPublishable key

Parameters

NameTypeDescription
row_keyquerystringFilter results to objects whose `row_key` exactly matches this value.
sort_keyquerystringFilter results to objects whose `sort_key` exactly matches this value.
queryquerystringFull-text search string matched against the schema's configured `search_fields`. When provided, results are ordered by relevance score descending instead of creation time descending.
limitqueryintegerMaximum number of objects to return per page.
offsetqueryintegerNumber of objects to skip before returning results. Use with `limit` for page-based pagination.
typequeryrequiredstringSchema type identifier (`lookup_key`) that filters results to objects of this schema.
teampathrequiredstringTeam ID (`team_...`). Scopes results to objects owned by this team.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found or schema type not found
POST/api/v1/teams/{team}/custom_objects

Create a team custom object

Creates a new custom object owned by the specified team. The object is instantiated against the schema identified by `type` (the schema's `lookup_key`). All field values are validated against that schema's field definitions before the object is persisted. The authenticated user must be a member of the team with sufficient access. If the team is not found or the caller lacks access, the endpoint returns 404. If `type` does not match a registered schema for the team's organization, the endpoint also returns 404.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`). The team that will own the created object.

Request body

NameTypeDescription
fieldsrequiredobjectMap of field values to set on the new object. Keys and value types must conform to the schema identified by `type`.
typerequiredstringSchema type identifier (`lookup_key`) that defines the object's fields and validation rules.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found or schema type not found
  • 422Validation error
POST/api/v1/teams/{team}/invite

Create a team invite

Generates a new invite code for the specified team. The authenticated user must be a member of the team with the `owner` or `admin` role. The returned code is a short alphanumeric string that other users can present to join the team. Each call produces a new code; previously issued codes are not invalidated by this request.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`tm_...`) identifying the team for which to generate the invite code.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Team not found
POST/api/v1/teams/{team}/invites

Create a team invite (server-to-server)

Generates a new invite code for the specified team using server-to-server authentication. Unlike the user-facing create endpoint, this variant does not require the caller to be a team member — it is intended for privileged back-end services acting on behalf of your platform. The returned code is a short alphanumeric string that users can present to join the team. Each call produces a new code; previously issued codes are not invalidated by this request.

Secret key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`tm_...`) identifying the team for which to generate the invite code.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found
POST/api/v1/teams/{team}/join

Join a team

Adds a principal to a team that is visible to the authenticated user. By default, the currently authenticated user joins the team. Provide `agent` to add an agent to the team instead — the caller must already be a member of the team to do so. Provide `user` (by ID) or `email` to add another user from your organization — the caller must be a team owner, team admin, or org admin. Only one of `agent`, `user`, or `email` may be supplied per request. If the target principal is already a member of the team, the request succeeds without creating a duplicate membership. Server-to-server callers are not permitted to use this endpoint; use the invite-code endpoint instead.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`) to join.

Request body

NameTypeDescription
agentstringAgent ID (`agent_...`) to add to the team. The caller must already be a member of the team.
emailstringEmail address of a member of the caller's organization to add to the team. Requires team-owner, team-admin, or org-admin role.
userstringUser ID (`user_...`) of a member of the caller's organization to add to the team. Requires team-owner, team-admin, or org-admin role.

Responses

  • 204No content
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
DELETE/api/v1/teams/{team}/leave

Leave a team

Removes a principal from a team. By default, the authenticated user removes themselves from the team. Provide `agent` to remove an agent instead — the caller must be a member of the team to do so. Team owners cannot leave their own team. To transfer ownership first, use the update-membership endpoint, then call this endpoint. For server-to-server requests, `user` is required to identify which user should be removed.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`) to leave.

Responses

  • 204No content
  • 401Unauthorized
  • 403Forbidden
  • 404Not a member of this team
  • 422Failed to leave team
GET/api/v1/teams/{team}/members

List members of a team

Returns all members of the specified team, including both users and agents. Members are returned in a single non-paginated array ordered by join time. Bearer-authenticated users must be a member of the team to retrieve its member list. Developer and server-to-server callers can retrieve members for any team visible to their app scope. When `app` is provided, the request is scoped to that app and requires a valid app-scoped token.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`). The team whose members you want to list.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found
POST/api/v1/teams/{team}/members

Add a member to a team

Adds a user or agent as a member of the specified team and returns the new membership with HTTP 201. Provide exactly one of `user` or `agent` — supplying both or neither returns a 400 error. The caller must have permission to manage the team. When an `app` is provided, the request is scoped to that app and the caller must hold a valid app-scoped token. The default role is `"member"` when `role` is omitted.

Secret key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`). The team to add the member to.

Request body

NameTypeDescription
agentstringAgent ID (`agt_...`) to add as a member. Provide exactly one of `user` or `agent`.
rolestringRole to assign. One of `"owner"`, `"admin"`, or `"member"`. Defaults to `"member"` when omitted.
userstringUser ID (`usr_...`) to add as a member. Provide exactly one of `user` or `agent`.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team or member not found
  • 422Validation failed
DELETE/api/v1/teams/{team}/members

Remove a member or org from a team

Removes a user, agent, or all members of an organization from the specified team. Provide exactly one of `user`, `agent`, or `org` — supplying more than one or none returns a 400 error. On success, returns 204 No Content. When `org` is provided, every user and agent membership belonging to that org is removed in a single call. The caller must be a member of the team's owning org to perform an org-scoped removal. You cannot target the team's owning org itself with this parameter. The caller must have permission to manage the team. When `app` is present, the request is scoped to that app and requires a valid app-scoped token.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`). The team to remove the member from.

Responses

  • 204No content
  • 400Provide exactly one of user, agent, or org
  • 401Unauthorized
  • 403Forbidden
  • 404Team or member not found
PATCH/api/v1/teams/{team}/members/{user}

Update a team member's role

Changes the role of an existing user member on the specified team. Returns the updated membership on success. Only user memberships are supported by this endpoint. Attempting to update an agent membership returns 404. To change an agent's role, remove the existing membership and re-add the agent with the desired role. The caller must have permission to modify the team. You cannot change a member's role across organization boundaries. Demoting the last owner of a team returns 409. An invalid `role` value returns 422. When `app` is provided, the request is scoped to that app and requires a valid app-scoped token.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`team_...`). The team whose member role you want to update.
userpathrequiredstringUser ID (`usr_...`) of the existing member whose role should be changed.

Request body

NameTypeDescription
rolerequiredstringNew role to assign. One of `"owner"`, `"admin"`, or `"member"`.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden — caller lacks permission to modify this team
  • 404Team or member not found
  • 409Conflict — cannot demote the last owner
  • 422Validation failed (e.g. invalid role)
GET/api/v1/teams/{team}/threads

List threads for a team

Returns all threads owned by the specified team that the authenticated caller has permission to view. The caller must have access to the team; requests without team access are rejected with 404. Threads are returned in a single `data` array. Use the team-scoped thread endpoints to create, update, or delete individual threads.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`tem_...`) whose threads should be listed.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found
POST/api/v1/teams/{team}/threads

Create a thread for a team

Creates a new thread owned by the specified team. The authenticated caller must have access to the team; requests from callers without team access are rejected with 404. If a `profile_picture` is provided in the thread params, it must be base64-encoded image data. The image is uploaded and associated with the thread before creation completes. Omit `profile_picture` to skip this step. By default the platform sends an automatic welcome message into the new thread. Pass `skip_welcome_message: true` to suppress this behavior, for example when creating threads programmatically in bulk or seeding test data.

Bearer tokenPublishable key

Parameters

NameTypeDescription
teampathrequiredstringTeam ID (`tem_...`) that will own the created thread.

Request body

NameTypeDescription
skip_welcome_messagebooleanWhen `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
threadrequiredobjectAttributes for the new thread. See ThreadCreateParams for available fields.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Team not found
  • 422Validation failed
POST/api/v1/teams/join_by_code

Join a team with an invite code

Adds a principal to a team using a 12-character invite code. The invite code can be supplied as either `join_code` or `invite_code`; both are accepted for backwards compatibility. For user-authenticated requests, the currently authenticated user is added to the team. For server-to-server requests, you must supply either `agent` (to add an agent) or `user` (to add a specific user by ID). If the user is already a member of the team, the request succeeds without creating a duplicate membership. This endpoint is rate-limited to 10 requests per minute per IP address to prevent invite-code enumeration.

Bearer tokenPublishable key

Request body

NameTypeDescription
agentstringAgent ID (`agent_...`) to add to the team. When provided, the agent is joined instead of the authenticated user. Requires a server-to-server session.
invite_codestring12-character invite code — alias for `join_code` accepted for backwards compatibility.
join_codestring12-character invite code that identifies the team. Mutually usable with `invite_code`.
userstringUser ID (`user_...`) to add to the team. Required for server-to-server requests when `agent` is not supplied.

Responses

  • 200Successful response
  • 400Invalid join code format
  • 401Unauthorized
  • 404Invalid or expired join code
  • 429Too many requests

/api/v1/threads

Threads

15 operations
GET/api/v1/threads/{thread}

Retrieve a thread

Returns the full thread record for the given thread ID. The authenticated user must own the thread or be a member of the workspace it belongs to. Use this endpoint to fetch the current state of a single thread, including its title, description, and metadata. To list many threads, use the list endpoint with cursor-based pagination.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). The authenticated user must have access to this thread.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
PUT/api/v1/threads/{thread}

Update a thread

Updates one or more mutable properties of the specified thread and returns the full thread object with the applied changes. Only the fields you provide are modified; omitted fields retain their current values. If `profile_picture` is supplied, the image is uploaded before the other fields are saved. Supplying invalid base64 picture data returns 422 and no other fields are updated. The authenticated user must own the thread or be a team owner of the workspace the thread belongs to.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). The authenticated user must have permission to update this thread.

Request body

NameTypeDescription
descriptionstringOptional longer text describing the thread's purpose. Replaces the existing description when provided.
metadataobjectArbitrary key-value metadata to store on the thread. Merged with or replaces existing metadata.
mutedbooleanWhen `true`, suppresses notifications for new messages in this thread for the authenticated user.
profile_pictureobjectNew profile picture for the thread. Provide all three inner fields to replace the existing image.
titlestringHuman-readable display name for the thread. Replaces the existing title when provided.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
  • 422Validation failed
DELETE/api/v1/threads/{thread}

Delete a thread

Permanently deletes a thread and all of its messages and artifacts. This action cannot be undone. The authenticated user must own the thread or be an owner of the team the thread belongs to. Attempting to delete a thread owned by another user or team returns 403.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). The authenticated user must own this thread.

Responses

  • 204No content
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
GET/api/v1/threads/{thread}/agents

List agents in a thread

Returns the agents participating in the specified thread. Only personal user threads (threads owned by a single user, not a team) expose agents through this endpoint; requests for team threads return 404. The authenticated user must have visibility into the thread. Each agent entry includes display information such as name and profile picture. Thread-level overrides (e.g. a custom name or profile picture set for this thread) take precedence over the agent's default values. When the caller is the thread owner, each entry also includes an `agent_config` object describing the agent's message policy and context configuration.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). Must be a personal user thread visible to the authenticated user.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
GET/api/v1/threads/{thread}/artifacts

List artifacts for a thread

Returns all artifacts produced during a thread's AI conversation. Artifacts are structured outputs such as code files, documents, or generated assets created by the AI agent in response to messages in the thread. The authenticated user must have access to the specified thread. Results are returned in a single page; there is no cursor-based pagination for this endpoint.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). Must be accessible to the authenticated user.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
POST/api/v1/threads/{thread}/mark_read

Mark a thread as read

Records that a user has read up to a specific message in the thread. Unread indicators and badge counts are cleared up to the specified message. You must supply exactly one of `last_read_message` or `use_latest_message`. Omitting both returns 400. If `use_latest_message` is `true` and the thread has no messages, the request succeeds silently with no state change. For server-to-server (S2S) requests where no user identity is present in the token, the `user` param is required to identify whose read state to update.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). The thread to mark as read.

Request body

NameTypeDescription
last_read_messagestringMessage ID (`msg_...`) to record as the last read message. Mutually exclusive with `use_latest_message`.
use_latest_messagebooleanWhen `true`, marks the thread as read up to the latest message. Mutually exclusive with `last_read_message`.
userstringUser ID (`usr_...`) whose read state to update. Required for S2S requests; ignored when an authenticated user is present in the token.

Responses

  • 204No content
  • 401Unauthorized
  • 404Thread not found
  • 422Validation error
GET/api/v1/threads/{thread}/members

List members of a thread

Returns all current members of the specified thread, including both user and agent members. The authenticated user must have visibility into the thread; requests from users without access return 403. Results are returned as a flat array in the `data` field. The list is not paginated — all members are returned in a single response.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`) whose members should be returned.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
POST/api/v1/threads/{thread}/members

Add a member to a thread

Adds a user or agent as a member of the specified thread. The authenticated user must have access to the thread. On success the new membership record is returned with HTTP 201. Supply either `user` or `agent` depending on the value of `type`. Attempting to add a principal that is already a member of the thread returns a 422 error.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`) identifying the thread to add the member to.

Request body

NameTypeDescription
agentstringAgent ID of the principal to add. Required when `type` is `"agent"`.
membership_typestringRole granted to the new member. One of `"owner"` or `"member"`. Defaults to `"member"`.
typerequiredstringKind of principal being added. Must be `"user"` or `"agent"`.
userstringUser ID of the principal to add. Required when `type` is `"user"`.

Responses

  • 200Successful response
  • 401Unauthorized
  • 404Thread not found
  • 422Failed to add member
DELETE/api/v1/threads/{thread}/members

Remove a member from a thread

Removes a user or agent membership from the specified thread. The authenticated user must have access to the thread. A successful removal returns HTTP 204 with no response body. Supply either `user` or `agent` depending on the value of `type`. Returns 404 if the thread or the membership record does not exist.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`) identifying the thread to remove the member from.

Responses

  • 204No content
  • 401Unauthorized
  • 404Thread or member not found
  • 422Failed to remove member
GET/api/v1/threads/{thread}/messages

List messages in a thread

Returns a cursor-paginated list of messages belonging to the specified thread, ordered from oldest to newest. Supply `before_cursor` or `after_cursor` (not both) to page through the result set; omit both to receive the most recent page. The authenticated user must have access to the thread's owner (workspace or user). A 403 is returned if the thread exists but is not accessible to the caller; a 404 is returned if the thread does not exist or is not visible to the authenticated user. Pass `include_reply_counts: true` to annotate each message with the number of threaded replies it has received. This adds a small amount of latency and should be omitted when reply counts are not needed.

Bearer tokenPublishable key

Parameters

NameTypeDescription
limitqueryintegerMaximum number of messages to return per page. Defaults to 20.
after_cursorquerystringOpaque cursor returned in a previous response's `after_cursor` field. When provided, returns the page of messages immediately after that position. Cannot be combined with `before_cursor`.
before_cursorquerystringOpaque cursor returned in a previous response's `before_cursor` field. When provided, returns the page of messages immediately before that position. Cannot be combined with `after_cursor`.
threadpathrequiredstringThread ID (`thr_...`). The authenticated user must have access to this thread.
include_reply_countsquerybooleanWhen `true`, each message in the response is annotated with its threaded reply count. Defaults to `false`. Adds latency; omit when reply counts are not needed.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
PUT/api/v1/threads/{thread}/picture

Update a thread's profile picture

Uploads a new profile picture for the specified thread and returns the updated thread object. The image must be supplied as a base64-encoded string with its MIME type. The authenticated user must own the thread or be a team owner of the workspace the thread belongs to. Supplying invalid base64 data returns 422.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). The authenticated user must have permission to update this thread.

Request body

NameTypeDescription
picturerequiredobjectProfile picture payload. Must include the base64-encoded image data and its MIME type.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
  • 422Invalid base64 data
GET/api/v1/threads/{thread}/read_status

Retrieve a thread's read status

Returns the read status of a thread for the specified user, including the ID of the last message they have read and the number of unread messages remaining. For user-authenticated requests, the status is always returned for the authenticated user and the `user` parameter is ignored. For server-to-server (S2S) requests, the `user` parameter is required and must be a valid user ID. Returns 404 if the thread does not exist or the caller does not have access to it.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). Must be accessible to the authenticated user or, for S2S requests, to the specified user.
userquerystringUser ID (`usr_...`) whose read status to retrieve. Required for S2S requests; ignored for user-authenticated requests, which always return the status for the authenticated user.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
GET/api/v1/threads/{thread}/settings

Retrieve thread settings

Returns the current settings for the specified thread. Settings control per-thread behavior such as whether the AI agent is enabled. The authenticated user must own the thread or be a member of its workspace. If settings have never been explicitly configured, defaults are returned (for example, `agent_enabled` defaults to `true`).

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). Must belong to the authenticated user's workspace.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
PUT/api/v1/threads/{thread}/settings

Update thread settings

Updates the settings for the specified thread. Only fields included in the `settings` map are modified; omitted fields retain their current values. The authenticated user must own the thread or be a member of its workspace. Returns the full settings object reflecting the state after the update. Validation errors are returned as `422 Unprocessable Entity`.

Bearer tokenPublishable key

Parameters

NameTypeDescription
threadpathrequiredstringThread ID (`thr_...`). Must belong to the authenticated user's workspace.

Request body

NameTypeDescription
settingsrequiredobjectMap of settings fields to update. Include only the keys you want to change.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
  • 422Validation error

/api/v1/users

Users

9 operations
GET/api/v1/users/{user}

Retrieve a user by ID

Returns the user identified by `user`. The authenticated user must share at least one team with the target user; requests for users outside any shared team are rejected with 403. A user may always retrieve their own profile with this endpoint. Use the `GET /users/me` endpoint as a convenience alias for retrieving the authenticated user without specifying an ID.

Bearer tokenPublishable key

Parameters

NameTypeDescription
userpathrequiredstringUser ID (`usr_...`) of the user to retrieve.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
GET/api/v1/users/{user}/artifacts

List a user's artifacts

Returns all artifacts owned by the specified user. Artifacts represent AI-generated or user-uploaded files associated with agent sessions, threads, or sandboxes — such as images, documents, and code outputs. The authenticated user must be requesting their own artifacts or must have administrative access. Attempting to list artifacts for a user the caller is not authorized to access returns 403. Results are returned in a single page without cursor pagination. Each artifact in the response reflects the state of its current version, including a short-lived signed `file_url` for direct download.

Bearer tokenPublishable key

Parameters

NameTypeDescription
userpathrequiredstringUser ID (`usr_...`). The authenticated user must be this user or have access to their artifacts.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
POST/api/v1/users/{user}/artifacts

Create an artifact

Creates a new artifact and stores its file content. A file payload is required; supply it via the `artifact.file_content` (Base64-encoded), `artifact.file_name`, and `artifact.file_content_type` fields. The artifact is scoped to the owner resolved from the request context — either a team or a user. Optionally associate the artifact with an existing thread or agent by passing `artifact.thread_id` or `artifact.agent_id`. Returns 201 with the created artifact on success.

Bearer tokenPublishable key

Request body

NameTypeDescription
artifactrequiredobjectObject containing the attributes for the new artifact.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
POST/api/v1/users/{user}/invites

Create a user invite

Creates a new invite for the authenticated user. The invite can optionally be scoped to a specific thread, a persona, or carry arbitrary metadata. The caller receives the new invite object at HTTP 201. The invite key is always generated server-side (192-bit URL-safe random string) and cannot be supplied by the caller. The path `:user` must match the authenticated user. If a `thread_id` is provided, the authenticated user must have permission to invite others to that thread; team threads are not supported and return an error. Supplying a `thread_id` that does not exist or that belongs to a different user returns an error. If a key collision occurs during creation the call returns a 409 conflict — simply retry to generate a new key.

Bearer tokenPublishable key

Parameters

NameTypeDescription
userpathrequiredstringUser ID (`usr_...`). Must match the authenticated user.

Request body

NameTypeDescription
inviterequiredobjectParameters for the new invite. See the UserInviteCreateParams schema for field details.

Responses

  • 201Successful response
  • 401Unauthorized
  • 403Forbidden
  • 404Thread not found
  • 409Resource already exists
  • 422Validation failed; Invites cannot be created for team threads; Invalid thread id; User context is required
GET/api/v1/users/{user}/orgs

List organizations for a user

Returns the organizations the specified user belongs to. A user can belong to at most one organization, so the `data` array contains either zero or one items. The authenticated viewer must have permission to inspect the target user. Returns an empty `data` array when the user has no organization membership.

Bearer tokenPublishable key

Parameters

NameTypeDescription
userpathrequiredstringUser ID (`usr_...`) whose organization membership you want to retrieve.

Responses

  • 200Successful response
  • 401Unauthorized
PUT/api/v1/users/{user}/profile

Update the current user's profile

Updates one or more profile fields for the authenticated user. All fields are optional; omit any you do not want to change. When `profile_picture` is supplied, the image is uploaded and replaces the existing picture. The previous picture is deleted after the new one is stored. Image upload failures return 422 without modifying other profile fields.

Bearer tokenPublishable key

Parameters

NameTypeDescription
userpathrequiredstringUser ID (`usr_...`) or `"me"` for the authenticated user.

Request body

NameTypeDescription
aliasstringShort display alias shown in place of the full name in compact UI contexts.
full_namestringUpdated display name for the user.
metadataobjectArbitrary key-value metadata to associate with the user. Existing keys are merged; pass `null` for a key to remove it.
profile_pictureobjectNew profile picture to upload as a base64-encoded image. Replaces any existing picture.

Responses

  • 200Successful response
  • 401Unauthorized
  • 422Validation error
GET/api/v1/users/{user}/threads

List threads for a user

Returns all threads visible to the specified user. The authenticated caller must have access to the target user's account; a 403 is returned otherwise. Pass one or more `agent` IDs to narrow results to threads where at least one of the listed agents is also a member — useful for displaying every thread a user shares with a particular agent. Pass one or more `filter` objects to narrow results by thread metadata key/value pairs. Both narrowings may be combined in a single request. Results are returned as a flat array; no cursor-based pagination is applied.

Bearer tokenPublishable key

Parameters

NameTypeDescription
agentqueryarray<string>Array of agent user IDs (`usr_...`). When provided, only threads where at least one of the listed agents is also a member are returned. Omit or pass an empty array to return all threads regardless of agent membership.
filterqueryarray<object>Array of metadata filter objects. Each filter matches threads whose `metadata` map contains the specified key/value pair. All filters must match (logical AND). Omit to return threads regardless of metadata.
userpathrequiredstringUser ID (`usr_...`) whose threads should be listed.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
POST/api/v1/users/{user}/threads

Create a thread for a user

Creates a new thread owned by the specified user. The authenticated caller must have access to the target user's account; a 403 is returned otherwise. An automatic welcome message is sent into the thread upon creation unless `skip_welcome_message` is set to `true`. The thread is immediately visible to the owning user and any members added at creation time.

Bearer tokenPublishable key

Parameters

NameTypeDescription
userpathrequiredstringUser ID (`usr_...`) of the user who will own the new thread.

Request body

NameTypeDescription
skip_welcome_messagebooleanWhen `true`, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to `false`.
threadrequiredobjectAttributes for the new thread. See ThreadCreateParams for the full set of accepted fields.

Responses

  • 200Successful response
  • 401Unauthorized
  • 403Forbidden
  • 422Validation failed
GET/api/v1/users/me

Retrieve the current user

Returns the user associated with the authenticated session or bearer token. This is the canonical way to resolve "who am I?" after authentication. The response includes the user's profile, notification settings, and profile picture, along with the app, organization, and sandbox the token is scoped to and their display names — enough to establish full session context in a single call. Unauthenticated requests return 401.

Bearer tokenPublishable key

Responses

  • 200Successful response
  • 401Unauthorized

WebSocket topics

Channels

30 channel entries

Realtime channel documentation is generated from the OpenAPI x-channels extension. Channel replies use the Phoenix-style envelope documented by the channel schemas.

Realtime channel

API Chat Channel

6 joins · 10 messages · 4 pushes

Channel for real-time chat messaging. Supports team-scoped and user-scoped threads with keyed, transient, and direct thread access patterns.

Join topics

JOINapi:chat:team:{team_id}:thread:{thread_id}

Join Team Thread

Join a team-scoped thread by ID

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
limitintegerNo description provided.
team_idrequiredstringNo description provided.
thread_idrequiredstringNo description provided.
JOINapi:chat:team:{team_id}:transient:{key}

Join Team Transient

Join a team-scoped transient (ephemeral) thread

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
keyrequiredstringNo description provided.
limitintegerNo description provided.
team_idrequiredstringNo description provided.
JOINapi:chat:user:thread:{thread_id}

Join User Thread

Join a user-scoped thread by ID

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
limitintegerNo description provided.
thread_idrequiredstringNo description provided.
JOINapi:chat:user:transient:{key}

Join User Transient

Join a user-scoped transient (ephemeral) thread

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
keyrequiredstringNo description provided.
limitintegerNo description provided.
JOINapi:chat:team:{team_id}:key:{key}

Join Team Keyed

Join or create a team-scoped keyed thread

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
keyrequiredstringNo description provided.
limitintegerNo description provided.
team_idrequiredstringNo description provided.
JOINapi:chat:user:key:{key}

Join User Keyed

Join or create a user-scoped keyed thread

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
keyrequiredstringNo description provided.
limitintegerNo description provided.

Messages

EVENTapi:chat:add_reaction

Add Reaction

Add an emoji reaction to a message

Payload fields

NameTypeDescription
emojirequiredstringNo description provided.
message_idrequiredstringNo description provided.
EVENTapi:chat:delete_message

Delete Message

Delete a message

Payload fields

NameTypeDescription
message_idrequiredstringNo description provided.
EVENTapi:chat:edit_message

Edit Message

Edit an existing message's content

Payload fields

NameTypeDescription
contentrequiredstringNo description provided.
message_idrequiredstringNo description provided.
EVENTapi:chat:fork_thread

Fork Thread

Fork a sub-thread from an existing message

Payload fields

NameTypeDescription
message_idrequiredstringNo description provided.
titlestringNo description provided.
EVENTapi:chat:list_messages

List Messages

List all messages in the current thread

EVENTapi:chat:load_more_messages

Load More Messages

Load additional messages with cursor-based pagination

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
include_metadatabooleanNo description provided.
limitintegerNo description provided.
EVENTapi:chat:mark_thread_read

Mark Thread Read

Mark a thread as read up to a given message

Payload fields

NameTypeDescription
message_idrequiredstringNo description provided.
EVENTapi:chat:post_message

Post Message

Post a new message with optional uploads and reply-to

Payload fields

NameTypeDescription
contentrequiredstringNo description provided.
idempotency_keystringNo description provided.
reply_tostringNo description provided.
uploadsarray<object>No description provided.
EVENTapi:chat:post_simple_message

Post Simple Message

Post a simple text message

Payload fields

NameTypeDescription
contentstringNo description provided.
idempotency_keystringNo description provided.
reply_tostringNo description provided.
EVENTapi:chat:remove_reaction

Remove Reaction

Remove an emoji reaction from a message

Payload fields

NameTypeDescription
emojirequiredstringNo description provided.
message_idrequiredstringNo description provided.

Pushes

PUSHsystem_event

System Event

Broadcast system-wide events

Payload fields

NameTypeDescription
eventobjectNo description provided.
PUSHthread_event

Thread Event

Broadcast thread-level events (agent updates, read state, unread counts)

Payload fields

NameTypeDescription
payloadobjectNo description provided.
thread_idstringNo description provided.
typestringNo description provided.
PUSHmessage_updated

Message Updated

Broadcast when a message is updated or removed

Payload fields

NameTypeDescription
messageobjectA chat message posted in a thread, including its content, author, attachments, reactions, and optional reply metadata.
thread_idstringNo description provided.
PUSHmessage_added

Message Added

Broadcast when a new message is added to a thread

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
messageobjectA chat message posted in a thread, including its content, author, attachments, reactions, and optional reply metadata.
thread_idstringNo description provided.

Realtime channel

API Object Channel

2 joins · 2 messages · 2 pushes

Channel for real-time custom object collaboration. Clients join `api:object:{object_id}` to receive the current object state and subscribe to field-level updates. Mutations are sent as key:value maps.

Join topics

JOINapi:object:{object_id}

Join By Id

Payload fields

NameTypeDescription
object_idrequiredstringNo description provided.
JOINapi:object:{schema_type}:{row_key}

Join By Row Key

Payload fields

NameTypeDescription
row_keyrequiredstringNo description provided.
schema_typerequiredstringNo description provided.

Messages

EVENTsave

Save

EVENTupdate_fields

Update Fields

Payload fields

NameTypeDescription
fieldsrequiredobjectNo description provided.

Pushes

PUSHobject_created

Object Created

Payload fields

NameTypeDescription
fieldsobjectNo description provided.
idstringNo description provided.
PUSHobject_updated

Object Updated

Payload fields

NameTypeDescription
fieldsobjectNo description provided.
idstringNo description provided.

Realtime channel

API Activity Feed Channel

2 joins · 1 messages · 1 pushes

Phoenix channel for real-time activity feed updates. Clients join a topic scoped to an agent or org and receive `new_entry` events as feed entries are created. ## Topics * `"api:activity_feed:agent:{agent_user_id}"` — entries for a specific agent * `"api:activity_feed:org:{org_id}"` — entries for an entire org/tenant

Join topics

JOINapi:activity_feed:agent:{agent_id}

Join Agent

Join an agent-scoped activity feed

Payload fields

NameTypeDescription
agent_idrequiredstringNo description provided.
JOINapi:activity_feed:org:{org_id}

Join Org

Join an org-scoped activity feed

Payload fields

NameTypeDescription
org_idrequiredstringNo description provided.

Messages

EVENTlist_entries

List Entries

List activity feed entries with cursor-based pagination

Payload fields

NameTypeDescription
after_cursorstringNo description provided.
before_cursorstringNo description provided.
kindstringNo description provided.
levelstringNo description provided.
limitintegerNo description provided.

Pushes

PUSHnew_entry

New Entry

Payload fields

NameTypeDescription
entryobjectNo description provided.