InteractionResponse
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/interactions/{request_id}/responses |
create |
Previously accepted durable response receipt; no effects repeated |
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.InteractionResponse(nil).Create(map[string]any{"agent_id": "example", "interaction_id": "example", "organization_id": "example", "answer": map[string]any{}, "conversation_id": "example", "expected_revision": 1}, 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:InteractionResponse():create({ agent_id = "example", interaction_id = "example", organization_id = "example", answer = {}, conversation_id = "example", expected_revision = 1 })
PHP
Construct client as shown in the PHP setup, then call the operations:
$created = $client->InteractionResponse()->create(["agent_id" => "example", "interaction_id" => "example", "organization_id" => "example", "answer" => [], "conversation_id" => "example", "expected_revision" => 1]);
Python
Construct client as shown in the Python setup, then call the operations:
created = client.InteractionResponse().create({ "agent_id": "example", "interaction_id": "example", "organization_id": "example", "answer": {}, "conversation_id": "example", "expected_revision": 1 })
Ruby
Construct client as shown in the Ruby setup, then call the operations:
created = client.InteractionResponse.create({ "agent_id" => "example", "interaction_id" => "example", "organization_id" => "example", "answer" => {}, "conversation_id" => "example", "expected_revision" => 1 })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const created = await client.InteractionResponse().create({ agent_id: "example", interaction_id: "example", organization_id: "example", answer: {}, conversation_id: "example", expected_revision: 1 })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
answer |
object |
Yes | Answer |
conversation_id |
string |
Yes | Explicit conversation identity, including an agent-scoped native session alias. |
expected_revision |
integer |
Yes | Expected Revision |
create
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/interactions/{request_id}/responses
Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_interactions_request_id_responses.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
request_id |
path |
string |
Yes | |
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 |
|---|---|---|---|
answer |
object |
Yes | |
answer.action |
string |
No | Required only for a confirmed records, changes or form answer; the id of the action pressed. Forbidden otherwise. |
answer.always_allow |
enum: true |
No | Only for a confirmed changes answer from a viewer with can_always_allow. Also lets the agent make its writes with this tool, as this account, without a preview from now on, until someone who manages it removes the permission. Deletes and payments, and changes that cannot be undone, are flagged, run SQL or start left out, are still previewed; email sends, sharing and member changes are not. Forbidden otherwise. |
answer.choices |
array of string |
No | Required for choice, records, changes and form. For choice, the picked option values in option order; one value for a single choice, one or more for a multiple choice. For records, the ticked record ids in card order, which the action decides. For changes, the ids of the included items in card order, at least one. For a form batch, the ids of the kept drafts in card order, at least one; empty for a single draft. Empty when skipped with confirmed false. Forbidden for other kinds. |
answer.confirmed |
boolean |
Yes | |
answer.items |
array of object |
No | Required only for a confirmed answer to a form batch. Each kept draft with every field as the person approved it, in the order of choices. Forbidden otherwise. |
answer.items[].id |
string |
Yes | |
answer.items[].values |
object |
Yes | Field key to value. |
answer.selected_skills |
array of string |
No | Required only for skill_install; unique subset of reviewed names, nonempty when confirmed and empty when declined. Forbidden for other kinds. |
answer.values |
object |
No | Required only for a confirmed answer to a single form draft. Every field as the person approved it, which may differ from the draft. Forbidden otherwise. |
conversation_id |
string |
Yes | Explicit conversation identity, including an agent-scoped native session alias. |
expected_revision |
integer |
Yes |
Responses
200: Previously accepted durable response receipt; no effects repeated
application/json
The response is object and object or object and object or object and object or object and object or object and object.
202: New response durably accepted; continuation delivery is pending
application/json
The response is object and object or object and object or object and object or object and object or object and object.
401: Authentication required
403: Agent access or experiment gate unavailable, or visible interaction lacks current operation authority
404: Authorized agent, conversation, or interaction not found; cross-scope IDs disclose nothing
409: Stale revision, competing decision, or changed key/body; current state is returned only when readable
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | |
interaction |
object and object or object and object or object and object or object and object or object and object |
Yes | A registered interaction, one variant per kind. Choice, records, changes and form cards each require their own payload, and a records question its actions; every other kind shares the common fields. |