API

SparkAgentLocalThread

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads create Authorized native session adoption receipt
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id} load Authorized local coding-agent thread
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}/delivery_policy load Original requester-scoped Relay delivery consent
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}/task load Current authorized native task result receipts
PUT /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}/delivery_policy update Original requester-scoped Relay delivery consent

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:

spark_agent_local_thread, err := client.SparkAgentLocalThread(nil).Load(map[string]any{"agent_id": "example", "id": "example_id", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(spark_agent_local_thread)
created, err := client.SparkAgentLocalThread(nil).Create(map[string]any{"agent_id": "example", "organization_id": "example", "device_id": "example", "key": "example", "provider": "example", "thread_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local spark_agent_local_thread, err = client:SparkAgentLocalThread():load({ agent_id = "example", id = "example_id", organization_id = "example" })
local created, err = client:SparkAgentLocalThread():create({ agent_id = "example", organization_id = "example", device_id = "example", key = "example", provider = "example", thread_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$spark_agent_local_thread = $client->SparkAgentLocalThread()->load(["agent_id" => "example", "id" => "example_id", "organization_id" => "example"]);
$created = $client->SparkAgentLocalThread()->create(["agent_id" => "example", "organization_id" => "example", "device_id" => "example", "key" => "example", "provider" => "example", "thread_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

spark_agent_local_thread = client.SparkAgentLocalThread().load({"agent_id": "example", "id": "example_id", "organization_id": "example"})
created = client.SparkAgentLocalThread().create({ "agent_id": "example", "organization_id": "example", "device_id": "example", "key": "example", "provider": "example", "thread_id": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

spark_agent_local_thread = client.SparkAgentLocalThread.load({ "agent_id" => "example", "id" => "example_id", "organization_id" => "example" })
created = client.SparkAgentLocalThread.create({ "agent_id" => "example", "organization_id" => "example", "device_id" => "example", "key" => "example", "provider" => "example", "thread_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const spark_agent_local_thread = await client.SparkAgentLocalThread().load({ agent_id: "example", id: "example_id", organization_id: "example" })
const created = await client.SparkAgentLocalThread().create({ agent_id: "example", organization_id: "example", device_id: "example", key: "example", provider: "example", thread_id: "example" })

Fields

Field Type Required Description
action string Yes Action
archived boolean Yes Archived on its computer: hidden from the active list and shown with the archived threads.
can_archive boolean Yes This requester can archive or restore it, and the computer's Desktop supports archiving.
can_disconnect_relay boolean No Can Disconnect Relay
can_end boolean Yes Can End
can_interrupt boolean Yes Can Interrupt
can_send boolean Yes Can Send
created_at string Yes Created At
delivery object No Present while a request waits on an offline computer and after it expires unclaimed: whether the computer is checking for requests and when it last did.
device_id string Yes Device Id
device_name string Yes Device Name
diagnostic_code string No Approved product error code retained after copied diagnostics expire.
end any Yes End
expires_at string Yes Expires At
full_title string Yes The native name or first prompt in full, for a tooltip.
id string Yes Id
key string Yes Key
last_activity_at one,string,null Yes Last Activity At
native_thread_id string Yes Native Thread Id
parent_conversation_id one,string,null Yes Parent Conversation Id
provider string Yes Provider
references object Yes References
relay_disconnected_at one,string,null No Relay Disconnected At
relay_participant object No Relay Participant
result any Yes Result
result_expired boolean Yes Private cached prompts/results expire after one hour; intent digests and native references remain as replay fences.
result_schema one,object,boolean No Result Schema
section string Yes Server-assigned section in the ordered computer thread directory.
state string Yes State
status one,string,null Yes What the native thread is doing.
task_configured boolean Yes Task Configured
thread_id string Yes Thread Id
title string Yes Short title: the native name, or the first prompt's first line without the agent's task preamble.

create

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads

Operation ID: spark_local_threads_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
device_id string Yes
key string Yes
provider enum: codex, claude Yes
result_schema object,boolean No
thread_id string Yes

Responses

202: Authorized native session adoption receipt

application/json

Property Type Required Description
operation object Yes
operation.action enum: agents.list, threads.list, threads.read, threads.start, threads.adopt, threads.release, ... Yes
operation.created_at string (date-time) Yes
operation.delivery object No Present while a request waits on an offline computer and after it expires unclaimed: whether the computer is checking for requests and when it last did.
operation.delivery.last_seen_at string,null (date-time) Yes
operation.delivery.message string Yes
operation.delivery.status enum: connected, offline, unknown Yes
operation.device_id string Yes
operation.diagnostic_code enum: active_turn, adoption_not_applied, claude_unavailable, codex_custody_unconfirmed, codex_preparation_failed, codex_thread_busy, ... No Approved product error code retained after copied diagnostics expire. Absent for success, unknown codes and older cleared receipts; it does not reconcile uncertain delivery.
operation.end object No
operation.end.can_dismiss boolean Yes Durable permission to dismiss this End receipt after safe refusal, unclaimed expiry, or confirmed retirement.
operation.end.native_finished_at string,null (date-time) Yes
operation.end.operation_id string Yes
operation.end.retired_at string,null (date-time) Yes
operation.end.status enum: ending, cleanup_pending, ended, failed, expired, uncertain Yes
operation.expires_at string (date-time) Yes
operation.id string Yes
operation.provider enum: codex, claude Yes
operation.references object Yes
operation.references.input_id string No
operation.references.provider enum: codex, claude No
operation.references.source_operation_id string No
operation.references.thread_id string No
operation.references.turn_id string No
operation.result object or object or object or object or object or object or object or object or object or object or null Yes
operation.result_expired boolean Yes Private cached prompts/results expire after one hour; intent digests and native references remain as replay fences.
operation.state enum: queued, claimed, completed, failed, expired, uncertain Yes

load

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_local_threads_local_thread_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
local_thread_id path string Yes

Responses

200: Authorized local coding-agent thread

application/json

Property Type Required Description
thread object Yes
thread.archived boolean Yes Archived on its computer: hidden from the active list and shown with the archived threads.
thread.can_archive boolean Yes This requester can archive or restore it, and the computer's Desktop supports archiving.
thread.can_disconnect_relay boolean No
thread.can_end boolean Yes
thread.can_interrupt boolean Yes
thread.can_send boolean Yes
thread.created_at string Yes
thread.device_id string Yes
thread.device_name string Yes
thread.end object or null Yes
thread.full_title string Yes The native name or first prompt in full, for a tooltip.
thread.id string Yes
thread.last_activity_at string,null (date-time) Yes
thread.native_thread_id string Yes
thread.parent_conversation_id string,null Yes
thread.provider enum: codex, claude Yes
thread.relay_disconnected_at string,null (date-time) No
thread.relay_participant object No
thread.relay_participant.aliases array of object Yes
thread.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.
thread.relay_participant.aliases[].forward_until string,null Yes
thread.relay_participant.aliases[].name string Yes
thread.relay_participant.can_rename boolean Yes
thread.relay_participant.canonical_name string Yes
thread.relay_participant.management_actions array of object or object Yes
thread.relay_participant.name string Yes
thread.relay_participant.observation_action object,null Yes
thread.relay_participant.observation_action.arguments object Yes
thread.relay_participant.observation_action.arguments.operation_id string Yes
thread.relay_participant.observation_action.name enum: agent.rename_status Yes
thread.relay_participant.pending_operation_id string,null Yes
thread.relay_participant.pending_retirement_id string,null Yes
thread.relay_participant.scope_key string Yes
thread.relay_participant.source_operation_id string Yes
thread.relay_participant.version integer Yes
thread.section enum: current, done, offline Yes Server-assigned section in the ordered computer thread directory.
thread.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.
thread.task_configured boolean Yes
thread.title string Yes Short title: the native name, or the first prompt's first line without the agent's task preamble.

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}/delivery_policy

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_local_threads_local_thread_id_delivery_policy.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
local_thread_id path string Yes
cursor query string No

Responses

application/json

Property Type Required Description
policy object Yes
policy.allowed_senders array of string Yes
policy.ask_first boolean Yes
policy.computer_restricted boolean Yes The computer-wide sender restriction also applies to this source.
policy.final_answers_available boolean Yes
policy.final_replies array of object Yes
policy.final_replies[].created_at string Yes
policy.final_replies[].delivery_id string Yes
policy.final_replies[].kind enum: automatic, native, null Yes
policy.final_replies[].operation_id string,null Yes
policy.final_replies[].state enum: waiting, pending, running, completed, uncertain, not_sent Yes
policy.held array of object Yes
policy.held[].consent_decision enum: automatic, approved, dismissed Yes
policy.held[].expires_at string Yes
policy.held[].held boolean Yes
policy.held[].id string Yes
policy.held[].operation_id string,null Yes
policy.held[].retryable any Yes
policy.held[].sender string,null Yes
policy.held[].state enum: pending, enqueued, discarded, expired Yes
policy.held[].text string,null Yes
policy.held[].text_omitted boolean Yes
policy.next_cursor string,null Yes
policy.recent_decisions array of object Yes
policy.recent_decisions[].consent_decision enum: automatic, approved, dismissed Yes
policy.recent_decisions[].final_reply object or null Yes
policy.recent_decisions[].held boolean Yes
policy.recent_decisions[].id string Yes
policy.recent_decisions[].operation_id string,null Yes
policy.recent_decisions[].retryable any Yes
policy.recent_decisions[].state enum: pending, enqueued, discarded, expired Yes
policy.reply_with_final_answer boolean,null Yes True always forwards a final answer; false disables it. Null uses native replies and the original parent-reporting default for agent-created threads.
policy.restricted boolean Yes
policy.version integer Yes

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}/task

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_local_threads_local_thread_id_task.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
local_thread_id path string Yes
cursor query string No
limit query integer No

Responses

200: Current authorized native task result receipts

application/json

Property Type Required Description
task object or null Yes

update

PUT /api/v1/organizations/{organization_id}/agents/{id}/spark/local_threads/{local_thread_id}/delivery_policy

Operation ID: put_api_v1_organizations_organization_id_agents_id_spark_local_threads_local_thread_id_delivery_policy.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
local_thread_id path string Yes

Request body

application/json

Property Type Required Description
allowed_senders array of string Yes
ask_first boolean Yes
expected_version integer Yes
reply_with_final_answer boolean,null No True always forwards a final answer; false disables it. Null uses native replies and the original parent-reporting default for agent-created threads.
restricted boolean Yes

Responses

application/json

Property Type Required Description
policy object Yes
policy.allowed_senders array of string Yes
policy.ask_first boolean Yes
policy.computer_restricted boolean Yes The computer-wide sender restriction also applies to this source.
policy.final_answers_available boolean Yes
policy.final_replies array of object Yes
policy.final_replies[].created_at string Yes
policy.final_replies[].delivery_id string Yes
policy.final_replies[].kind enum: automatic, native, null Yes
policy.final_replies[].operation_id string,null Yes
policy.final_replies[].state enum: waiting, pending, running, completed, uncertain, not_sent Yes
policy.held array of object Yes
policy.held[].consent_decision enum: automatic, approved, dismissed Yes
policy.held[].expires_at string Yes
policy.held[].held boolean Yes
policy.held[].id string Yes
policy.held[].operation_id string,null Yes
policy.held[].retryable any Yes
policy.held[].sender string,null Yes
policy.held[].state enum: pending, enqueued, discarded, expired Yes
policy.held[].text string,null Yes
policy.held[].text_omitted boolean Yes
policy.next_cursor string,null Yes
policy.recent_decisions array of object Yes
policy.recent_decisions[].consent_decision enum: automatic, approved, dismissed Yes
policy.recent_decisions[].final_reply object or null Yes
policy.recent_decisions[].held boolean Yes
policy.recent_decisions[].id string Yes
policy.recent_decisions[].operation_id string,null Yes
policy.recent_decisions[].retryable any Yes
policy.recent_decisions[].state enum: pending, enqueued, discarded, expired Yes
policy.reply_with_final_answer boolean,null Yes True always forwards a final answer; false disables it. Null uses native replies and the original parent-reporting default for agent-created threads.
policy.restricted boolean Yes
policy.version integer Yes