Create Agent
curl --request POST \
--url https://{api-address}.org.machina.gg/agent \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data @- <<EOF
{
"name": "my-new-agent",
"title": "My New Agent",
"description": "Your agent description",
"context": {
"config-frequency": 0.04
},
"workflows": [
{
"name": "sync-nba-embeds",
"description": "sync-nba-embeds",
"inputs": {
"event_code": "$.get('event_code') or None"
},
"outputs": {
"sync-nba-embeds-status": "$.get('workflow-status', False)"
}
}
],
"status": "inactive"
}
EOFimport requests
url = "https://{api-address}.org.machina.gg/agent"
payload = {
"name": "my-new-agent",
"title": "My New Agent",
"description": "Your agent description",
"context": { "config-frequency": 0.04 },
"workflows": [
{
"name": "sync-nba-embeds",
"description": "sync-nba-embeds",
"inputs": { "event_code": "$.get('event_code') or None" },
"outputs": { "sync-nba-embeds-status": "$.get('workflow-status', False)" }
}
],
"status": "inactive"
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-new-agent',
title: 'My New Agent',
description: 'Your agent description',
context: {'config-frequency': 0.04},
workflows: [
{
name: 'sync-nba-embeds',
description: 'sync-nba-embeds',
inputs: {event_code: '$.get(\'event_code\') or None'},
outputs: {'sync-nba-embeds-status': '$.get(\'workflow-status\', False)'}
}
],
status: 'inactive'
})
};
fetch('https://{api-address}.org.machina.gg/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api-address}.org.machina.gg/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'my-new-agent',
'title' => 'My New Agent',
'description' => 'Your agent description',
'context' => [
'config-frequency' => 0.04
],
'workflows' => [
[
'name' => 'sync-nba-embeds',
'description' => 'sync-nba-embeds',
'inputs' => [
'event_code' => '$.get(\'event_code\') or None'
],
'outputs' => [
'sync-nba-embeds-status' => '$.get(\'workflow-status\', False)'
]
]
],
'status' => 'inactive'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{api-address}.org.machina.gg/agent"
payload := strings.NewReader("{\n \"name\": \"my-new-agent\",\n \"title\": \"My New Agent\",\n \"description\": \"Your agent description\",\n \"context\": {\n \"config-frequency\": 0.04\n },\n \"workflows\": [\n {\n \"name\": \"sync-nba-embeds\",\n \"description\": \"sync-nba-embeds\",\n \"inputs\": {\n \"event_code\": \"$.get('event_code') or None\"\n },\n \"outputs\": {\n \"sync-nba-embeds-status\": \"$.get('workflow-status', False)\"\n }\n }\n ],\n \"status\": \"inactive\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{api-address}.org.machina.gg/agent")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-new-agent\",\n \"title\": \"My New Agent\",\n \"description\": \"Your agent description\",\n \"context\": {\n \"config-frequency\": 0.04\n },\n \"workflows\": [\n {\n \"name\": \"sync-nba-embeds\",\n \"description\": \"sync-nba-embeds\",\n \"inputs\": {\n \"event_code\": \"$.get('event_code') or None\"\n },\n \"outputs\": {\n \"sync-nba-embeds-status\": \"$.get('workflow-status', False)\"\n }\n }\n ],\n \"status\": \"inactive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api-address}.org.machina.gg/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-new-agent\",\n \"title\": \"My New Agent\",\n \"description\": \"Your agent description\",\n \"context\": {\n \"config-frequency\": 0.04\n },\n \"workflows\": [\n {\n \"name\": \"sync-nba-embeds\",\n \"description\": \"sync-nba-embeds\",\n \"inputs\": {\n \"event_code\": \"$.get('event_code') or None\"\n },\n \"outputs\": {\n \"sync-nba-embeds-status\": \"$.get('workflow-status', False)\"\n }\n }\n ],\n \"status\": \"inactive\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "67db52c32ae92018b93310a1"
},
"meta": {
"code": 200
},
"status": "success"
}Agents
Create Agent
Create a new agent and define its configurations.
POST
/
agent
Create Agent
curl --request POST \
--url https://{api-address}.org.machina.gg/agent \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data @- <<EOF
{
"name": "my-new-agent",
"title": "My New Agent",
"description": "Your agent description",
"context": {
"config-frequency": 0.04
},
"workflows": [
{
"name": "sync-nba-embeds",
"description": "sync-nba-embeds",
"inputs": {
"event_code": "$.get('event_code') or None"
},
"outputs": {
"sync-nba-embeds-status": "$.get('workflow-status', False)"
}
}
],
"status": "inactive"
}
EOFimport requests
url = "https://{api-address}.org.machina.gg/agent"
payload = {
"name": "my-new-agent",
"title": "My New Agent",
"description": "Your agent description",
"context": { "config-frequency": 0.04 },
"workflows": [
{
"name": "sync-nba-embeds",
"description": "sync-nba-embeds",
"inputs": { "event_code": "$.get('event_code') or None" },
"outputs": { "sync-nba-embeds-status": "$.get('workflow-status', False)" }
}
],
"status": "inactive"
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-new-agent',
title: 'My New Agent',
description: 'Your agent description',
context: {'config-frequency': 0.04},
workflows: [
{
name: 'sync-nba-embeds',
description: 'sync-nba-embeds',
inputs: {event_code: '$.get(\'event_code\') or None'},
outputs: {'sync-nba-embeds-status': '$.get(\'workflow-status\', False)'}
}
],
status: 'inactive'
})
};
fetch('https://{api-address}.org.machina.gg/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api-address}.org.machina.gg/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'my-new-agent',
'title' => 'My New Agent',
'description' => 'Your agent description',
'context' => [
'config-frequency' => 0.04
],
'workflows' => [
[
'name' => 'sync-nba-embeds',
'description' => 'sync-nba-embeds',
'inputs' => [
'event_code' => '$.get(\'event_code\') or None'
],
'outputs' => [
'sync-nba-embeds-status' => '$.get(\'workflow-status\', False)'
]
]
],
'status' => 'inactive'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{api-address}.org.machina.gg/agent"
payload := strings.NewReader("{\n \"name\": \"my-new-agent\",\n \"title\": \"My New Agent\",\n \"description\": \"Your agent description\",\n \"context\": {\n \"config-frequency\": 0.04\n },\n \"workflows\": [\n {\n \"name\": \"sync-nba-embeds\",\n \"description\": \"sync-nba-embeds\",\n \"inputs\": {\n \"event_code\": \"$.get('event_code') or None\"\n },\n \"outputs\": {\n \"sync-nba-embeds-status\": \"$.get('workflow-status', False)\"\n }\n }\n ],\n \"status\": \"inactive\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{api-address}.org.machina.gg/agent")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-new-agent\",\n \"title\": \"My New Agent\",\n \"description\": \"Your agent description\",\n \"context\": {\n \"config-frequency\": 0.04\n },\n \"workflows\": [\n {\n \"name\": \"sync-nba-embeds\",\n \"description\": \"sync-nba-embeds\",\n \"inputs\": {\n \"event_code\": \"$.get('event_code') or None\"\n },\n \"outputs\": {\n \"sync-nba-embeds-status\": \"$.get('workflow-status', False)\"\n }\n }\n ],\n \"status\": \"inactive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api-address}.org.machina.gg/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-new-agent\",\n \"title\": \"My New Agent\",\n \"description\": \"Your agent description\",\n \"context\": {\n \"config-frequency\": 0.04\n },\n \"workflows\": [\n {\n \"name\": \"sync-nba-embeds\",\n \"description\": \"sync-nba-embeds\",\n \"inputs\": {\n \"event_code\": \"$.get('event_code') or None\"\n },\n \"outputs\": {\n \"sync-nba-embeds-status\": \"$.get('workflow-status', False)\"\n }\n }\n ],\n \"status\": \"inactive\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "67db52c32ae92018b93310a1"
},
"meta": {
"code": 200
},
"status": "success"
}Authorizations
API key authentication
Body
application/json
Unique identifier for the agent
Display title of the agent
Detailed description of the agent's purpose
Configuration settings for the agent
Array of workflow definitions
Show child attributes
Show child attributes
Current status of the agent
Available options:
active, inactive ⌘I

