This object represents an agent of a user in Absurdia. The endpoints let you create an agent, retrieve agents data, update some attributes, enable/disable an agent and delete an agent.
Related doc: Accounts, Agents and Users
An agent object returned by Absurdia's APIs will contain the following attributes:
string
The ID of the agent.
string
One of app, shared and private. The "root agent" cannot be deleted or modified, and is the one that connects to Visage.
string
The name of the agent. This can be easier to use than
string
The ID of the user who owns the agent. All agents are always owned by a single user.
boolean
Whether the agent can call APIs. This will almost always be true.
string | null
A base64-encoded ed25519 public key used to verify signatures. Agents of type app do not have a public key.
string[]
List of the IDs of the roles assigned to the agent.
hash | null
A hashmap of custom metadata. Values must be strings or empty. If a value is empty, the key might be used as a tag.
integer
UNIX timestamp in microseconds of the last update on the agent.
integer
UNIX timestamp in microseconds of the creation date.
integer
UNIX timestamp in microseconds of the expiration date of this agent.
{
"id": "4eeaa3f9866340478fc164fde39115aa",
"type": "app",
"name": "Root agent",
"owning_user": "6d0a12035235491d8605c5d811a6da8d",
"enabled": true,
"public_key": null,
"roles": [
"28259464619e4021ae732d5897060423"
],
"metadata": null,
"created_at": 1656013730610030,
"updated_at": 1656013730610030,
"expire_at": 4809613730610030
}
Agents of the same user as the authenticated user can use this endpoint to see all other agents of the same owner.
A list of agents that belongs to the requestor's user. Returns an error otherwise.
GET /v1/agentscurl https://api.absurdia.markets/v1/agents
-H "Accept: application/json"
-H "Authorization: Bearer {{token}}"
import requests
url = "https://api.absurdia.markets/v1/agents"
headers = {"Authorization": "Bearer {{token}}"}
response = requests.request("GET", url, headers=headers)
print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.absurdia.markets/v1/agents';
let options = {method: 'GET', headers: {Authorization: 'Bearer {{token}}'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.absurdia.markets/v1/agents"),
Headers =
{
{ "Authorization", "Bearer {{token}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
{
"data": [
//...Agent object...
]
}
signature required
An agent identifies itself to the API with a token (equivalent to an API key), holds roles to define their permissions and signs requests when needed. An agent cannot create another one with permissions that are more permissive what the agent holds.
Related doc: Agents
requiredstring
A name for the agent.
requiredstring
A description for the agent
string
One of private or shared. A private agent means it will only be used by you or someone in your account. A shared agent means it may be used by someone else. Default is private.
requiredstring[]
A list of the IDs of the roles assigned to the agent.
requiredstring
The ed25519 public key of the agent. The key must be URL-safe base64 encoded.
hash
A map of metadata attached to the agent.
A dictionary with a data attribute that contains a copy the created agent. Returns an error otherwise.
POST /v1/agentscurl https://api.absurdia.markets/v1/agents
-H "Accept: application/json"
-H "Authorization: Bearer {{token}}"
-H "Abs-Signature: t={{timestamp}}, s={{signature}}
import requests
url = "https://api.absurdia.markets/v1/agents"
data = {
"name": "Bot 1",
"description": "Bot for strategy A",
"type": "private",
"public_key": ""
"roles": [],
"metadata": {
"platform": "AWS"
}
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}",
"Abs-Signature": sign(data)
}
response = requests.request("POST", url, headers=headers, data=dump(data))
print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.absurdia.markets/v1/agents';
let data = {
"name": "Bot 1",
"description": "Bot for strategy A",
"type": "private",
"public_key": ""
"roles": [],
"metadata": {
"platform": "AWS"
}
}
let options = {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}",
"Abs-Signature": sign(data)
},
body: JSON.stringify(data)
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"data": {
//...Agent object...
}
}
Retrieve the agent with the given ID.
An agent object if the ID is valid and the requestor is authorised to read the agent. Returns an error otherwise.
GET /v1/agents/:idcurl https://api.absurdia.markets/v1/agents/:id
-H "Accept: application/json"
-H "Authorization: Bearer {{token}}"
import requests
url = "https://api.absurdia.markets/v1/agents/" + agent_id
headers = {
"Accept": "application/json",
"Authorization": "Bearer {{token}}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.absurdia.markets/v1/agents/' + agent_id;
let options = {
method: 'GET',
headers: {
"Accept": "application/json",
"Authorization": "Bearer {{token}}"
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"data": {
//...Agent object...
}
}