Create Squad
curl --request POST \
--url https://api.example.com/squadsimport requests
url = "https://api.example.com/squads"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/squads', 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.example.com/squads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/squads"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/squads")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/squads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodySquads
Create Squad
Creates a new squad in the environment.
POST
/
squads
Create Squad
curl --request POST \
--url https://api.example.com/squadsimport requests
url = "https://api.example.com/squads"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/squads', 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.example.com/squads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/squads"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/squads")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/squads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
POST https://gateway.orkeia.ai/squads
AuthenticationRequires header
authorization: <your_token>.
Request Body (JSON)
The service expects a wrapper with the property squad.
{
"squad": {
"name": "Equipe Alpha",
"tasks": [
{
"id": "TASK_INGEST",
"agent": "AGENT_INGEST",
"name": "Ingestão de Dados",
"objective": "Coletar e normalizar dados de origem externa",
"dependsOn": [],
"coordinates": { "x": 80, "y": 40, "width": 320, "height": 160 }
}
],
"order": "sequential",
"enabled": true,
"do_plan": false,
"sectors": ["engineering"],
"publisher": "Orkeia",
"planningAgent": { "id": "AGENT_PLANNER" },
"supervisor": { "id": "AGENT_SUPERVISOR" }
}
}
Main fields ofSquad
Field Type Required Description name string Yes Friendly name of the squad. tasks Task[]Yes List of tasks orchestrated by the squad. order "sequential"|"hierarchical"Yes Execution strategy of the tasks. enabled boolean Yes Activates/deactivates the squad. do_plan boolean Yes If there is a planning step before execution. sectors string[] Yes Sectors with permission to use the squad. publisher string Yes Publisher/organization responsible. planningAgent { id: string, coordinates? }No (Optional) Agent dedicated to planning. supervisor { id: string, coordinates? }No (Optional) Supervisor/validator agent.
Example (cURL)
curl -X POST "https://gateway.orkeia.ai/squads" -H "authorization: <your_token>" -H "Content-Type: application/json" -d '{
"squad": {
"name": "Equipe Alpha",
"tasks": [
{
"id": "TASK_INGEST",
"agent": "AGENT_INGEST",
"name": "Ingestão de Dados",
"objective": "Coletar e normalizar dados de origem externa",
"dependsOn": [],
"coordinates": { "x": 80, "y": 40, "width": 320, "height": 160 }
}
],
"order": "sequential",
"enabled": true,
"do_plan": false,
"sectors": ["engineering"],
"publisher": "Orkeia",
"planningAgent": { "id": "AGENT_PLANNER" },
"supervisor": { "id": "AGENT_SUPERVISOR" }
}
}'
Responses
Response - Success
response
{
"status": "OK",
"data": { "id": "SQUAD_123456" }
}
500 — Server Error
{
"status": "ERROR",
"code": "server/error",
"data": null
}
400 — Client Error
{
"status": "ERROR",
"code": "client/error",
"data": null
}
Was this page helpful?
⌘I
