API

Connection

The client that hears an agent's new messages: read it, or make the calling client that one (an agent's own token only).

Operations

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

Method Route SDK operation Returns
GET /agents/{id}/connection load The connection
PUT /agents/{id}/connection update The agent's new connection

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:

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

Lua

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

local connection, err = client:Connection():load({ agent_id = "example" })
local updated, err = client:Connection():update({ agent_id = "example", client = "example" })

PHP

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

$connection = $client->Connection()->load(["agent_id" => "example"]);
$updated = $client->Connection()->update(["agent_id" => "example", "client" => "example"]);

Python

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

connection = client.Connection().load({"agent_id": "example"})
updated = client.Connection().update({"agent_id": "example", "client": "example"})

Ruby

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

connection = client.Connection.load({ "agent_id" => "example" })
updated = client.Connection.update({ "agent_id" => "example", "client" => "example" })

TypeScript

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

const connection = await client.Connection().load({ agent_id: "example" })
const updated = await client.Connection().update({ agent_id: "example", client: "example" })

Fields

Field Type Required Description
client string Yes Client
id string Yes Id
machine one,string,null Yes Machine
tokenId string Yes The agent's token the client connected with

load

GET /agents/{id}/connection

Operation ID: readConnection.

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

Parameters

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

Responses

200: The connection

application/json

The response is object or null.

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}/connection

Operation ID: connectClient.

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
client string Yes
machine string No

Responses

200: The agent's new connection

application/json

Property Type Required Description
client string Yes
id string (uuid) Yes
machine string,null Yes
tokenId string (uuid) Yes The agent's token the client connected with
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