API

Access

Who can wake an agent on each channel: read the rules for every channel, or set the rule for one channel (email, sms, telegram, slack or url).

Operations

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

Method Route SDK operation Returns
GET /agents/{id}/access load Each channel's access
PUT /agents/{id}/access/{channel} update The channel's access

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:

access, err := client.Access(nil).Load(map[string]any{"agent_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(access)
updated, err := client.Access(nil).Update(map[string]any{"agent_id": "example", "channel": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)

Lua

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

local access, err = client:Access():load({ agent_id = "example" })
local updated, err = client:Access():update({ agent_id = "example", channel = "example" })

PHP

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

$access = $client->Access()->load(["agent_id" => "example"]);
$updated = $client->Access()->update(["agent_id" => "example", "channel" => "example"]);

Python

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

access = client.Access().load({"agent_id": "example"})
updated = client.Access().update({"agent_id": "example", "channel": "example"})

Ruby

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

access = client.Access.load({ "agent_id" => "example" })
updated = client.Access.update({ "agent_id" => "example", "channel" => "example" })

TypeScript

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

const access = await client.Access().load({ agent_id: "example" })
const updated = await client.Access().update({ agent_id: "example", channel: "example" })

Fields

Field Type Required Description
admit string Yes Whether anyone, the workspace's members and agents besides the listed senders, or only the listed senders wake the agent; a new agent starts with team, except on Telegram, which lists the account that creates its bot from Artil, and its…
senders array Yes Email addresses, phone numbers, Telegram user ids, group ids and usernames, Slack member ids and #channels, or for the Message URL the ids of agents and members

load

GET /agents/{id}/access

Operation ID: readAccess.

Authentication: bearer token (token) or oauth2 (oauth).

Parameters

Parameter In Type Required Description
id path string Yes The agent's id

Responses

200: Each channel's access

application/json

The response is object.

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

PUT /agents/{id}/access/{channel}

Operation ID: setAccess.

Authentication: bearer token (token) or oauth2 (oauth).

Parameters

Parameter In Type Required Description
id path string Yes The agent's id
channel path string Yes

Request body

application/json

Property Type Required Description
admit enum: anyone, team, list Yes
senders array of string Yes

Responses

200: The channel's access

application/json

Property Type Required Description
admit enum: anyone, team, list Yes Whether anyone, the workspace's members and agents besides the listed senders, or only the listed senders wake the agent; a new agent starts with team, except on Telegram, which lists the account that creates its bot from Artil, and its Message URL is never open to anyone
senders array of string Yes Email addresses, phone numbers, Telegram user ids, group ids and usernames, Slack member ids and #channels, or for the Message URL the ids of agents and members
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