API

Address

An agent's email address, phone number, Telegram bot or Slack bot: list, add, read, change or remove one, or make it the one its channel sends from (primary).

Operations

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

Method Route SDK operation Returns
POST /agents/{id}/addresses/{addressId}/primary create The address is primary
POST /agents/{id}/addresses create The new address
GET /agents/{id}/addresses list The addresses
GET /agents/{id}/addresses/{addressId} load The address
DELETE /agents/{id}/addresses/{addressId} remove The address is gone
PATCH /agents/{id}/addresses/{addressId} update The changed address

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:

addresss, err := client.Address(nil).List(map[string]any{"agent_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(addresss)
address, err := client.Address(nil).Load(map[string]any{"agent_id": "example", "id": "example_id"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(address)
created, err := client.Address(nil).Create(map[string]any{"agent_id": "example", "channel": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.Address(nil).Update(map[string]any{"id": "example_id", "agent_id": "example", "value": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)
removed, err := client.Address(nil).Remove(map[string]any{"agent_id": "example", "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 addresss, err = client:Address():list({ agent_id = "example" })
local address, err = client:Address():load({ agent_id = "example", id = "example_id" })
local created, err = client:Address():create({ agent_id = "example", channel = "example" })
local updated, err = client:Address():update({ id = "example_id", agent_id = "example", value = "example" })
local removed, err = client:Address():remove({ agent_id = "example", id = "example_id" })

PHP

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

$addresss = $client->Address()->list(["agent_id" => "example"]);
$address = $client->Address()->load(["agent_id" => "example", "id" => "example_id"]);
$created = $client->Address()->create(["agent_id" => "example", "channel" => "example"]);
$updated = $client->Address()->update(["id" => "example_id", "agent_id" => "example", "value" => "example"]);
$client->Address()->remove(["agent_id" => "example", "id" => "example_id"]);

Python

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

addresss = client.Address().list({"agent_id": "example"})
address = client.Address().load({"agent_id": "example", "id": "example_id"})
created = client.Address().create({ "agent_id": "example", "channel": "example" })
updated = client.Address().update({"id": "example_id", "agent_id": "example", "value": "example"})
client.Address().remove({"agent_id": "example", "id": "example_id"})

Ruby

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

addresss = client.Address.list({ "agent_id" => "example" })
address = client.Address.load({ "agent_id" => "example", "id" => "example_id" })
created = client.Address.create({ "agent_id" => "example", "channel" => "example" })
updated = client.Address.update({ "id" => "example_id", "agent_id" => "example", "value" => "example" })
client.Address.remove({ "agent_id" => "example", "id" => "example_id" })

TypeScript

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

const addresss = await client.Address().list({ agent_id: "example" })
const address = await client.Address().load({ agent_id: "example", id: "example_id" })
const created = await client.Address().create({ agent_id: "example", channel: "example" })
const updated = await client.Address().update({ id: "example_id", agent_id: "example", value: "example" })
await client.Address().remove({ agent_id: "example", id: "example_id" })

Fields

Field Type Required Description
channel string Yes Channel
code string No The code the provider's consent page sent the member back with, beside setup
country string No The ISO country of the phone number; the first one the server sells by default
createdAt string Yes Created At
domainId any Yes The workspace's own domain the address is on
id string Yes Id
name one,string,null Yes What people know the address by when its value is an id, like a Slack bot's @name
primary boolean Yes Whether new messages on its channel go out from it
registering boolean No Whether US carriers are still registering the phone number, which sends nothing until they have
setup string No The state a provider's consent page sent the member back with, for an app they installed from the link setUpAddress gave with token
token string No What connects an address the workspace already has: the token @BotFather gave a Telegram bot, or a Slack app's bot token and signing secret with a space between
value string Yes The email address, phone number, Telegram bot's @username, or Slack bot's workspace and member ids

create

POST /agents/{id}/addresses/{addressId}/primary

Operation ID: makeAddressPrimary.

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

Parameters

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

Responses

204: The address is primary
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

POST /agents/{id}/addresses

Operation ID: addAddress.

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
channel enum: email, sms, telegram, slack Yes
code string No The code the provider's consent page sent the member back with, beside setup
country string No The ISO country of the phone number; the first one the server sells by default
setup string (uuid) No The state a provider's consent page sent the member back with, for an app they installed from the link setUpAddress gave with token
token string No What connects an address the workspace already has: the token @BotFather gave a Telegram bot, or a Slack app's bot token and signing secret with a space between
value string (email) No

Responses

201: The new address

application/json

Property Type Required Description
channel enum: email, sms, telegram, slack Yes
createdAt string (date-time) Yes
domainId string (uuid) or null Yes The workspace's own domain the address is on
id string (uuid) Yes
name string,null Yes What people know the address by when its value is an id, like a Slack bot's @name
primary boolean Yes Whether new messages on its channel go out from it
registering boolean No Whether US carriers are still registering the phone number, which sends nothing until they have
value string Yes The email address, phone number, Telegram bot's @username, or Slack bot's workspace and member ids
202: The new phone number, which US carriers are still registering. Read it at Location until registering is false; it sends nothing until then

application/json

Property Type Required Description
channel enum: email, sms, telegram, slack Yes
createdAt string (date-time) Yes
domainId string (uuid) or null Yes The workspace's own domain the address is on
id string (uuid) Yes
name string,null Yes What people know the address by when its value is an id, like a Slack bot's @name
primary boolean Yes Whether new messages on its channel go out from it
registering boolean No Whether US carriers are still registering the phone number, which sends nothing until they have
value string Yes The email address, phone number, Telegram bot's @username, or Slack bot's workspace and member ids
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/{id}/addresses

Operation ID: listAddresses.

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

Parameters

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

Responses

200: The addresses

application/json

Property Type Required Description
[].channel enum: email, sms, telegram, slack Yes
[].createdAt string (date-time) Yes
[].domainId string (uuid) or null Yes The workspace's own domain the address is on
[].id string (uuid) Yes
[].name string,null Yes What people know the address by when its value is an id, like a Slack bot's @name
[].primary boolean Yes Whether new messages on its channel go out from it
[].registering boolean No Whether US carriers are still registering the phone number, which sends nothing until they have
[].value string Yes The email address, phone number, Telegram bot's @username, or Slack bot's workspace and member ids
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}/addresses/{addressId}

Operation ID: readAddress.

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

Parameters

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

Responses

200: The address

application/json

Property Type Required Description
channel enum: email, sms, telegram, slack Yes
createdAt string (date-time) Yes
domainId string (uuid) or null Yes The workspace's own domain the address is on
id string (uuid) Yes
name string,null Yes What people know the address by when its value is an id, like a Slack bot's @name
primary boolean Yes Whether new messages on its channel go out from it
registering boolean No Whether US carriers are still registering the phone number, which sends nothing until they have
value string Yes The email address, phone number, Telegram bot's @username, or Slack bot's workspace and member ids
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}/addresses/{addressId}

Operation ID: removeAddress.

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

Parameters

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

Responses

204: The address 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}/addresses/{addressId}

Operation ID: changeAddress.

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

Parameters

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

Request body

application/json

Property Type Required Description
value string (email) Yes

Responses

200: The changed address

application/json

Property Type Required Description
channel enum: email, sms, telegram, slack Yes
createdAt string (date-time) Yes
domainId string (uuid) or null Yes The workspace's own domain the address is on
id string (uuid) Yes
name string,null Yes What people know the address by when its value is an id, like a Slack bot's @name
primary boolean Yes Whether new messages on its channel go out from it
registering boolean No Whether US carriers are still registering the phone number, which sends nothing until they have
value string Yes The email address, phone number, Telegram bot's @username, or Slack bot's workspace and member ids
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