API

AgentControlFlow

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/control_flows/{flow_id}/cancel create Current requester Control workflows
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/control_flows list Current requester Control workflows
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/control_flows/{flow_id} load Current requester Control workflows

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_control_flows, err := client.AgentControlFlow(nil).List(map[string]any{"agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_control_flows)
agent_control_flow, err := client.AgentControlFlow(nil).Load(map[string]any{"agent_id": "example", "id": "example_id", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_control_flow)

Lua

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

local agent_control_flows, err = client:AgentControlFlow():list({ agent_id = "example", organization_id = "example" })
local agent_control_flow, err = client:AgentControlFlow():load({ agent_id = "example", id = "example_id", organization_id = "example" })

PHP

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

$agent_control_flows = $client->AgentControlFlow()->list(["agent_id" => "example", "organization_id" => "example"]);
$agent_control_flow = $client->AgentControlFlow()->load(["agent_id" => "example", "id" => "example_id", "organization_id" => "example"]);

Python

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

agent_control_flows = client.AgentControlFlow().list({"agent_id": "example", "organization_id": "example"})
agent_control_flow = client.AgentControlFlow().load({"agent_id": "example", "id": "example_id", "organization_id": "example"})

Ruby

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

agent_control_flows = client.AgentControlFlow.list({ "agent_id" => "example", "organization_id" => "example" })
agent_control_flow = client.AgentControlFlow.load({ "agent_id" => "example", "id" => "example_id", "organization_id" => "example" })

TypeScript

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

const agent_control_flows = await client.AgentControlFlow().list({ agent_id: "example", organization_id: "example" })
const agent_control_flow = await client.AgentControlFlow().load({ agent_id: "example", id: "example_id", organization_id: "example" })

Fields

Field Type Required Description
can_cancel boolean Yes Can Cancel
cancellation_requested boolean Yes Cancellation Requested
device_name string Yes Device Name
flow_id string Yes Flow Id
id string No Id
providers array Yes Providers
repair_of_flow_id string No Original retained workflow for an explicitly repaired failed task.
status_label string Yes Status Label
step_count integer Yes Step Count
title one,string,null Yes Title

create

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/control_flows/{flow_id}/cancel

Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_control_flows_flow_id_cancel.

Authentication: bearer token (bearerAuth).

Parameters

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

Request body

application/json

The request body is object.

Responses

200: Current requester Control workflows

application/json

Property Type Required Description
can_cancel boolean Yes
cancellation_requested boolean Yes
flow_id string Yes
status_label string Yes
409: Original workflow observation is unconfirmed

application/json

Property Type Required Description
code string No
error string Yes
flow_id string No
recovery object No

list

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/control_flows

Operation ID: spark_control_flows_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: Current requester Control workflows

application/json

Property Type Required Description
complete boolean Yes
flows array of object Yes
flows[].cancellation_requested boolean Yes
flows[].device_name string Yes
flows[].flow_id string Yes
flows[].providers array of enum: claude, codex Yes
flows[].repair_of_flow_id string No Original retained workflow for an explicitly repaired failed task.
flows[].step_count integer Yes
flows[].title string,null Yes
unavailable_count integer Yes
409: Original workflow observation is unconfirmed

application/json

Property Type Required Description
code string No
error string Yes
flow_id string No
recovery object No

load

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/control_flows/{flow_id}

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_control_flows_flow_id_.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Current requester Control workflows

application/json

Property Type Required Description
can_cancel boolean Yes
cancellation_requested boolean Yes
flow_id string Yes
status_label string Yes
409: Original workflow observation is unconfirmed

application/json

Property Type Required Description
code string No
error string Yes
flow_id string No
recovery object No