Agent
A persistent agent: list, create, read or delete one, rename it, change who can see it, and read its conversation, usage and runtime (actions).
Operations
Every route this entity exposes. Each route links to its own reference on this page.
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
agents, err := client.Agent(nil).List(map[string]any{"organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(agents)
agent, err := client.Agent(nil).Load(map[string]any{"id": "example_id", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(agent)
created, err := client.Agent(nil).Create(map[string]any{"organization_id": "example", "name": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
removed, err := client.Agent(nil).Remove(map[string]any{"id": "example_id", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local agents, err = client:Agent():list({ organization_id = "example" })
local agent, err = client:Agent():load({ id = "example_id", organization_id = "example" })
local created, err = client:Agent():create({ organization_id = "example", name = "example" })
local removed, err = client:Agent():remove({ id = "example_id", organization_id = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$agents = $client->Agent()->list(["organization_id" => "example"]);
$agent = $client->Agent()->load(["id" => "example_id", "organization_id" => "example"]);
$created = $client->Agent()->create(["organization_id" => "example", "name" => "example"]);
$client->Agent()->remove(["id" => "example_id", "organization_id" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
agents = client.Agent().list({"organization_id": "example"})
agent = client.Agent().load({"id": "example_id", "organization_id": "example"})
created = client.Agent().create({ "organization_id": "example", "name": "example" })
client.Agent().remove({"id": "example_id", "organization_id": "example"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
agents = client.Agent.list({ "organization_id" => "example" })
agent = client.Agent.load({ "id" => "example_id", "organization_id" => "example" })
created = client.Agent.create({ "organization_id" => "example", "name" => "example" })
client.Agent.remove({ "id" => "example_id", "organization_id" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const agents = await client.Agent().list({ organization_id: "example" })
const agent = await client.Agent().load({ id: "example_id", organization_id: "example" })
const created = await client.Agent().create({ organization_id: "example", name: "example" })
await client.Agent().remove({ id: "example_id", organization_id: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
attention |
one,string,null |
Yes | Whether this agent waits on its viewer, decided from its provisioning, decisions awaiting an answer, the outcome of its last reported run and the model's verdict on its last reply (question when reply_triage is needs_you). |
avatar |
one,string,null |
No | Emoji or up to two visible grapheme clusters, at most 64 UTF-8 bytes, without control or bidi override characters. |
can_delete |
boolean |
No | Whether this viewer may delete this v2 agent. |
can_edit_configuration |
boolean |
Yes | Can Edit Configuration |
can_manage |
boolean |
Yes | Can Manage |
can_manage_sharing |
boolean |
No | Can Manage Sharing |
can_name_managers |
boolean |
No | Whether the viewer may name managers now. |
can_queue_input |
boolean |
No | Current V2 authority to admit a durable input independently of native readiness. |
can_reconcile_save |
boolean |
Yes | May reconcile an identical previously accepted save; this does not authorize new configuration edits. |
configuration |
any |
Yes | Configuration |
configuration_revision |
integer |
Yes | Configuration Revision |
configuration_version |
one,string,null |
Yes | Opaque version token. |
control_connections_available |
boolean |
No | Whether this viewer may manage their own external Control connections, including cleanup while the agent is paused. |
controlling_user_id |
string |
Yes | Controlling User Id |
coordination_available |
boolean |
No | Durable task controls remain available even when native conversation history is unavailable. |
created_at |
string |
Yes | Created At |
direct_chat_available |
boolean |
No | Advisory availability of direct V1 chat. |
has_unread_updates |
boolean |
Yes | Has Unread Updates |
id |
string |
Yes | Id |
last_reply_at |
one,string,null |
Yes | When the agent's latest projected reply arrived, for grouping recent replies. |
lifecycle_actions |
array |
Yes | Currently authorized lifecycle actions for the saved revision and observed state. |
lifecycle_version |
one,string,null |
Yes | Opaque version token. |
local_agent_control_available |
boolean |
No | Whether this organization exposes paired local coding-agent control. |
managers |
array |
No | Teammates named as managers beside the owner. |
model_change_action |
one,string,null |
No | Advisory composer action. |
name |
string |
Yes | Name |
organization_id |
string |
Yes | Organization Id |
persona |
any |
No | Persona |
preview |
any |
No | Preview |
preview_received_at |
one,string,null |
No | When a newer canonical conversation preview was first projected. |
provisioning |
any |
No | Provisioning |
reply_triage |
one,object,null |
Yes | A model's verdict on the agent's latest reply, judged once when it arrived. |
runtime_version |
string |
No | Immutable execution runtime selected at creation. |
setup_pending |
boolean |
Yes | Setup Pending |
sharing_fixed |
boolean |
No | Project agents have a fixed audience and cannot change visibility. |
sharing_version |
integer |
No | Sharing Version |
slug |
string |
Yes | Optional explicit API alias. |
status |
string |
Yes | Status |
team_role |
string |
No | What teammates may do once the agent is shared with the team. |
updated_at |
string |
Yes | Updated At |
url_slug |
string |
No | Stable organization-scoped browser name for /ORG/agent/NAME. |
visibility |
string |
No | Defaults to organization. |
create
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/browser_opened
Operation ID: spark_browser_opened_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
Idempotency-Key |
header |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
source |
enum: button, link, agent |
Yes | |
surface |
enum: web, desktop |
Yes |
Responses
200: Success
application/json
The response is object.
204: Browser opening recorded
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/marked_read
Operation ID: spark_marked_read_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
Idempotency-Key |
header |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
source |
enum: mission_control, conversation |
Yes | |
surface |
enum: web, desktop |
Yes |
Responses
200: Success
application/json
The response is object.
204: Read recorded
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/slack
Operation ID: spark_slack_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
Idempotency-Key |
header |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
action |
enum: connect, disconnect, slack_connect, reply_places |
Yes | |
allow_slack_connect |
boolean |
No | |
channel |
string |
No | Required for connect, disconnect and slack_connect |
handle |
string |
No | |
icon_emoji |
string |
No | |
reply_places |
array of enum: direct_messages, public_channels, private_channels, all_channels |
No | Required for reply_places: every place the bot should reply, at least one |
Responses
200: Agent Slack settings
application/json
| Property | Type | Required | Description |
|---|---|---|---|
message |
string |
Yes | |
slack |
object |
Yes | |
slack.account_connected |
boolean |
Yes | |
slack.app |
object |
Yes | |
slack.app.bot_name |
string,null |
Yes | The bot's name in Slack, as setup created it, once the app is configured |
slack.app.can_configure |
boolean |
Yes | |
slack.app.can_disconnect |
boolean |
Yes | |
slack.app.character_url |
string,null |
Yes | |
slack.app.configured |
boolean |
Yes | |
slack.app.connected |
boolean |
Yes | |
slack.app.event_url |
string,null |
Yes | |
slack.app.prepared |
boolean |
Yes | |
slack.app.settings_url |
string,null |
Yes | |
slack.app.setup_url |
string,null |
Yes | |
slack.app.version |
integer |
Yes | |
slack.as_you |
object |
Yes | The agent posting to Slack as its owner, with the owner's own Slack account through Composio. |
slack.as_you.account |
object,null |
Yes | |
slack.as_you.account.connection_id |
string |
Yes | |
slack.as_you.account.name |
string |
Yes | |
slack.as_you.account.status |
string |
Yes | |
slack.as_you.account.workspace |
string,null |
Yes | |
slack.as_you.available |
boolean |
Yes | |
slack.as_you.can_manage |
boolean |
Yes | Only the owner may connect, configure or disconnect it. |
slack.as_you.confirm_before_sending |
boolean |
Yes | |
slack.as_you.mode |
enum: bot, you, null |
Yes | Which way the agent posts once the owner connected: as the owner (you) or with its own bot (bot). While it is you, the bot's Slack tools are not used. Null before the owner connects. |
slack.as_you.owner_name |
string,null |
Yes | |
slack.as_you.posting |
boolean |
Yes | Whether the agent posts as the owner now: mode is you, the organization allows the account here, and it is still saved. The bot cannot send while this is true, even when the account needs reconnecting. |
slack.as_you.show_sent_using |
boolean |
Yes | |
slack.available |
boolean |
Yes | |
slack.can_change_reply_places |
boolean |
Yes | |
slack.can_edit_handle |
boolean |
Yes | |
slack.can_manage |
boolean |
Yes | |
slack.can_publish |
boolean |
Yes | |
slack.channel_setup_available |
boolean |
Yes | |
slack.channels |
array of object |
Yes | |
slack.channels[].allow_slack_connect |
boolean |
Yes | |
slack.channels[].enabled |
boolean |
Yes | |
slack.channels[].id |
string |
Yes | |
slack.channels[].name |
string,null |
Yes | The channel's name in Slack, without #; null when Slack cannot say. |
slack.connect_url |
string |
Yes | |
slack.disabled_reason |
string,null |
Yes | |
slack.display_name |
string |
Yes | |
slack.handle |
string |
Yes | |
slack.icon_emoji |
string |
Yes | |
slack.mention_id |
string,null |
Yes | |
slack.reply_place_choices |
array of enum: direct_messages, public_channels, private_channels, all_channels |
Yes | The reply places this agent's bot can offer; direct messages and all channels need its own bot. |
slack.reply_places |
array of enum: direct_messages, public_channels, private_channels, all_channels |
Yes | Where the bot replies; any mix may be on. all_channels replies in every channel of an allowed kind the bot is in, without publishing each one. |
slack.workspace_name |
string,null |
Yes |
401: Unauthorized
403: Agent manager and organization admin required
404: Not found
422: Invalid Slack settings
502: Bad gateway
503: Slack unavailable; retry the same operation
POST /api/v1/organizations/{organization_id}/agents
Operation ID: post_api_v1_organizations_organization_id_agents.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
viewer_time_zone |
query |
string |
No | IANA time zone used to choose a region for the agent's new managed sandbox. |
Idempotency-Key |
header |
string |
Yes | Stable unique operation key; reuse only for the identical request, including expected versions. |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
configuration |
object |
No | |
configuration.connection_grants |
array of string |
No | App accounts the agent can use, pinned as agent_connection_ID:GENERATION. Each must be current and choosable by the creator. A private agent also uses its owner's own accounts without being listed here. |
configuration.instructions |
string |
No | |
configuration.model_policy |
object or object |
No | |
configuration.work_repositories |
array of object |
No | |
configuration.work_repositories[].exclude_default_branch |
boolean |
No | With write permission, exclude the current default branch. Defaults to false. |
configuration.work_repositories[].permission |
enum: read, write |
No | Defaults to write when omitted. |
configuration.work_repositories[].repository_id |
string |
Yes | |
configuration.work_repositories[].write_branches |
array of string |
No | Exact branches allowed for writes. Empty or omitted allows all branches, subject to exclude_default_branch and normal repository protections. |
name |
string |
Yes | |
runtime_version |
enum: v2 |
No | The native agent runtime. Omit or use v2. |
slug |
string |
No | Optional explicit API alias. Omit to generate a unique slug from the name. |
visibility |
enum: private, organization |
No | Defaults to organization. Members may view and message; only owner and managers may change settings. |
Responses
200: Authorized agent with current configuration and version tokens
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agent |
object and object |
Yes |
201: Authorized agent with current configuration and version tokens
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agent |
object and object |
Yes |
202: Private identity and initialization accepted; setup is pending Git recovery
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agent |
object and object |
Yes |
401: Authentication required
403: Current private-agent management authority required
404: Organization or authorized agent not found
409: Version or idempotency conflict; reload before starting a new operation
422: Invalid configuration or operation
502: Bad gateway
503: Private Git state unavailable. Retry the same Idempotency-Key and unchanged body
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/call_session
Operation ID: spark_call_session_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Ephemeral OpenAI realtime client secret (never the provider API key)
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expires_at |
integer (int64) |
Yes | Client secret expiration in Unix seconds |
value |
string |
Yes | Ephemeral OpenAI client secret; keep private and never log it |
401: Unauthorized
403: Agent messaging is not authorized or available
404: Organization or agent not visible to this user
422: Invalid or nonempty request body, or unexpected query parameters
429: Too many call sessions; retry after 60 seconds
502: Bad gateway
503: Calls are not configured or the provider is unavailable; no provider details are returned
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
string |
Yes | |
error |
string |
Yes |
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/lifecycle
Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_lifecycle.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
heartbeat_enabled |
boolean |
Yes |
Responses
200: Native agent lifecycle response
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
compaction |
object |
Yes | |
compaction.mode |
string |
Yes | |
heartbeat |
object |
Yes | |
heartbeat.enabled |
boolean |
Yes | |
heartbeat.interval_minutes |
number,null |
Yes | |
heartbeat.last_run_at |
string |
Yes | |
heartbeat.last_status |
string |
Yes | |
memory |
object |
Yes | |
memory.provider |
string |
Yes | |
memory.remember_across_conversations |
boolean |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/transcription_session
Operation ID: spark_transcription_session_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Ephemeral OpenAI transcription client secret (never the provider API key)
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expires_at |
integer (int64) |
Yes | Client secret expiration in Unix seconds |
value |
string |
Yes | Ephemeral OpenAI client secret; keep private and never log it |
401: Unauthorized
403: Agent messaging is not authorized or available
404: Organization or agent not visible to this user
422: Invalid or nonempty request body
429: Too many transcription sessions; retry after 60 seconds
502: Bad gateway
503: Transcription is not configured or the provider is unavailable; no provider details are returned
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
string |
Yes | |
error |
string |
Yes |
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/warm
Operation ID: spark_warm_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
conversation_id |
string |
Yes |
Responses
200: Success
application/json
The response is object.
202: Preparation requested or not needed
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
POST /api/v1/agent/chat
Operation ID: api_v1_chat.
Authentication: bearer token (bearerAuth).
Request body
application/json
The request body is object.
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
list
GET /api/v1/organizations/{organization_id}/agents
Operation ID: api_v1_organization_persistent_agents.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
runtime_version |
query |
enum: v2 |
No | |
limit |
query |
integer |
No | |
cursor |
query |
string |
No | |
q |
query |
string |
No | |
status |
query |
enum: all, draft, active, paused, archived |
No | Archived agents are excluded by default. |
Responses
200: Authorized agent roster
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agents |
array of object |
Yes | |
agents[].attention |
enum: question, approval, setup_failed, run_failed, null |
Yes | Whether this agent waits on its viewer, decided from its provisioning, decisions awaiting an answer, the outcome of its last reported run and the model's verdict on its last reply (question when reply_triage is needs_you). Null when nothing waits or the agent is not active. Clients map it to labels and never classify messages or run status themselves. |
agents[].avatar |
string,null |
No | Emoji or up to two visible grapheme clusters, at most 64 UTF-8 bytes, without control or bidi override characters. Null selects the default icon. Omission preserves legacy configuration bytes. |
agents[].can_delete |
boolean |
No | Whether this viewer may delete this v2 agent. |
agents[].can_manage |
boolean |
Yes | |
agents[].can_manage_sharing |
boolean |
No | |
agents[].configuration_revision |
integer |
Yes | |
agents[].control_connections_available |
boolean |
No | Whether this viewer may manage their own external Control connections, including cleanup while the agent is paused. |
agents[].controlling_user_id |
string |
Yes | |
agents[].coordination_available |
boolean |
No | Durable task controls remain available even when native conversation history is unavailable. |
agents[].created_at |
string (date-time) |
Yes | |
agents[].has_unread_updates |
boolean |
Yes | |
agents[].id |
string |
Yes | |
agents[].last_reply_at |
string,null (date-time) |
Yes | When the agent's latest projected reply arrived, for grouping recent replies. Null before the first reply, and while the preview is the viewer's own input. |
agents[].local_agent_control_available |
boolean |
No | Whether this organization exposes paired local coding-agent control. Every operation requires current owner access or explicit requester-bound agent consent. |
agents[].name |
string |
Yes | |
agents[].organization_id |
string |
Yes | |
agents[].persona |
object or null |
No | |
agents[].preview |
null or object |
No | |
agents[].preview_received_at |
string,null (date-time) |
No | When a newer canonical conversation preview was first projected. Older previews may be undated; this is not task completion time. |
agents[].provisioning |
object or null |
No | |
agents[].reply_triage |
object,null |
Yes | A model's verdict on the agent's latest reply, judged once when it arrived. Null while the reply is unjudged or could not be judged, and while the preview is the viewer's own input; clients then keep the reply where its unread state puts it. |
agents[].reply_triage.question_text |
string,null |
Yes | The question or request to the viewer, for needs_you only. |
agents[].reply_triage.reason |
string |
Yes | A short plain phrase for the viewer saying what the reply is about. |
agents[].reply_triage.verdict |
enum: needs_you, fyi, quiet |
Yes | needs_you when the agent waits on the viewer, fyi when the reply is worth reading but asks nothing, quiet when it is noise to hide. |
agents[].runtime_version |
enum: v2 |
No | Immutable execution runtime selected at creation. |
agents[].sharing_fixed |
boolean |
No | Project agents have a fixed audience and cannot change visibility. |
agents[].sharing_version |
integer |
No | |
agents[].slug |
string |
Yes | |
agents[].status |
enum: draft, active, paused, archived |
Yes | |
agents[].team_role |
enum: manager, collaborator |
No | What teammates may do once the agent is shared with the team. Collaborators chat with it; managers also change its apps, secrets and settings. The owner and named managers always manage it. |
agents[].updated_at |
string (date-time) |
Yes | |
agents[].url_slug |
string |
No | Stable organization-scoped browser name for /ORG/agent/NAME. Legacy slug and public IDs remain accepted. |
agents[].visibility |
enum: private, organization |
No | |
creation_enabled |
boolean |
Yes | |
pagination |
object |
Yes | |
pagination.limit |
integer |
Yes | |
pagination.next |
string,null |
No |
401: Authentication required
403: Current private-agent management authority required
404: Organization or authorized agent not found
409: Version or idempotency conflict; reload before starting a new operation
422: Invalid configuration or operation
502: Bad gateway
503: Private Git state unavailable. Retry the same Idempotency-Key and unchanged body
load
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/message_image
Operation ID: spark_message_image_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
conversation_id |
query |
string |
Yes | |
message_id |
query |
string |
Yes | |
index |
query |
integer |
Yes |
Responses
200: Private message image
application/json
The response is object.
image/png
The response is string (binary).
image/jpeg
The response is string (binary).
image/webp
The response is string (binary).
image/gif
The response is string (binary).
image/avif
The response is string (binary).
401: Authentication required
403: Current agent access required
404: Message image unavailable
422: Invalid message image request
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/avatar
Operation ID: get_persistent_agent_avatar.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
asset |
query |
enum: sprite |
No | |
version |
query |
string |
Yes |
Responses
200: Authorized private image
application/json
The response is object.
image/webp
The response is string (binary).
401: Authentication required
403: Current private access required
404: Agent or current image unavailable
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/coordination
Operation ID: spark_coordination_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
conversation_id |
query |
string |
Yes | |
cursor |
query |
string |
No |
Responses
200: Recent root tasks issued by this thread, including durable waits and reports
application/json
| Property | Type | Required | Description |
|---|---|---|---|
next_cursor |
string,null |
Yes | |
tasks |
array of object |
Yes | |
tasks[].can_stop |
boolean |
Yes | |
tasks[].conversation_id |
string |
Yes | |
tasks[].created_at |
string (date-time) |
Yes | |
tasks[].deadline_at |
string (date-time) |
Yes | |
tasks[].delegation_stopped_at |
string,null (date-time) |
Yes | |
tasks[].id |
string |
Yes | |
tasks[].requests |
array of object |
Yes | |
tasks[].requests[].can_open |
boolean |
Yes | |
tasks[].requests[].id |
string |
Yes | |
tasks[].requests[].result |
object |
Yes | |
tasks[].requests[].result.conversation_id |
string |
No | |
tasks[].requests[].result.error |
string |
No | |
tasks[].requests[].result.report |
string |
No | |
tasks[].requests[].result.status |
enum: pending, running, completed, failed, needs_attention, cancelled |
Yes | |
tasks[].requests[].selection |
object,null |
Yes | |
tasks[].requests[].selection.harness |
string |
No | |
tasks[].requests[].selection.model |
string |
No | |
tasks[].requests[].selection.reasoning |
string,null |
No | |
tasks[].requests[].stop_state |
enum: stopping, stopped, needs_attention, null |
Yes | |
tasks[].requests[].title |
string |
Yes | |
tasks[].stop_state |
enum: stopping, stopped, needs_attention, null |
Yes | |
tasks[].waits |
object |
Yes | |
tasks[].waits.items |
array of object |
Yes | |
tasks[].waits.items[].can_stop |
boolean |
Yes | |
tasks[].waits.items[].expires_at |
string (date-time) |
Yes | |
tasks[].waits.items[].id |
string |
Yes | |
tasks[].waits.items[].status |
enum: waiting, queued, completed, needs_attention, cancelled |
Yes | |
tasks[].waits.items[].stop_state |
enum: stopping, stopped, needs_attention, null |
Yes | |
tasks[].waits.items[].wake_outcome |
string,null |
Yes | |
tasks[].waits.next_cursor |
string,null |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/relay/resource
Operation ID: spark_relay_resource_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
uri |
query |
string |
Yes |
Responses
200: Authorized operator result
application/json
| Property | Type | Required | Description |
|---|---|---|---|
contents |
array of object |
Yes | |
contents[].blob |
string |
No | |
contents[].mimeType |
string |
No | |
contents[].text |
string |
No | |
contents[].uri |
string |
Yes | |
participant |
string |
Yes | |
requester_id |
string |
Yes | |
scope_key |
string |
Yes |
401: Authentication required
403: Current requester access is required
404: Agent or operator receipt unavailable
409: Request key belongs to different arguments
422: Invalid bounded request
503: Relay unavailable
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/input_delivery
Operation ID: spark_input_delivery_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
X-Composal-Requester-Id |
header |
string |
No | Fence a retained operation to its original authenticated user; never grants authority. |
Idempotency-Key |
header |
string |
Yes | |
conversation_id |
query |
string |
No | |
requester_membership_id |
query |
string |
No |
Responses
200: Rails custody or native acknowledgement for this exact submission; waiting does not prove native acceptance
application/json
The response is object or object.
401: Unauthorized
403: Current agent access is required
404: No delivery belongs to this sender and original membership
422: Invalid input key or original requester membership
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/relay/inspection
Operation ID: spark_relay_inspection_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
view |
query |
enum: agents, channels, conversations, channel, dm, thread |
Yes | |
target |
query |
string |
No | |
cursor |
query |
string |
No | |
before |
query |
string |
No | |
after |
query |
string |
No | Thread reply continuation; replies are oldest first. |
Responses
200: Authorized bounded room observation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
after |
string,null |
Yes | |
agents |
array of object |
Yes | |
agents[].name |
string |
Yes | |
agents[].status |
string |
Yes | |
agents[].thread |
object or null |
Yes | |
agents[].type |
string |
No | |
before |
string,null |
Yes | |
channel |
object or null |
No | |
channel_steering_available |
boolean |
No | |
channels |
array of object |
Yes | |
channels[].id |
string |
Yes | |
channels[].is_archived |
boolean |
No | |
channels[].name |
string |
Yes | |
channels[].topic |
string,null |
No | |
conversations |
array of object |
Yes | |
conversations[].id |
string |
Yes | |
conversations[].last_message |
object or null |
Yes | |
conversations[].management_actions |
array of object or object |
No | |
conversations[].message_count |
integer |
Yes | |
conversations[].name |
string,null |
No | |
conversations[].participants |
array of string |
Yes | |
conversations[].type |
string |
Yes | |
cursor |
string,null |
Yes | |
management_actions |
array of object or object |
No | |
message_target |
object or null |
No | Selected message destination. Submission still checks the current operator participant permissions. Absent on older servers. |
messages |
array of object |
Yes | |
messages[].agent_name |
string |
Yes | |
messages[].attachments |
array of object |
Yes | |
messages[].attachments[].content_type |
string |
Yes | |
messages[].attachments[].file_id |
string |
Yes | |
messages[].attachments[].filename |
string |
Yes | |
messages[].attachments[].size_bytes |
integer |
Yes | |
messages[].created_at |
string |
Yes | |
messages[].id |
string |
Yes | |
messages[].reactions |
array of object |
Yes | |
messages[].reactions[].count |
integer |
Yes | |
messages[].reactions[].emoji |
string |
Yes | |
messages[].read_by_count |
integer |
No | |
messages[].reply_count |
integer |
No | |
messages[].text |
string |
Yes | |
parent |
object or null |
Yes | |
participant |
string |
Yes | |
requester_id |
string |
Yes | |
scope_key |
string |
Yes | |
target |
string,null |
Yes | |
view |
enum: agents, channels, conversations, channel, dm, thread |
Yes |
403: Current requester access required
404: Room or conversation unavailable
422: Invalid inspection selection
503: Observation unavailable
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/thread_model
Operation ID: spark_thread_model_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
conversation_id |
query |
string |
Yes |
Responses
200: Available models for this thread
application/json
| Property | Type | Required | Description |
|---|---|---|---|
choices |
array of object |
Yes | |
choices[].label |
string |
Yes | |
choices[].model |
string |
Yes | |
inherit_main |
boolean |
Yes | |
model |
string,null |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}
Operation ID: api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Authorized agent settings
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agent |
object and object |
Yes |
401: Authentication required
403: Current private-agent management authority required
404: Organization or authorized agent not found
409: Version or idempotency conflict; reload before starting a new operation
422: Invalid configuration or operation
502: Bad gateway
503: Private Git state unavailable. Retry the same Idempotency-Key and unchanged body
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/compute
Operation ID: spark_compute_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
cursor |
query |
string |
No | |
conversation_id |
query |
string |
No |
Responses
200: Requester-authorized paired computer choices for a new thread
application/json
| Property | Type | Required | Description |
|---|---|---|---|
choices |
object |
Yes | |
choices.can_create |
boolean |
Yes | |
choices.devices |
array of object |
Yes | |
choices.devices[].can_browse_folders |
boolean |
Yes | Whether the requester can list this computer's folders. |
choices.devices[].device_id |
string |
Yes | |
choices.devices[].name |
string |
Yes | |
choices.devices[].owned |
boolean |
Yes | Whether the requester owns this computer and can remove its projects. |
choices.devices[].platform |
enum: darwin, win32, linux |
Yes | |
choices.devices[].projects |
array of object |
Yes | Visible recent project folders, most recent first. |
choices.devices[].projects[].path |
string |
Yes | |
choices.devices[].projects[].project_id |
string |
Yes | |
choices.devices[].selected_folders |
array of string |
No | Configured folder shortcuts for new threads; empty when all folders are visible. |
choices.devices_enabled |
boolean |
Yes | |
choices.empty_folder_harnesses |
array of enum: codex, claude, pi |
No | Coding agents a thread can use in an empty folder, with no repository. Present only for private bots. |
choices.next_cursor |
string,null |
Yes | |
choices.requester_membership_id |
string,null |
Yes | |
choices.sandbox_harnesses |
array of enum: codex, claude, pi |
No | Coding agents a new sandbox thread can use now: codex plus each one whose credential is available. Present only for private bots. |
choices.sandbox_repositories |
array of object |
No | Granted, available repositories a new sandbox thread can start on, in grant order. ready means it starts from the repository's environment image. Present only for private bots. |
choices.sandbox_repositories[].harnesses |
array of enum: codex, claude, pi |
Yes | Coding agents a thread on this repository can use now, default first. A repository that isn't set up runs Codex only. |
choices.sandbox_repositories[].id |
string |
Yes | |
choices.sandbox_repositories[].name |
string |
Yes | |
choices.sandbox_repositories[].ready |
boolean |
Yes | |
threads |
object |
No | Only when conversation_id is sent; kept for Composal Desktop 0.1.24 and earlier. |
threads.archived_count |
integer,null |
No | Exact total of archived conversations for this agent, including subagents but excluding workflow task, cron and system sessions. Null or omitted when the runtime cannot establish the complete total without an unbounded archive read; never a loaded-page count. |
threads.can_create |
boolean |
Yes | |
threads.local_activities |
object |
Yes | First page only: states of local threads listed on later pages, by local thread id, so a refresh keeps paged rows current. |
threads.local_archived_count |
integer |
Yes | Local Claude Code and Codex threads archived on their computers. |
threads.local_next_cursor |
string,null |
Yes | |
threads.local_scope_key |
string,null |
Yes | |
threads.local_status_pending |
boolean |
Yes | A computer is reporting newer local thread statuses; read the page again shortly. |
threads.local_threads |
array of object |
Yes | |
threads.local_threads[].archived |
boolean |
Yes | Archived on its computer: hidden from the active list and shown with the archived threads. |
threads.local_threads[].can_archive |
boolean |
Yes | This requester can archive or restore it, and the computer's Desktop supports archiving. |
threads.local_threads[].can_disconnect_relay |
boolean |
No | |
threads.local_threads[].can_end |
boolean |
Yes | |
threads.local_threads[].can_interrupt |
boolean |
Yes | |
threads.local_threads[].can_send |
boolean |
Yes | |
threads.local_threads[].created_at |
string |
Yes | |
threads.local_threads[].device_id |
string |
Yes | |
threads.local_threads[].device_name |
string |
Yes | |
threads.local_threads[].end |
object or null |
Yes | |
threads.local_threads[].full_title |
string |
Yes | The native name or first prompt in full, for a tooltip. |
threads.local_threads[].id |
string |
Yes | |
threads.local_threads[].last_activity_at |
string,null (date-time) |
Yes | |
threads.local_threads[].native_thread_id |
string |
Yes | |
threads.local_threads[].parent_conversation_id |
string,null |
Yes | |
threads.local_threads[].provider |
enum: codex, claude |
Yes | |
threads.local_threads[].relay_disconnected_at |
string,null (date-time) |
No | |
threads.local_threads[].relay_participant |
object |
No | |
threads.local_threads[].relay_participant.aliases |
array of object |
Yes | |
threads.local_threads[].relay_participant.aliases[].creating_operation_id |
string |
Yes | Original operation that registered this alias, retained when its address is reused. Inspect with agent.rename_status. |
threads.local_threads[].relay_participant.aliases[].forward_until |
string,null |
Yes | |
threads.local_threads[].relay_participant.aliases[].name |
string |
Yes | |
threads.local_threads[].relay_participant.can_rename |
boolean |
Yes | |
threads.local_threads[].relay_participant.canonical_name |
string |
Yes | |
threads.local_threads[].relay_participant.management_actions |
array of object or object |
Yes | |
threads.local_threads[].relay_participant.name |
string |
Yes | |
threads.local_threads[].relay_participant.observation_action |
object,null |
Yes | |
threads.local_threads[].relay_participant.observation_action.arguments |
object |
Yes | |
threads.local_threads[].relay_participant.observation_action.name |
enum: agent.rename_status |
Yes | |
threads.local_threads[].relay_participant.pending_operation_id |
string,null |
Yes | |
threads.local_threads[].relay_participant.pending_retirement_id |
string,null |
Yes | |
threads.local_threads[].relay_participant.scope_key |
string |
Yes | |
threads.local_threads[].relay_participant.source_operation_id |
string |
Yes | |
threads.local_threads[].relay_participant.version |
integer |
Yes | |
threads.local_threads[].section |
enum: current, done, offline |
Yes | Server-assigned section in the ordered computer thread directory. |
threads.local_threads[].status |
enum: running, waiting, stopped, failed, done, idle, ... |
Yes | What the native thread is doing. Null until the computer reports it, or when its helper can't. Threads beyond the newest 50 keep the state from when their page loaded. |
threads.local_threads[].task_configured |
boolean |
Yes | |
threads.local_threads[].title |
string |
Yes | Short title: the native name, or the first prompt's first line without the agent's task preamble. |
threads.main_thread_id |
string |
Yes | |
threads.next_cursor |
string,null |
Yes | |
threads.selected_thread |
object or null |
Yes | |
threads.threads |
array of object |
Yes | |
threads.threads[].archive_deletes_sandbox |
boolean |
No | |
threads.threads[].archived |
boolean |
Yes | |
threads.threads[].attention |
object,null |
Yes | Why the person should open this thread: a pending question, the agent asking for attention, or a run that did not finish. |
threads.threads[].attention.kind |
enum: question, agent, failed |
Yes | |
threads.threads[].attention.text |
string |
Yes | |
threads.threads[].can_archive |
boolean |
Yes | |
threads.threads[].can_compact |
boolean |
Yes | |
threads.threads[].can_snooze |
boolean |
Yes | |
threads.threads[].coordination_status |
enum: queued, waiting, null |
No | Durable work not represented by a native run: a queued input or an outstanding thread report. |
threads.threads[].execution |
object |
No | device_folder threads also report state and path; sandbox threads run on their own machine with the coding agent in harness. |
threads.threads[].execution.base_branch |
string |
No | The branch a sandbox thread's machine cloned, when it was started from one. |
threads.threads[].execution.branch |
string |
No | The branch a sandbox thread's last workspace check saw. Absent after newer activity, until the next check. |
threads.threads[].execution.device_id |
string,null |
No | |
threads.threads[].execution.device_name |
string,null |
No | |
threads.threads[].execution.environment |
object |
No | The repository's current setup state, only for a sandbox thread that started without a ready environment. |
threads.threads[].execution.environment.can_check_branch |
boolean |
No | Whether this person can check this repository's environment recipe on a branch through Prepare. Needs a bot they manage and only they can use, in an organization with sandbox threads. Only in the repositories read. |
threads.threads[].execution.environment.can_prepare |
boolean |
Yes | Whether this person can start preparing the environment now. False while it is preparing, building or ready, unless a ready environment has a failed_update, and for people who cannot manage the bot. |
threads.threads[].execution.environment.failed_update |
object |
No | Only when ready. The repository's newest recipe on its default branch failed to build, so threads still start from the ready revision. Prepare builds it again. |
threads.threads[].execution.environment.failure_code |
string |
No | |
threads.threads[].execution.environment.revision_id |
string |
No | |
threads.threads[].execution.environment.setup |
object |
No | The latest setup run until a recipe revision exists, only when this bot ran it; other bots see the status alone. Prepare with a branch answers with the branch check it started. |
threads.threads[].execution.environment.status |
enum: none, preparing, building, failed, awaiting_trunk, unsupported, ... |
Yes | none has no recipe build yet; preparing is a setup run writing the recipe; unsupported declares something bots cannot use, such as secrets; ready is the promoted revision thread sandboxes start from. |
threads.threads[].execution.harness |
enum: codex, claude, pi |
No | |
threads.threads[].execution.kind |
enum: device_folder, sandbox |
Yes | |
threads.threads[].execution.model |
string |
No | The model a sandbox thread the agent started runs, from its recorded selection. |
threads.threads[].execution.model_label |
string |
No | The display name of model, such as Claude Opus 5.5. Name the thread's author with it, not the coding agent. |
threads.threads[].execution.path |
string |
No | |
threads.threads[].execution.repository_id |
string |
No | The repository a sandbox thread's machine clones, when it has one. |
threads.threads[].execution.repository_name |
string |
No | The name of repository_id. |
threads.threads[].execution.state |
string |
No | |
threads.threads[].group |
enum: needs, failed, working, queued, waiting, done |
Yes | Rails-owned list group, in precedence order: attention, active run, coordination custody, then done. A snoozed thread lists as done, after every other row, and never folds under Older; snoozed_until marks it. Rows retain server order; only done rows may fold under Older. |
threads.threads[].has_active_run |
boolean |
Yes | |
threads.threads[].id |
string |
Yes | |
threads.threads[].is_main |
boolean |
Yes | |
threads.threads[].kind |
enum: conversation, subagent |
Yes | |
threads.threads[].older |
boolean |
Yes | Nothing needs the person here, it is not working, and it has not changed for a day; the list folds it under Older. |
threads.threads[].parent_conversation_id |
string |
No | Source conversation to return to. |
threads.threads[].parent_conversation_title |
string |
No | Source conversation title, resolved independently of this page. |
threads.threads[].snoozed_until |
string,null (date-time) |
Yes | When a snoozed thread returns to its usual group; null when it is not snoozed. Clients list rows with this set in their own Snoozed group. |
threads.threads[].title |
string |
Yes | |
threads.threads[].updated_at |
string,null |
Yes | |
threads.total_archived_count |
integer,null |
Yes | archived_count plus local_archived_count, computed by Rails for the Archived heading. Null whenever archived_count is unknown. |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/computer
Operation ID: spark_computer_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Agent workspace
application/json
| Property | Type | Required | Description |
|---|---|---|---|
browser_egress |
object |
No | |
browser_egress.connected |
boolean |
Yes | |
browser_egress.enabled |
boolean |
Yes | |
can_control |
boolean |
Yes | Whether the viewer may control the shared computer. |
can_open_terminal |
boolean |
No | Whether the viewer may open the shared computer's terminal. |
can_start |
boolean |
Yes | |
fleet |
object |
No | |
fleet.agent_minutes_per_hour |
number |
Yes | |
fleet.agent_minutes_this_period |
number |
Yes | |
fleet.machines |
array of object |
Yes | |
fleet.machines[].cpu_count |
integer,null |
Yes | |
fleet.machines[].disk_mb |
integer,null |
Yes | |
fleet.machines[].id |
string |
Yes | |
fleet.machines[].kind |
enum: agent, thread |
Yes | |
fleet.machines[].memory_mb |
integer,null |
Yes | |
fleet.machines[].name |
string |
Yes | |
fleet.machines[].state |
enum: running, standby, starting, failed, stopped, not_started, ... |
Yes | |
fleet.machines[].threads |
array of object |
Yes | |
fleet.machines[].threads[].id |
string |
Yes | |
fleet.machines[].threads[].title |
string |
Yes | |
fleet.minute_unit |
enum: spark_2x |
No | When set, both minute fields report Spark-2x compute minutes. |
fleet.period_started_at |
string (date-time) |
Yes | |
fleet.rate_is_partial |
boolean |
No | |
fleet.running_count |
integer |
Yes | |
fleet.standby_count |
integer |
No | |
fleet.unchecked_count |
integer |
Yes | |
fleet.unknown_count |
integer |
No | |
fleet.workspace_count |
integer |
No | |
processes |
array of object |
Yes | |
processes[].id |
string |
Yes | |
processes[].name |
string |
Yes | |
processes[].started_at |
string,null |
Yes | |
processes[].status |
string |
Yes | |
state |
enum: not_started, starting, ready, failed |
Yes | |
usage |
object |
No | |
usage.memory_total_mb |
integer |
Yes | |
usage.samples |
array of object |
Yes | |
usage.samples[].at |
string (date-time) |
Yes | |
usage.samples[].cpu_percent |
number,null |
Yes | |
usage.samples[].memory_used_mb |
integer |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark
Operation ID: spark_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
Idempotency-Key |
header |
string |
No | Return the caller-scoped native input identity for delivery reconciliation. Does not confirm acceptance. |
requester_membership_id |
query |
string |
No | Original V1 input membership for ambiguous-delivery recovery. Never substitute a new membership on retry. |
cursor |
query |
string |
No | |
run_id |
query |
string |
No | |
conversation_id |
query |
string |
No |
Responses
200: Native conversation history
application/json
| Property | Type | Required | Description |
|---|---|---|---|
active_run_ids |
array of string |
No | |
can_queue_input |
boolean |
No | Current authority to admit a durable input independently of native readiness. |
can_send |
boolean |
Yes | |
conversation_id |
string |
Yes | |
default_model |
object or null |
No | Effective model reported by the native conversation, including inherited selections. Null when unavailable. |
has_active_run |
boolean |
Yes | |
input_run_id |
string |
No | Identity computed for the optional Idempotency-Key header. Does not confirm native acceptance. |
messages |
array of object |
Yes | |
messages[].created_at |
string (date-time) |
No | |
messages[].delivery |
enum: waiting |
No | Rails still holds this input for delivery. Its presence does not mean a native run has started. |
messages[].execution_run_id |
string |
No | Native execution consuming a saved user input when it differs from the accepted input run_id. Correlation only; not authorization. |
messages[].files |
array of object |
No | A user message's attached files. Images are listed here until native delivery can serve their previews. |
messages[].files[].filename |
string |
Yes | |
messages[].id |
string |
Yes | At most 256 UTF-8 bytes. |
messages[].images |
array of object |
No | |
messages[].images[].filename |
string |
Yes | |
messages[].images[].index |
integer |
Yes | |
messages[].images[].mime_type |
enum: image/png, image/jpeg, image/webp, image/gif, image/avif |
Yes | |
messages[].inherited_context |
boolean |
No | True only when native fork lineage and retained source message identity confirm copied parent context. Absent on this thread's own messages and when source history cannot be verified. |
messages[].parts |
array of object or object or object or object or object or object or object or object or object |
No | Ordered public parts, each at most 16 KiB serialized UTF-8. Both parts and schema_version are omitted on legacy or invalid rich content; text remains the inert fallback. |
messages[].relay_source |
object |
No | Server-verified native Relay notification attribution. Display metadata only; never execution authority. |
messages[].relay_source.device_name |
string |
Yes | |
messages[].relay_source.provider |
enum: codex, claude |
Yes | |
messages[].role |
enum: user, assistant, system, tool |
Yes | |
messages[].run_id |
string |
No | At most 256 UTF-8 bytes. |
messages[].schema_version |
enum: 1 |
No | Present together with parts only for valid supported rich content. |
messages[].sender |
object |
No | |
messages[].sender.avatar_url |
string,null |
No | |
messages[].sender.id |
string |
Yes | |
messages[].sender.name |
string |
Yes | |
messages[].text |
string |
Yes | Legacy display fallback; not additional content when parts are rendered. |
messages[].thread_messages |
array of object |
No | Rails-verified cross-thread attribution for display, never execution authority. Requests name the source Spark and contain only the original brief; reports name the child task and include only the delivered report version. |
messages[].thread_messages[].body |
string |
No | |
messages[].thread_messages[].href |
string |
No | |
messages[].thread_messages[].kind |
enum: message, report |
Yes | |
messages[].thread_messages[].summary |
string |
No | |
messages[].thread_messages[].thread |
object |
No | |
messages[].thread_messages[].thread.agent_id |
string |
Yes | |
messages[].thread_messages[].thread.conversation_id |
string |
Yes | |
messages[].thread_messages[].title |
string |
Yes | |
model |
object or null |
No | Effective model reported by the native conversation, including inherited selections. Null when unavailable. |
newer_cursor |
string,null |
No | |
older_cursor |
string,null |
No | |
pending_inputs |
array of object |
No | |
pending_inputs[].created_at |
string (date-time) |
No | |
pending_inputs[].delivery |
enum: waiting |
No | Rails still holds this input for delivery. Its presence does not mean a native run has started. |
pending_inputs[].execution_run_id |
string |
No | Native execution consuming a saved user input when it differs from the accepted input run_id. Correlation only; not authorization. |
pending_inputs[].files |
array of object |
No | A user message's attached files. Images are listed here until native delivery can serve their previews. |
pending_inputs[].files[].filename |
string |
Yes | |
pending_inputs[].id |
string |
Yes | At most 256 UTF-8 bytes. |
pending_inputs[].images |
array of object |
No | |
pending_inputs[].images[].filename |
string |
Yes | |
pending_inputs[].images[].index |
integer |
Yes | |
pending_inputs[].images[].mime_type |
enum: image/png, image/jpeg, image/webp, image/gif, image/avif |
Yes | |
pending_inputs[].inherited_context |
boolean |
No | True only when native fork lineage and retained source message identity confirm copied parent context. Absent on this thread's own messages and when source history cannot be verified. |
pending_inputs[].parts |
array of object or object or object or object or object or object or object or object or object |
No | Ordered public parts, each at most 16 KiB serialized UTF-8. Both parts and schema_version are omitted on legacy or invalid rich content; text remains the inert fallback. |
pending_inputs[].relay_source |
object |
No | Server-verified native Relay notification attribution. Display metadata only; never execution authority. |
pending_inputs[].relay_source.device_name |
string |
Yes | |
pending_inputs[].relay_source.provider |
enum: codex, claude |
Yes | |
pending_inputs[].role |
enum: user, assistant, system, tool |
Yes | |
pending_inputs[].run_id |
string |
No | At most 256 UTF-8 bytes. |
pending_inputs[].schema_version |
enum: 1 |
No | Present together with parts only for valid supported rich content. |
pending_inputs[].sender |
object |
No | |
pending_inputs[].sender.avatar_url |
string,null |
No | |
pending_inputs[].sender.id |
string |
Yes | |
pending_inputs[].sender.name |
string |
Yes | |
pending_inputs[].text |
string |
Yes | Legacy display fallback; not additional content when parts are rendered. |
pending_inputs[].thread_messages |
array of object |
No | Rails-verified cross-thread attribution for display, never execution authority. Requests name the source Spark and contain only the original brief; reports name the child task and include only the delivered report version. |
pending_inputs[].thread_messages[].body |
string |
No | |
pending_inputs[].thread_messages[].href |
string |
No | |
pending_inputs[].thread_messages[].kind |
enum: message, report |
Yes | |
pending_inputs[].thread_messages[].summary |
string |
No | |
pending_inputs[].thread_messages[].thread |
object |
No | |
pending_inputs[].thread_messages[].thread.agent_id |
string |
Yes | |
pending_inputs[].thread_messages[].thread.conversation_id |
string |
Yes | |
pending_inputs[].thread_messages[].title |
string |
Yes | |
pending_question |
object or null |
No | The question this conversation's agent is waiting on, asked with ask_user. |
requester_membership_id |
string,null |
No | Current authenticated membership offered for new V1 inputs. Does not authorize execution. |
run |
object or null |
No | |
stopped_runs |
array of object |
No | On the main conversation's latest page, the viewer's notices of this agent's workflow runs that stopped without finishing, newest first. |
stopped_runs[].id |
string |
Yes | The notice, which the workspace activity dismissal endpoint dismisses. |
stopped_runs[].message |
string |
Yes | One line naming the workflow and why it stopped. |
stopped_runs[].occurred_at |
string (date-time) |
Yes | |
stopped_runs[].run |
object |
Yes | |
stopped_runs[].run.action |
enum: run, resume |
Yes | |
stopped_runs[].run.automation |
object |
No | Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs. |
stopped_runs[].run.automation.id |
string |
Yes | |
stopped_runs[].run.automation.key |
string |
Yes | |
stopped_runs[].run.automation.name |
string |
Yes | |
stopped_runs[].run.automation.version |
integer |
Yes | |
stopped_runs[].run.automation.version_id |
string |
Yes | |
stopped_runs[].run.budget_seconds |
integer |
Yes | The run stops once it has been running this long |
stopped_runs[].run.budget_usd |
number |
Yes | The run stops before a step once it has spent this much |
stopped_runs[].run.can_answer |
boolean |
Yes | Whether this viewer can answer the step that stopped the run; the answer runs that step again |
stopped_runs[].run.can_approve |
boolean |
Yes | Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one |
stopped_runs[].run.can_dismiss |
boolean |
Yes | Whether this viewer can dismiss the run waiting for them, which ends it unanswered |
stopped_runs[].run.checkpoint |
object |
Yes | The question a run waiting at a checkpoint is asking |
stopped_runs[].run.checkpoint.kind |
enum: approval, input |
Yes | |
stopped_runs[].run.checkpoint.preview |
string |
No | The checkpoint evidence shown to the person, bounded to 16 KiB. |
stopped_runs[].run.checkpoint.prompt |
string |
Yes | |
stopped_runs[].run.checkpoint.step_id |
string |
No | The id of the workflow file's step the run waits at, when the worker could tell |
stopped_runs[].run.conversation_id |
string,null |
Yes | The thread the run works in, which the person opens to follow it |
stopped_runs[].run.error |
string |
Yes | |
stopped_runs[].run.finished_at |
string |
Yes | |
stopped_runs[].run.id |
string |
Yes | Public run ID. Saved Temporal automations use the swr_ prefix. Previously issued IDs still resolve. |
stopped_runs[].run.needs_you |
boolean |
Yes | Whether a step stopped the run for the person, who can answer it |
stopped_runs[].run.note |
string |
Yes | One sentence a workflow step left for the person, which the run's card leads with |
stopped_runs[].run.resume_count |
integer |
Yes | How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint |
stopped_runs[].run.running_seconds |
integer |
Yes | How long the run has been running, not counting time waiting at a checkpoint or for a retry |
stopped_runs[].run.source |
enum: chat, event, schedule, manual |
Yes | |
stopped_runs[].run.spent_tokens |
integer |
Yes | The tokens the run's agent steps have used so far |
stopped_runs[].run.spent_usd |
number |
Yes | What the run's agent steps have cost so far, as the agent reported it |
stopped_runs[].run.stalled |
boolean |
Yes | Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back |
stopped_runs[].run.started_at |
string |
Yes | |
stopped_runs[].run.started_by |
object |
Yes | The event that started the run |
stopped_runs[].run.started_by.kind |
string |
Yes | |
stopped_runs[].run.started_by.reference |
string |
Yes | |
stopped_runs[].run.started_by.source |
string |
Yes | |
stopped_runs[].run.started_by.title |
string |
Yes | |
stopped_runs[].run.status |
enum: running, succeeded, blocked, sleeping, step_failed, failed, ... |
Yes | |
stopped_runs[].run.step_count |
integer |
Yes | |
stopped_runs[].run.trigger_id |
string |
Yes | The run settings that started it, for a run an event or schedule started |
stopped_runs[].run.wake_at |
string |
Yes | When a sleeping run's step looks again |
stopped_runs[].run.workflow_digest |
string |
Yes | SHA-256 of the immutable definition this run uses |
stopped_runs[].run.workflow_path |
string |
Yes | |
supports_browser_context |
boolean |
No | |
thread |
object |
No | |
thread.archive_deletes_sandbox |
boolean |
No | |
thread.archived |
boolean |
Yes | |
thread.attention |
object,null |
Yes | Why the person should open this thread: a pending question, the agent asking for attention, or a run that did not finish. |
thread.attention.kind |
enum: question, agent, failed |
Yes | |
thread.attention.text |
string |
Yes | |
thread.can_archive |
boolean |
Yes | |
thread.can_compact |
boolean |
Yes | |
thread.can_snooze |
boolean |
Yes | |
thread.coordination_status |
enum: queued, waiting, null |
No | Durable work not represented by a native run: a queued input or an outstanding thread report. |
thread.execution |
object |
No | device_folder threads also report state and path; sandbox threads run on their own machine with the coding agent in harness. |
thread.execution.base_branch |
string |
No | The branch a sandbox thread's machine cloned, when it was started from one. |
thread.execution.branch |
string |
No | The branch a sandbox thread's last workspace check saw. Absent after newer activity, until the next check. |
thread.execution.device_id |
string,null |
No | |
thread.execution.device_name |
string,null |
No | |
thread.execution.environment |
object |
No | The repository's current setup state, only for a sandbox thread that started without a ready environment. |
thread.execution.environment.can_check_branch |
boolean |
No | Whether this person can check this repository's environment recipe on a branch through Prepare. Needs a bot they manage and only they can use, in an organization with sandbox threads. Only in the repositories read. |
thread.execution.environment.can_prepare |
boolean |
Yes | Whether this person can start preparing the environment now. False while it is preparing, building or ready, unless a ready environment has a failed_update, and for people who cannot manage the bot. |
thread.execution.environment.failed_update |
object |
No | Only when ready. The repository's newest recipe on its default branch failed to build, so threads still start from the ready revision. Prepare builds it again. |
thread.execution.environment.failed_update.failure_code |
string |
No | |
thread.execution.environment.failed_update.revision_id |
string |
Yes | |
thread.execution.environment.failure_code |
string |
No | |
thread.execution.environment.revision_id |
string |
No | |
thread.execution.environment.setup |
object |
No | The latest setup run until a recipe revision exists, only when this bot ran it; other bots see the status alone. Prepare with a branch answers with the branch check it started. |
thread.execution.environment.setup.branch |
string |
No | The branch a check builds and proves. Only in the answer to the Prepare that started the check; the repositories read never shows a check. |
thread.execution.environment.setup.conversation_id |
string |
No | The setup or check thread's conversation, once it started |
thread.execution.environment.setup.failed_step |
string |
No | |
thread.execution.environment.setup.failure_reason |
string |
No | |
thread.execution.environment.setup.pull_request_url |
string |
No | |
thread.execution.environment.status |
enum: none, preparing, building, failed, awaiting_trunk, unsupported, ... |
Yes | none has no recipe build yet; preparing is a setup run writing the recipe; unsupported declares something bots cannot use, such as secrets; ready is the promoted revision thread sandboxes start from. |
thread.execution.harness |
enum: codex, claude, pi |
No | |
thread.execution.kind |
enum: device_folder, sandbox |
Yes | |
thread.execution.model |
string |
No | The model a sandbox thread the agent started runs, from its recorded selection. |
thread.execution.model_label |
string |
No | The display name of model, such as Claude Opus 5.5. Name the thread's author with it, not the coding agent. |
thread.execution.path |
string |
No | |
thread.execution.repository_id |
string |
No | The repository a sandbox thread's machine clones, when it has one. |
thread.execution.repository_name |
string |
No | The name of repository_id. |
thread.execution.state |
string |
No | |
thread.group |
enum: needs, failed, working, queued, waiting, done |
Yes | Rails-owned list group, in precedence order: attention, active run, coordination custody, then done. A snoozed thread lists as done, after every other row, and never folds under Older; snoozed_until marks it. Rows retain server order; only done rows may fold under Older. |
thread.has_active_run |
boolean |
Yes | |
thread.id |
string |
Yes | |
thread.is_main |
boolean |
Yes | |
thread.kind |
enum: conversation, subagent |
Yes | |
thread.older |
boolean |
Yes | Nothing needs the person here, it is not working, and it has not changed for a day; the list folds it under Older. |
thread.parent_conversation_id |
string |
No | Source conversation to return to. |
thread.parent_conversation_title |
string |
No | Source conversation title, resolved independently of this page. |
thread.snoozed_until |
string,null (date-time) |
Yes | When a snoozed thread returns to its usual group; null when it is not snoozed. Clients list rows with this set in their own Snoozed group. |
thread.title |
string |
Yes | |
thread.updated_at |
string,null |
Yes | |
waiting_runs |
array of object |
No | On the main conversation's latest page, the agent's workflow runs a step stopped for the person. |
waiting_runs[].action |
enum: run, resume |
Yes | |
waiting_runs[].automation |
object |
No | Saved native automation identity. Name is its current catalog name; version identifies the immutable definition this run uses. Null for legacy runs. |
waiting_runs[].automation.id |
string |
Yes | |
waiting_runs[].automation.key |
string |
Yes | |
waiting_runs[].automation.name |
string |
Yes | |
waiting_runs[].automation.version |
integer |
Yes | |
waiting_runs[].automation.version_id |
string |
Yes | |
waiting_runs[].budget_seconds |
integer |
Yes | The run stops once it has been running this long |
waiting_runs[].budget_usd |
number |
Yes | The run stops before a step once it has spent this much |
waiting_runs[].can_answer |
boolean |
Yes | Whether this viewer can answer the step that stopped the run; the answer runs that step again |
waiting_runs[].can_approve |
boolean |
Yes | Whether this viewer can approve or decline the checkpoint the run waits at; only a person can approve one |
waiting_runs[].can_dismiss |
boolean |
Yes | Whether this viewer can dismiss the run waiting for them, which ends it unanswered |
waiting_runs[].checkpoint |
object |
Yes | The question a run waiting at a checkpoint is asking |
waiting_runs[].checkpoint.kind |
enum: approval, input |
Yes | |
waiting_runs[].checkpoint.preview |
string |
No | The checkpoint evidence shown to the person, bounded to 16 KiB. |
waiting_runs[].checkpoint.prompt |
string |
Yes | |
waiting_runs[].checkpoint.step_id |
string |
No | The id of the workflow file's step the run waits at, when the worker could tell |
waiting_runs[].conversation_id |
string,null |
Yes | The thread the run works in, which the person opens to follow it |
waiting_runs[].error |
string |
Yes | |
waiting_runs[].finished_at |
string |
Yes | |
waiting_runs[].id |
string |
Yes | Public run ID. Saved Temporal automations use the swr_ prefix. Previously issued IDs still resolve. |
waiting_runs[].needs_you |
boolean |
Yes | Whether a step stopped the run for the person, who can answer it |
waiting_runs[].note |
string |
Yes | One sentence a workflow step left for the person, which the run's card leads with |
waiting_runs[].resume_count |
integer |
Yes | How many times the run went on from a checkpoint; it tells one pause from the next, even at the same checkpoint |
waiting_runs[].running_seconds |
integer |
Yes | How long the run has been running, not counting time waiting at a checkpoint or for a retry |
waiting_runs[].source |
enum: chat, event, schedule, manual |
Yes | |
waiting_runs[].spent_tokens |
integer |
Yes | The tokens the run's agent steps have used so far |
waiting_runs[].spent_usd |
number |
Yes | What the run's agent steps have cost so far, as the agent reported it |
waiting_runs[].stalled |
boolean |
Yes | Whether a running run has had no sign of its worker for five minutes; it continues if the worker comes back |
waiting_runs[].started_at |
string |
Yes | |
waiting_runs[].started_by |
object |
Yes | The event that started the run |
waiting_runs[].started_by.kind |
string |
Yes | |
waiting_runs[].started_by.reference |
string |
Yes | |
waiting_runs[].started_by.source |
string |
Yes | |
waiting_runs[].started_by.title |
string |
Yes | |
waiting_runs[].status |
enum: running, succeeded, blocked, sleeping, step_failed, failed, ... |
Yes | |
waiting_runs[].step_count |
integer |
Yes | |
waiting_runs[].trigger_id |
string |
Yes | The run settings that started it, for a run an event or schedule started |
waiting_runs[].wake_at |
string |
Yes | When a sleeping run's step looks again |
waiting_runs[].workflow_digest |
string |
Yes | SHA-256 of the immutable definition this run uses |
waiting_runs[].workflow_path |
string |
Yes |
401: Unauthorized
403: Agent access or experiment gate unavailable
404: Authorized V2 agent not found
422: Unprocessable entity
502: Bad gateway
503: Agent connection unavailable; a submission may already have reached native custody. Preserve its input key
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: deploy_draining, gateway_starting, transport_timeout, gateway_failed |
Yes | |
correlation_id |
string |
Yes | |
error |
string |
Yes | |
retry_after |
integer |
Yes |
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/email
Operation ID: spark_email_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: The agent's inbox
application/json
| Property | Type | Required | Description |
|---|---|---|---|
address |
string |
Yes | |
has_more |
boolean |
Yes | Older mail exists beyond this page |
messages |
array of object |
Yes |
401: Unauthorized
403: Not allowed to read this agent's mail
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/environment
Operation ID: spark_environment_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Agent environment metadata; values are never returned
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
variables |
array of object |
Yes | |
variables[].name |
string |
Yes | |
variables[].setup_only |
boolean |
Yes | Only a sandbox thread's setup commands receive this variable. |
version |
integer |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/github_access
Operation ID: spark_github_access_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: The saved choice and the identity in use
application/json
| Property | Type | Required | Description |
|---|---|---|---|
acting_as |
enum: app, owner |
Yes | Whose identity server-side GitHub requests use now. owner needs the saved choice, a private agent and a usable GitHub user authorization. |
acting_login |
string,null |
Yes | The GitHub login requests appear under while acting as the owner. |
can_act_as_owner |
boolean |
Yes | |
can_change_github_access |
boolean |
Yes | |
github_access |
enum: app, owner |
Yes | The saved choice. owner means act as the agent's owner on GitHub. |
needs_github_link |
boolean |
Yes | |
needs_github_relink |
boolean |
Yes | |
restriction |
enum: not_owner, shared, null |
Yes | Why the viewer cannot turn acting as the owner on; null when they can. |
401: Unauthorized
403: Agent access required
404: Agent not found or disabled
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/library
Operation ID: spark_library_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
cursor |
query |
string |
No | |
limit |
query |
integer |
No |
Responses
200: Agent sidebar response
application/json
| Property | Type | Required | Description |
|---|---|---|---|
items |
array of object |
Yes | |
items[].byte_size |
integer |
Yes | |
items[].checksum_sha256 |
string |
Yes | |
items[].content_type |
string |
Yes | |
items[].created_at |
string |
Yes | |
items[].download_url |
string |
Yes | |
items[].filename |
string |
Yes | |
items[].id |
string |
Yes | |
items[].title |
string |
Yes | |
pagination |
object |
Yes | |
pagination.limit |
integer |
Yes | |
pagination.next |
string |
No |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/lifecycle
Operation ID: spark_lifecycle_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Native agent lifecycle response
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
compaction |
object |
Yes | |
compaction.mode |
string |
Yes | |
heartbeat |
object |
Yes | |
heartbeat.enabled |
boolean |
Yes | |
heartbeat.interval_minutes |
number,null |
Yes | |
heartbeat.last_run_at |
string |
Yes | |
heartbeat.last_status |
string |
Yes | |
memory |
object |
Yes | |
memory.provider |
string |
Yes | |
memory.remember_across_conversations |
boolean |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/runtime
Operation ID: spark_runtime_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Agent sandbox resources
application/json
| Property | Type | Required | Description |
|---|---|---|---|
available_profiles |
array of enum: development, desktop, macos |
No | |
can_manage |
boolean |
Yes | |
can_reset |
boolean |
No | |
image |
string |
Yes | |
memory_mb |
integer,null |
Yes | |
platform |
enum: linux, macos |
No | |
profile |
enum: development, desktop, custom, macos |
Yes | |
provider |
enum: blaxel, namespace, freestyle, exe_dev, superserve, e2b, ... |
No | |
state |
string |
Yes | |
version |
string |
Yes | |
volume |
object,null |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/sandbox
Operation ID: spark_sandbox_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Sandbox configuration
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
integrations |
array of object |
Yes | |
integrations[].configuration |
object |
Yes | |
integrations[].enabled |
boolean |
Yes | |
integrations[].id |
string |
Yes | |
integrations[].name |
string |
Yes | |
integrations[].provider |
enum: namespace, freestyle, exe_dev, superserve, e2b, daytona, ... |
Yes | |
integrations[].version |
integer |
Yes | |
selection |
object |
Yes | |
selection.generation |
integer |
Yes | |
selection.integration_id |
string or null |
Yes | |
selection.provider |
string |
Yes | |
selection.remote_id |
string or null |
Yes | |
selection.status |
string |
Yes | |
selection.workspace_key |
string |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/debug
Operation ID: spark_debug_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
conversation_id |
query |
string |
No |
Responses
200: Superadmin debug facts beside one conversation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
controller |
object |
No | |
controller.finished_at |
string (date-time) |
No | |
controller.image |
string |
No | |
conversation_id |
string |
Yes | |
events |
array of object |
Yes | |
events[].boot_id |
string |
No | |
events[].error |
string |
No | |
events[].occurred_at |
string (date-time) |
Yes | |
events[].run_id |
string |
No | |
events[].status |
string |
No | |
events[].stop_reason |
string |
No | |
events[].type |
enum: gateway_started, run_ended |
Yes | |
generated_at |
string (date-time) |
Yes | |
release |
object |
No | |
release.bridge_image |
string |
No | |
release.controller_image |
string |
No | |
release.native_image |
string |
No | |
release.source_sha |
string |
No | |
release.status |
string |
No | |
runtime |
object |
No | |
runtime.error_code |
string |
No | |
runtime.generation |
integer |
No | |
runtime.image |
string |
No | |
runtime.native_ready |
boolean |
No | |
runtime.observed_at |
string (date-time) |
No | |
runtime.observed_revision_id |
string |
No | |
runtime.observed_state |
string |
No | |
runtime.pinned_image |
string |
No | |
runtime.selected_revision_id |
string |
No | |
runtime.status |
string |
No | |
session |
object |
No | |
session.diagnostics |
object |
No | |
session.diagnostics.contextUsedFresh |
boolean |
No | |
session.diagnostics.contextUsedTokens |
integer |
No | |
session.diagnostics.contextWindowTokens |
integer |
No | |
session.diagnostics.lastRunError |
string |
No | |
session.diagnostics.lastRunId |
string |
No | |
session.diagnostics.model |
string |
No | |
session.diagnostics.modelProvider |
string |
No | |
session.diagnostics.status |
string |
No | |
session.error |
string |
No | |
session.model |
string |
No |
401: Unauthorized
403: Only superadmins can read debug facts
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/mission_control_card
Operation ID: spark_mission_control_card_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
conversation_id |
query |
string |
No |
Responses
200: Validated card, or a safe text fallback while the worker generates it
application/json
| Property | Type | Required | Description |
|---|---|---|---|
card |
object |
Yes | |
card.actions |
array of string |
Yes | |
card.checks |
array of object |
Yes | |
card.checks[].label |
string |
Yes | |
card.checks[].state |
enum: pending, passed, failed |
Yes | |
card.image |
object or null |
Yes | |
card.link |
object or null |
Yes | |
card.text |
string |
Yes | |
card.type |
enum: text, checklist, status, diff/link, image, none |
Yes | |
event_id |
string,null |
Yes | |
status |
enum: ready, pending, empty |
Yes |
401: Authentication required
403: Thread is not readable
404: Agent not found
422: Unprocessable entity
429: Read limit reached
502: Bad gateway
503: Thread history unavailable
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/relay/activity
Operation ID: spark_relay_activity_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
kind |
query |
enum: native, relay |
No | |
cursor |
query |
string |
No | |
limit |
query |
integer |
No |
Responses
200: Bounded receipt metadata without copied prompts or results
application/json
| Property | Type | Required | Description |
|---|---|---|---|
activity |
object |
Yes | |
activity.items |
array of object |
Yes | |
activity.items[].action |
string |
Yes | |
activity.items[].created_at |
string (date-time) |
Yes | |
activity.items[].device_id |
string,null |
Yes | |
activity.items[].device_name |
string,null |
Yes | |
activity.items[].id |
string |
Yes | |
activity.items[].kind |
enum: native, relay |
Yes | |
activity.items[].provider |
enum: codex, claude, computer, null |
Yes | |
activity.items[].result_expired |
boolean |
Yes | |
activity.items[].state |
enum: queued, claimed, completed, failed, expired, uncertain, ... |
Yes | |
activity.items[].status_label |
string |
Yes | |
activity.items[].updated_at |
string (date-time) |
Yes | |
activity.kind |
enum: native, relay |
Yes | |
activity.next_cursor |
string,null |
Yes |
401: Authentication required
403: Current requester access is required
404: Agent or activity cursor unavailable
422: Invalid activity selection
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/run_usage
Operation ID: spark_run_usage_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
window |
query |
enum: 7d, 30d |
No |
Responses
200: What the agent's runs used over the window, subagents' included
application/json
| Property | Type | Required | Description |
|---|---|---|---|
by_scope |
array of object |
Yes | Each kind of session that ran: the main conversation, threads, subagents and background work such as workflow steps. |
by_scope[].cost_complete |
boolean |
Yes | False when a model had no list price or a call's counts were not reported in full, so the cost is a floor. |
by_scope[].estimated_cost_usd |
number |
Yes | At list prices when each run ended, also for runs a person's own subscription paid for. |
by_scope[].failed_runs |
integer |
Yes | |
by_scope[].runs |
integer |
Yes | |
by_scope[].scope |
enum: main, thread, subagent, background |
Yes | |
daily |
array of object |
Yes | Every day of the window, oldest first, including days with no runs. |
daily[].date |
string (date) |
Yes | |
daily[].estimated_cost_usd |
number |
Yes | |
daily[].failed_runs |
integer |
Yes | |
daily[].runs |
integer |
Yes | |
models |
array of object |
Yes | Models by cost, most first. |
models[].cost_complete |
boolean |
Yes | False when a model had no list price or a call's counts were not reported in full, so the cost is a floor. |
models[].estimated_cost_usd |
number |
Yes | At list prices when each run ended, also for runs a person's own subscription paid for. |
models[].model |
string |
Yes | |
models[].model_calls |
integer |
Yes | |
models[].provider |
string |
Yes | |
totals |
object |
Yes | |
totals.cache_creation_input_tokens |
integer |
Yes | |
totals.cache_read_input_tokens |
integer |
Yes | |
totals.cost_complete |
boolean |
Yes | False when a model had no list price or a call's counts were not reported in full, so the cost is a floor. |
totals.estimated_cost_usd |
number |
Yes | At list prices when each run ended, also for runs a person's own subscription paid for. |
totals.failed_runs |
integer |
Yes | Runs whose last attempt failed. |
totals.input_tokens |
integer |
Yes | |
totals.output_tokens |
integer |
Yes | |
totals.runs |
integer |
Yes | |
totals.tool_calls |
integer |
Yes | |
window |
enum: 7d, 30d |
Yes |
400: Unknown window
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/usage
Operation ID: spark_usage_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
conversation_id |
query |
string |
No |
Responses
200: Selected private agent subscription quota and conversation usage
application/json
| Property | Type | Required | Description |
|---|---|---|---|
session |
object |
Yes | |
session.cache_read_tokens |
integer,null |
Yes | |
session.cache_write_tokens |
integer,null |
Yes | |
session.input_tokens |
integer,null |
Yes | |
session.models |
array of object |
Yes | |
session.models[].cache_read_tokens |
integer,null |
Yes | |
session.models[].input_tokens |
integer,null |
Yes | |
session.models[].model |
string,null |
Yes | |
session.models[].output_tokens |
integer,null |
Yes | |
session.models[].provider |
string,null |
Yes | |
session.output_tokens |
integer,null |
Yes | |
session.partial |
boolean |
Yes | |
session.status |
enum: available, unavailable |
Yes | |
subscription |
object |
Yes | |
subscription.plan |
string,null |
Yes | |
subscription.provider_name |
string,null |
Yes | |
subscription.status |
enum: available, unavailable, not_connected |
Yes | |
subscription.updated_at |
string,null |
Yes | |
subscription.windows |
array of object |
Yes | |
subscription.windows[].group_label |
string,null |
Yes | |
subscription.windows[].label |
string |
Yes | |
subscription.windows[].resets_at |
string,null |
Yes | |
subscription.windows[].used_percent |
number |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
remove
DELETE /api/v1/organizations/{organization_id}/agents/{id}
Operation ID: delete_api_v1_organizations_organization_id_agents_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes |
Responses
200: Success
application/json
The response is object.
204: Agent removed; runtime revocation queued
401: Authentication required
403: Current private-agent management authority required
404: Organization or authorized agent not found
409: Version or idempotency conflict; reload before starting a new operation
422: Invalid configuration or operation
502: Bad gateway
update
PATCH /api/v1/organizations/{organization_id}/agents/{id}/spark/environment
Operation ID: patch_api_v1_organizations_organization_id_agents_id_spark_environment.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes | |
name |
string |
Yes | |
setup_only |
boolean |
No | |
value |
string,null |
No |
Responses
200: Agent environment metadata; values are never returned
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
variables |
array of object |
Yes | |
variables[].name |
string |
Yes | |
variables[].setup_only |
boolean |
Yes | Only a sandbox thread's setup commands receive this variable. |
version |
integer |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
PUT /api/v1/organizations/{organization_id}/agents/{id}/spark/github_access
Operation ID: put_api_v1_organizations_organization_id_agents_id_spark_github_access.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
github_access |
enum: app, owner |
Yes |
Responses
200: The saved choice and the identity in use
application/json
| Property | Type | Required | Description |
|---|---|---|---|
acting_as |
enum: app, owner |
Yes | Whose identity server-side GitHub requests use now. owner needs the saved choice, a private agent and a usable GitHub user authorization. |
acting_login |
string,null |
Yes | The GitHub login requests appear under while acting as the owner. |
can_act_as_owner |
boolean |
Yes | |
can_change_github_access |
boolean |
Yes | |
github_access |
enum: app, owner |
Yes | The saved choice. owner means act as the agent's owner on GitHub. |
needs_github_link |
boolean |
Yes | |
needs_github_relink |
boolean |
Yes | |
restriction |
enum: not_owner, shared, null |
Yes | Why the viewer cannot turn acting as the owner on; null when they can. |
401: Unauthorized
403: Only the owner of the agent can change it
404: Agent not found or disabled
422: The agent is shared or the owner has not linked GitHub
502: Bad gateway
PATCH /api/v1/organizations/{organization_id}/agents/{id}/spark/model
Operation ID: spark_model_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
model |
string |
Yes | |
provider |
string |
Yes | |
reasoning |
string,null |
No | One of the model's reasoning levels in the Composal catalog. Omit or null for the runtime default. |
Responses
200: Saved agent model
application/json
| Property | Type | Required | Description |
|---|---|---|---|
model |
string |
Yes | |
provider |
string |
Yes | |
reasoning |
string,null |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
PATCH /api/v1/organizations/{organization_id}/agents/{id}/rename
Operation ID: rename_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes | |
name |
string |
Yes |
Responses
200: Renamed agent with current permissions and version
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agent |
object and object |
Yes |
401: Authentication required
403: Current private-agent management authority required
404: Organization or authorized agent not found
409: Version or idempotency conflict; reload before starting a new operation
422: Invalid configuration or operation
502: Bad gateway
503: Agent state temporarily unavailable. Read the agent before retrying with its current sharing_version; an already-applied rename will conflict with the old expected_version
PATCH /api/v1/organizations/{organization_id}/agents/{id}/roster_position
Operation ID: roster_position_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
The request body is object or object.
Responses
200: Success
application/json
The response is object.
204: Order saved
401: Authentication required
403: Forbidden
404: Organization or authorized agent not found
422: Invalid move, or the viewer is not a workspace member
502: Bad gateway
PATCH /api/v1/organizations/{organization_id}/agents/{id}/spark/runtime
Operation ID: patch_api_v1_organizations_organization_id_agents_id_spark_runtime.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
acknowledge_reset |
boolean |
Yes | |
expected_version |
string |
Yes | |
memory_mb |
integer |
Yes | |
profile |
enum: development, desktop, macos |
No |
Responses
200: Agent sandbox resources
application/json
| Property | Type | Required | Description |
|---|---|---|---|
available_profiles |
array of enum: development, desktop, macos |
No | |
can_manage |
boolean |
Yes | |
can_reset |
boolean |
No | |
image |
string |
Yes | |
memory_mb |
integer,null |
Yes | |
platform |
enum: linux, macos |
No | |
profile |
enum: development, desktop, custom, macos |
Yes | |
provider |
enum: blaxel, namespace, freestyle, exe_dev, superserve, e2b, ... |
No | |
state |
string |
Yes | |
version |
string |
Yes | |
volume |
object,null |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
PUT /api/v1/organizations/{organization_id}/agents/{id}/spark/sandbox
Operation ID: put_api_v1_organizations_organization_id_agents_id_spark_sandbox.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_generation |
integer |
Yes | |
integration_id |
string or null |
Yes |
Responses
200: Sandbox configuration
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
integrations |
array of object |
Yes | |
integrations[].configuration |
object |
Yes | |
integrations[].enabled |
boolean |
Yes | |
integrations[].id |
string |
Yes | |
integrations[].name |
string |
Yes | |
integrations[].provider |
enum: namespace, freestyle, exe_dev, superserve, e2b, daytona, ... |
Yes | |
integrations[].version |
integer |
Yes | |
selection |
object |
Yes | |
selection.generation |
integer |
Yes | |
selection.integration_id |
string or null |
Yes | |
selection.provider |
string |
Yes | |
selection.remote_id |
string or null |
Yes | |
selection.status |
string |
Yes | |
selection.workspace_key |
string |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
PATCH /api/v1/organizations/{organization_id}/agents/{id}/sharing
Operation ID: sharing_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes | |
keep_connections |
array of object |
No | With organization visibility only. Accounts the agent used automatically while private that it keeps using once shared, chosen in the same transaction. Every other automatic account stops, including grants saved for it while the agent was shared before. Each account is chosen under the usual rules, so only its holder can keep a personal account. |
keep_connections[].generation |
integer |
Yes | |
keep_connections[].id |
string |
Yes | |
revoke_access |
boolean |
No | Owner only. Requires private visibility and removes all other individual access grants. |
team_role |
enum: manager, collaborator |
No | With organization visibility only, and not for Project agents. What teammates may do. Sharing a private agent makes them collaborators unless this says otherwise. Changing it on an agent already shared needs the owner or a named manager. |
visibility |
enum: private, organization |
Yes |
Responses
200: Agent with current sharing and permissions
application/json
| Property | Type | Required | Description |
|---|---|---|---|
agent |
object and object |
Yes |
401: Authentication required
403: Current private-agent management authority required
404: Organization or authorized agent not found
409: Version or idempotency conflict; reload before starting a new operation
422: Invalid configuration or operation
502: Bad gateway
503: Private Git state unavailable. Retry the same Idempotency-Key and unchanged body
PUT /api/v1/organizations/{organization_id}/agents/{id}/spark/thread_model
Operation ID: put_api_v1_organizations_organization_id_agents_id_spark_thread_model.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
conversation_id |
string |
Yes | |
model |
string,null |
Yes |
Responses
200: Updated thread model
application/json
| Property | Type | Required | Description |
|---|---|---|---|
choices |
array of object |
Yes | |
choices[].label |
string |
Yes | |
choices[].model |
string |
Yes | |
inherit_main |
boolean |
Yes | |
model |
string,null |
Yes |