API

AgentRoutine

An agent's scheduled routines and heartbeat: list them, or change one (pause or enable it).

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/routines list Agent sidebar response
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/routines/{routine_id} update Agent sidebar response

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

Lua

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

local agent_routines, err = client:AgentRoutine():list({ agent_id = "example", organization_id = "example" })
local updated, err = client:AgentRoutine():update({ agent_id = "example", organization_id = "example" })

PHP

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

$agent_routines = $client->AgentRoutine()->list(["agent_id" => "example", "organization_id" => "example"]);
$updated = $client->AgentRoutine()->update(["agent_id" => "example", "organization_id" => "example"]);

Python

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

agent_routines = client.AgentRoutine().list({"agent_id": "example", "organization_id": "example"})
updated = client.AgentRoutine().update({"agent_id": "example", "organization_id": "example"})

Ruby

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

agent_routines = client.AgentRoutine.list({ "agent_id" => "example", "organization_id" => "example" })
updated = client.AgentRoutine.update({ "agent_id" => "example", "organization_id" => "example" })

TypeScript

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

const agent_routines = await client.AgentRoutine().list({ agent_id: "example", organization_id: "example" })
const updated = await client.AgentRoutine().update({ agent_id: "example", organization_id: "example" })

Fields

Field Type Required Description
can_manage boolean Yes Can Manage
consecutive_errors integer Yes Consecutive Errors
credit_wait object No The wallet funding an enabled routine that is waiting for inference credit.
description one,string,null Yes Description
enabled boolean Yes Enabled
id string Yes Id
kind string Yes Kind
last_error one,string,null Yes Last Error
last_run_at one,string,null Yes Last Run At
last_status one,string,null Yes Last Status
managed boolean Yes Managed
name string Yes Name
next_run_at one,string,null Yes Next Run At
routine object Yes Routine
schedule object Yes Schedule
schedule_label string Yes Schedule Label
utility_model object No Utility Model

list

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

Operation ID: spark_routines_api_v1_organization_persistent_agent.

Authentication: bearer token (bearerAuth).

Parameters

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

Responses

200: Agent sidebar response

application/json

Property Type Required Description
can_manage boolean Yes
next_cursor string Yes
routines array of object Yes
routines[].consecutive_errors integer Yes
routines[].credit_wait object No The wallet funding an enabled routine that is waiting for inference credit.
routines[].credit_wait.billing_url string (uri) Yes
routines[].credit_wait.wallet enum: agent, organization Yes
routines[].description string Yes
routines[].enabled boolean Yes
routines[].id string Yes
routines[].kind enum: heartbeat, routine Yes
routines[].last_error string Yes
routines[].last_run_at string Yes
routines[].last_status string Yes
routines[].managed boolean Yes
routines[].name string Yes
routines[].next_run_at string Yes
routines[].schedule object Yes
routines[].schedule.at string No
routines[].schedule.every_ms number,null No
routines[].schedule.expression string No
routines[].schedule.kind string Yes
routines[].schedule.timezone string No
routines[].schedule_label string Yes
routines[].utility_model object No
routines[].utility_model.options array of object Yes
routines[].utility_model.options[].id string Yes
routines[].utility_model.options[].label string Yes
routines[].utility_model.selected string,null Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

update

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/routines/{routine_id}

Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_routines_routine_id_.

Authentication: bearer token (bearerAuth).

Parameters

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

Request body

application/json

The request body is object or object.

Responses

200: Agent sidebar response

application/json

Property Type Required Description
can_manage boolean Yes
routine object Yes
routine.consecutive_errors integer Yes
routine.credit_wait object No The wallet funding an enabled routine that is waiting for inference credit.
routine.credit_wait.billing_url string (uri) Yes
routine.credit_wait.wallet enum: agent, organization Yes
routine.description string Yes
routine.enabled boolean Yes
routine.id string Yes
routine.kind enum: heartbeat, routine Yes
routine.last_error string Yes
routine.last_run_at string Yes
routine.last_status string Yes
routine.managed boolean Yes
routine.name string Yes
routine.next_run_at string Yes
routine.schedule object Yes
routine.schedule.at string No
routine.schedule.every_ms number,null No
routine.schedule.expression string No
routine.schedule.kind string Yes
routine.schedule.timezone string No
routine.schedule_label string Yes
routine.utility_model object No
routine.utility_model.options array of object Yes
routine.utility_model.options[].id string Yes
routine.utility_model.options[].label string Yes
routine.utility_model.selected string,null Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway