AgentWorkspace
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/workspaces |
list |
Retained workspaces and reserved capacity, independent of native runtime availability |
POST |
/api/v1/organizations/{organization_id}/agents/{id}/spark/workspaces/{workspace_id} |
update |
Durable workspace action; deletion is not confirmed until both resources return 404 |
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_workspaces, err := client.AgentWorkspace(nil).List(map[string]any{"agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(agent_workspaces)
updated, err := client.AgentWorkspace(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_workspaces, err = client:AgentWorkspace():list({ agent_id = "example", organization_id = "example" })
local updated, err = client:AgentWorkspace():update({ agent_id = "example", organization_id = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$agent_workspaces = $client->AgentWorkspace()->list(["agent_id" => "example", "organization_id" => "example"]);
$updated = $client->AgentWorkspace()->update(["agent_id" => "example", "organization_id" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
agent_workspaces = client.AgentWorkspace().list({"agent_id": "example", "organization_id": "example"})
updated = client.AgentWorkspace().update({"agent_id": "example", "organization_id": "example"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
agent_workspaces = client.AgentWorkspace.list({ "agent_id" => "example", "organization_id" => "example" })
updated = client.AgentWorkspace.update({ "agent_id" => "example", "organization_id" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const agent_workspaces = await client.AgentWorkspace().list({ agent_id: "example", organization_id: "example" })
const updated = await client.AgentWorkspace().update({ agent_id: "example", organization_id: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
action |
string |
Yes | Action |
can_delete |
boolean |
Yes | Can Delete |
can_keep |
boolean |
Yes | Can Keep |
cleanup_after |
one,string,null |
Yes | Cleanup After |
created_at |
string |
Yes | Created At |
id |
string |
Yes | Id |
name |
string |
Yes | Name |
reason |
string |
Yes | Reason |
state |
string |
Yes | State |
list
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workspaces
Operation ID: spark_workspaces_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: Retained workspaces and reserved capacity, independent of native runtime availability
application/json
| Property | Type | Required | Description |
|---|---|---|---|
items |
array of object |
Yes | |
items[].can_delete |
boolean |
Yes | |
items[].can_keep |
boolean |
Yes | |
items[].cleanup_after |
string,null (date-time) |
Yes | |
items[].created_at |
string (date-time) |
Yes | |
items[].id |
string |
Yes | |
items[].name |
string |
Yes | |
items[].reason |
string |
Yes | |
items[].state |
enum: kept, scheduled, retiring, deleted |
Yes | |
limit |
integer |
Yes | |
next_cursor |
string,null |
Yes | |
occupied |
integer |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
update
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workspaces/{workspace_id}
Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_workspaces_workspace_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
workspace_id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
action |
enum: keep, delete |
Yes |
Responses
200: Durable workspace action; deletion is not confirmed until both resources return 404
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_delete |
boolean |
Yes | |
can_keep |
boolean |
Yes | |
cleanup_after |
string,null (date-time) |
Yes | |
created_at |
string (date-time) |
Yes | |
id |
string |
Yes | |
name |
string |
Yes | |
reason |
string |
Yes | |
state |
enum: kept, scheduled, retiring, deleted |
Yes |