Agent
An agent account in the workspace: list, create, read, rename or change the icon of one, or delete it with its addresses and messages.
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/agents |
create |
The new agent |
GET |
/agents |
list |
The agents |
GET |
/agents/{id} |
load |
The agent |
DELETE |
/agents/{id} |
remove |
The agent is gone |
PATCH |
/agents/{id} |
update |
The changed agent |
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:
agents, err := client.Agent(nil).List(nil, nil)
if err != nil {
panic(err)
}
fmt.Println(agents)
agent, err := client.Agent(nil).Load(map[string]any{"id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(agent)
created, err := client.Agent(nil).Create(map[string]any{"name": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
updated, err := client.Agent(nil).Update(map[string]any{"id": "example_id", "icon": "example", "name": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(updated)
removed, err := client.Agent(nil).Remove(map[string]any{"id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local agents, err = client:Agent():list()
local agent, err = client:Agent():load({ id = "example_id" })
local created, err = client:Agent():create({ name = "example" })
local updated, err = client:Agent():update({ id = "example_id", icon = "example", name = "example" })
local removed, err = client:Agent():remove({ id = "example_id" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$agents = $client->Agent()->list();
$agent = $client->Agent()->load(["id" => "example_id"]);
$created = $client->Agent()->create(["name" => "example"]);
$updated = $client->Agent()->update(["id" => "example_id", "icon" => "example", "name" => "example"]);
$client->Agent()->remove(["id" => "example_id"]);
Python
Construct client as shown in the Python setup, then call the operations:
agents = client.Agent().list()
agent = client.Agent().load({"id": "example_id"})
created = client.Agent().create({ "name": "example" })
updated = client.Agent().update({"id": "example_id", "icon": "example", "name": "example"})
client.Agent().remove({"id": "example_id"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
agents = client.Agent.list()
agent = client.Agent.load({ "id" => "example_id" })
created = client.Agent.create({ "name" => "example" })
updated = client.Agent.update({ "id" => "example_id", "icon" => "example", "name" => "example" })
client.Agent.remove({ "id" => "example_id" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const agents = await client.Agent().list()
const agent = await client.Agent().load({ id: "example_id" })
const created = await client.Agent().create({ name: "example" })
const updated = await client.Agent().update({ id: "example_id", icon: "example", name: "example" })
await client.Agent().remove({ id: "example_id" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
createdAt |
string |
Yes | Created At |
icon |
string |
Yes | Icon |
id |
string |
Yes | Id |
name |
string |
Yes | Name |
create
POST /agents
Operation ID: createAgent.
Authentication: bearer token (token) or oauth2 (oauth).
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
icon |
enum: bot, sparkles, bug, message-square, headphones, search, ... |
No | |
name |
string |
Yes |
Responses
201: The new agent
application/json
| Property | Type | Required | Description |
|---|---|---|---|
createdAt |
string (date-time) |
Yes | |
icon |
enum: bot, sparkles, bug, message-square, headphones, search, ... |
Yes | |
id |
string |
Yes | |
name |
string |
Yes |
4XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
5XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
list
GET /agents
Operation ID: listAgents.
Authentication: bearer token (token) or oauth2 (oauth).
Responses
200: The agents
application/json
| Property | Type | Required | Description |
|---|---|---|---|
[].createdAt |
string (date-time) |
Yes | |
[].icon |
enum: bot, sparkles, bug, message-square, headphones, search, ... |
Yes | |
[].id |
string |
Yes | |
[].name |
string |
Yes |
4XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
5XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
load
GET /agents/{id}
Operation ID: readAgent.
Authentication: bearer token (token) or oauth2 (oauth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes | The agent's id |
Responses
200: The agent
application/json
| Property | Type | Required | Description |
|---|---|---|---|
createdAt |
string (date-time) |
Yes | |
icon |
enum: bot, sparkles, bug, message-square, headphones, search, ... |
Yes | |
id |
string |
Yes | |
name |
string |
Yes |
4XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
5XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
remove
DELETE /agents/{id}
Operation ID: deleteAgent.
Authentication: bearer token (token) or oauth2 (oauth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes | The agent's id |
Responses
204: The agent is gone
4XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
5XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
update
PATCH /agents/{id}
Operation ID: updateAgent.
Authentication: bearer token (token) or oauth2 (oauth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path |
string |
Yes | The agent's id |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
icon |
enum: bot, sparkles, bug, message-square, headphones, search, ... |
No | |
name |
string |
No |
Responses
200: The changed agent
application/json
| Property | Type | Required | Description |
|---|---|---|---|
createdAt |
string (date-time) |
Yes | |
icon |
enum: bot, sparkles, bug, message-square, headphones, search, ... |
Yes | |
id |
string |
Yes | |
name |
string |
Yes |
4XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |
5XX: The request failed; the error says why
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
object |
Yes | |
error.code |
enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... |
Yes | |
error.message |
string |
Yes |