AgentInput
A message sent to an agent in a conversation. Accepting it starts a run; the reply arrives in the conversation.
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/inputs |
create |
Previously accepted run receipt or completed control. Native /stop returns cancellation details without a new run_id; observe the affected runs for their final state |
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:
created, err := client.AgentInput(nil).Create(map[string]any{"agent_id": "example", "organization_id": "example", "conversation_id": "example", "text": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
Lua
Construct client as shown in the Lua setup, then call the operations:
local created, err = client:AgentInput():create({ agent_id = "example", organization_id = "example", conversation_id = "example", text = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$created = $client->AgentInput()->create(["agent_id" => "example", "organization_id" => "example", "conversation_id" => "example", "text" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
created = client.AgentInput().create({ "agent_id": "example", "organization_id": "example", "conversation_id": "example", "text": "example" })
Ruby
Construct client as shown in the Ruby setup, then call the operations:
created = client.AgentInput.create({ "agent_id" => "example", "organization_id" => "example", "conversation_id" => "example", "text" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const created = await client.AgentInput().create({ agent_id: "example", organization_id: "example", conversation_id: "example", text: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
attachment_ids |
array |
No | Completed uploads from the attachments endpoint, in order. |
attachments |
array |
No | Attachments |
browser_context |
object |
No | Advisory snapshot of the browser pane beside this conversation when the message was sent. |
client_time |
object |
No | The sending app's IANA time zone and clock, so the agent answers in the person's local time. |
conversation_id |
string |
Yes | Main or a conversation identity returned by the agent thread list. |
model_policy |
any |
No | Model Policy |
requester_membership_id |
string |
No | Snapshot the membership supplied by conversation history for a NEW V1 input. |
speed |
string |
No | Fast uses OpenAI priority processing for GPT models (2x price) or the quickest approved OpenRouter route. |
text |
string |
Yes | Text |
create
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/inputs
Operation ID: spark_inputs_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. |
X-Composal-Input-Delivery |
header |
enum: durable |
No | Advertise support for waiting delivery custody. Without this header, waiting retains the legacy retryable 503 contract; 202 always means native acknowledged. |
Idempotency-Key |
header |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
attachment_ids |
array of string |
No | Completed uploads from the attachments endpoint, in order. Use instead of attachments, not with it. Together they can total 2 GB. |
attachments |
array of object |
No | |
attachments[].content |
string |
Yes | Base64 bytes. Up to 4 MB per file and 8 MB total. |
attachments[].fileName |
string |
Yes | |
attachments[].mimeType |
string |
Yes | |
browser_context |
object |
No | Advisory snapshot of the browser pane beside this conversation when the message was sent. |
browser_context.active_tab |
object |
No | |
browser_context.active_tab.location |
enum: local, remote |
Yes | |
browser_context.active_tab.target_id |
string |
No | CDP identifier for the selected remote tab. Reference only. |
browser_context.active_tab.title |
string |
Yes | |
browser_context.active_tab.url |
string |
No | HTTP(S) origin and path with query and fragment removed. |
browser_context.tabs |
array of object |
Yes | |
browser_context.tabs[].location |
enum: local, remote |
Yes | |
browser_context.tabs[].target_id |
string |
No | CDP identifier for the selected remote tab. Reference only. |
browser_context.tabs[].title |
string |
Yes | |
browser_context.tabs[].url |
string |
No | HTTP(S) origin and path with query and fragment removed. |
browser_context.view |
enum: local, remote, desktop |
Yes | |
client_time |
object |
No | The sending app's IANA time zone and clock, so the agent answers in the person's local time. It is not part of the message, so a retry may send a newer value; the first admitted one is kept. An unknown zone is ignored, and a clock more than five minutes from the server's gives way to the server's. |
client_time.at |
string (date-time) |
No | The app's current time with its UTC offset. |
client_time.time_zone |
string |
Yes | IANA zone, such as Europe/London. |
conversation_id |
string |
Yes | Main or a conversation identity returned by the agent thread list. Native aliases are scoped to the selected agent. |
model_policy |
object or object |
No | |
requester_membership_id |
string |
No | Snapshot the membership supplied by conversation history for a NEW V1 input. Preserve the original body on retries; absent means legacy unbound input. V1 uses a separate native identity namespace and binds even if the rollout flag changes. |
speed |
enum: regular, fast, ultrafast |
No | Fast uses OpenAI priority processing for GPT models (2x price) or the quickest approved OpenRouter route. Ultrafast uses OpenAI's fastest tier at the selected model's Ultrafast price. |
text |
string |
Yes |
Responses
200: Previously accepted run receipt or completed control. Native /stop returns cancellation details without a new run_id; observe the affected runs for their final state
application/json
The response is object or object.
202: Message held durably by Rails or acknowledged by native runtime. Waiting does not prove native acceptance; poll input_delivery until acknowledged
application/json
The response is object or object.
401: Unauthorized
403: Agent messaging access or experiment gate unavailable
404: Authorized V2 agent not found
409: The key belongs to another message, the runtime changed, or the agent's personal plan cannot bill this message
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_use_platform_billing |
boolean |
No | This person may return the agent to Composal billing |
code |
string |
No | Native conflict or terminal delivery code, including control_delivery_unknown, or input_key_conflict when the key already holds another body or sender and this input was not admitted. Personal-plan codes are personal_plan_unavailable and subscription_disconnected; a retried input may already have been sent. |
delivery_status |
enum: rejected |
No | Rails ended custody of this input; replaying its key returns the same rejection |
error |
string |
Yes |
422: Invalid message
429: Pending delivery capacity reached; this new input was not queued
502: Bad gateway
503: Delivery is unconfirmed; preserve the original key and body for reconciliation
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 |