API

AgentOperation

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/relay/operations create Authorized operator result
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/relay/operations/{operation_id} load Authorized operator result

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:

agent_operation, err := client.AgentOperation(nil).Load(map[string]any{"agent_id": "example", "id": "example_id", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_operation)
created, err := client.AgentOperation(nil).Create(map[string]any{"agent_id": "example", "organization_id": "example", "arguments": map[string]any{}, "key": "example", "name": "example", "requester_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 agent_operation, err = client:AgentOperation():load({ agent_id = "example", id = "example_id", organization_id = "example" })
local created, err = client:AgentOperation():create({ agent_id = "example", organization_id = "example", arguments = {}, key = "example", name = "example", requester_id = "example" })

PHP

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

$agent_operation = $client->AgentOperation()->load(["agent_id" => "example", "id" => "example_id", "organization_id" => "example"]);
$created = $client->AgentOperation()->create(["agent_id" => "example", "organization_id" => "example", "arguments" => [], "key" => "example", "name" => "example", "requester_id" => "example"]);

Python

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

agent_operation = client.AgentOperation().load({"agent_id": "example", "id": "example_id", "organization_id": "example"})
created = client.AgentOperation().create({ "agent_id": "example", "organization_id": "example", "arguments": {}, "key": "example", "name": "example", "requester_id": "example" })

Ruby

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

agent_operation = client.AgentOperation.load({ "agent_id" => "example", "id" => "example_id", "organization_id" => "example" })
created = client.AgentOperation.create({ "agent_id" => "example", "organization_id" => "example", "arguments" => {}, "key" => "example", "name" => "example", "requester_id" => "example" })

TypeScript

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

const agent_operation = await client.AgentOperation().load({ agent_id: "example", id: "example_id", organization_id: "example" })
const created = await client.AgentOperation().create({ agent_id: "example", organization_id: "example", arguments: {}, key: "example", name: "example", requester_id: "example" })

Fields

Field Type Required Description
arguments object Yes JSON object limited to 65536 encoded bytes.
id string No Id
key string Yes Key
name string Yes Name
operation object Yes Operation
participant string Yes Participant
requester_id string Yes Signed-in user public ID returned by discovery.
scope_key string Yes Scope Key

create

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/relay/operations

Operation ID: spark_relay_operations_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
arguments object Yes JSON object limited to 65536 encoded bytes. Reserved routing fields are rejected.
key string Yes
name string Yes
requester_id string Yes Signed-in user public ID returned by discovery. Retain it with the exact request key.

Responses

202: Authorized operator result

application/json

Property Type Required Description
operation object Yes
operation.id string Yes
operation.result object,null Yes
operation.result_expired boolean Yes
operation.retryable boolean Yes
operation.state enum: pending, running, completed, uncertain Yes
operation.status_action object,null No
operation.status_action.arguments object Yes
operation.status_action.arguments.operation_id string Yes
operation.status_action.name enum: agent.rename_status Yes
operation.tool 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

load

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/relay/operations/{operation_id}

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_relay_operations_operation_id_.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Authorized operator result

application/json

Property Type Required Description
operation object Yes
operation.id string Yes
operation.result object,null Yes
operation.result_expired boolean Yes
operation.retryable boolean Yes
operation.state enum: pending, running, completed, uncertain Yes
operation.status_action object,null No
operation.status_action.arguments object Yes
operation.status_action.arguments.operation_id string Yes
operation.status_action.name enum: agent.rename_status Yes
operation.tool 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