API

AgentSubagent

Operations

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

Method Route SDK operation Returns
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/subagents list Agent workspace

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_subagents, err := client.AgentSubagent(nil).List(map[string]any{"agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_subagents)

Lua

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

local agent_subagents, err = client:AgentSubagent():list({ agent_id = "example", organization_id = "example" })

PHP

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

$agent_subagents = $client->AgentSubagent()->list(["agent_id" => "example", "organization_id" => "example"]);

Python

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

agent_subagents = client.AgentSubagent().list({"agent_id": "example", "organization_id": "example"})

Ruby

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

agent_subagents = client.AgentSubagent.list({ "agent_id" => "example", "organization_id" => "example" })

TypeScript

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

const agent_subagents = await client.AgentSubagent().list({ agent_id: "example", organization_id: "example" })

Fields

Field Type Required Description
active boolean Yes Active
attention one,object,null No Why the person should open this thread, as the Threads panel shows it: a pending question, the agent asking for attention, or a run that did not finish.
ended_at one,string,null Yes Ended At
id string Yes Id
model one,string,null Yes Model
parent_id string Yes Parent Id
preview one,string,null Yes Preview
started_at one,string,null Yes Started At
state one,string,null Yes What the thread is to the viewer.
status string Yes Status
title string Yes Title
updated_at one,string,null Yes Updated At

list

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

Operation ID: spark_subagents_api_v1_organization_persistent_agent.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Agent workspace

application/json

Property Type Required Description
judging boolean Yes Whether a judgement is on its way for an idle thread on this page.
next_cursor string,null Yes
subagents array of object Yes
subagents[].active boolean Yes
subagents[].attention object,null No Why the person should open this thread, as the Threads panel shows it: a pending question, the agent asking for attention, or a run that did not finish.
subagents[].attention.kind enum: question, agent, failed Yes
subagents[].attention.text string Yes
subagents[].ended_at string,null Yes
subagents[].id string Yes
subagents[].model string,null Yes
subagents[].parent_id string Yes
subagents[].preview string,null Yes
subagents[].started_at string,null Yes
subagents[].state enum: working, ongoing, needs_you, done, null Yes What the thread is to the viewer. needs_you only when the thread asked the person or flagged that it needs them (attention); otherwise null while an idle thread has not been judged.
subagents[].status string Yes
subagents[].title string Yes
subagents[].updated_at string,null Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway