curl --request POST \
--url 'https://api.hexelstudio.com/v1/harness/swarms' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header 'X-Workspace-Id: X_WORKSPACE_ID' \
--header 'X-Environment-Id: X_ENVIRONMENT_ID' \
--header 'Content-Type: application/json' \
--data '{
"pattern": "map",
"goal": "string",
"agent": "string",
"worker_agent": "string",
"items": [
"string"
],
"inputs": {},
"reduce": {
"agent": "string",
"goal": "string"
},
"stages": [
{
"name": "string",
"goal": "string",
"agent": "string",
"mode": "each"
}
],
"board": {
"items": [
{
"key": "string",
"inputs": "string"
}
],
"members": 0,
"item_ttl_s": 0,
"max_item_attempts": 0,
"on_item_failure": "string"
},
"access": {
"capabilities": [
"string"
]
},
"budget": {
"max_usd": 0,
"max_estimate_usd": 0
},
"member_budget": {
"max_usd": 0,
"max_steps": 0,
"max_tokens": 0,
"max_wall_clock_s": 0,
"max_estimate_usd": 0
},
"max_concurrency": 0,
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string"
},
"sandbox_template": "string"
}'
const res = await fetch("https://api.hexelstudio.com/v1/harness/swarms", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"pattern": "map",
"goal": "string",
"agent": "string",
"worker_agent": "string",
"items": [
"string"
],
"inputs": {},
"reduce": {
"agent": "string",
"goal": "string"
},
"stages": [
{
"name": "string",
"goal": "string",
"agent": "string",
"mode": "each"
}
],
"board": {
"items": [
{
"key": "string",
"inputs": "string"
}
],
"members": 0,
"item_ttl_s": 0,
"max_item_attempts": 0,
"on_item_failure": "string"
},
"access": {
"capabilities": [
"string"
]
},
"budget": {
"max_usd": 0,
"max_estimate_usd": 0
},
"member_budget": {
"max_usd": 0,
"max_steps": 0,
"max_tokens": 0,
"max_wall_clock_s": 0,
"max_estimate_usd": 0
},
"max_concurrency": 0,
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string"
},
"sandbox_template": "string"
}),
})
const data = await res.json()
import os
import requests
res = requests.post(
"https://api.hexelstudio.com/v1/harness/swarms",
headers={"Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}"},
json={
"pattern": "map",
"goal": "string",
"agent": "string",
"worker_agent": "string",
"items": [
"string",
],
"inputs": {},
"reduce": {
"agent": "string",
"goal": "string",
},
"stages": [
{
"name": "string",
"goal": "string",
"agent": "string",
"mode": "each",
},
],
"board": {
"items": [
{
"key": "string",
"inputs": "string",
},
],
"members": 0,
"item_ttl_s": 0,
"max_item_attempts": 0,
"on_item_failure": "string",
},
"access": {
"capabilities": [
"string",
],
},
"budget": {
"max_usd": 0,
"max_estimate_usd": 0,
},
"member_budget": {
"max_usd": 0,
"max_steps": 0,
"max_tokens": 0,
"max_wall_clock_s": 0,
"max_estimate_usd": 0,
},
"max_concurrency": 0,
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string",
},
"sandbox_template": "string",
},
)
data = res.json()
{
"agent": "string",
"board": "string",
"budget": "string",
"capabilities": [
"string"
],
"created_at": "2026-01-01T00:00:00Z",
"created_by": "string",
"end_reason": "string",
"environment_id": "string",
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string"
},
"goal": "string",
"goal_digest": "string",
"id": "string",
"max_concurrency": 0,
"member_budget": "string",
"org_id": "string",
"outputs": "string",
"pattern": "map",
"progress": {
"blocked": 0,
"budget_usd": 0,
"cancelled": 0,
"cost_usd": 0,
"done": 0,
"escalated": 0,
"failed": 0,
"items": {
"done": 0,
"failed": 0,
"open": 0,
"total": 0
},
"queued": 0,
"skipped": 0,
"stages": [
{
"done": 0,
"failed": 0,
"skipped": 0,
"stage": "string",
"state": "string",
"total": 0,
"working": 0
}
],
"summary": "string",
"total": 0,
"working": 0
},
"reduce": "string",
"sandbox_template": "string",
"stages": "string",
"state": "running",
"updated_at": "2026-01-01T00:00:00Z",
"waiting_reason": "string",
"worker_agent": "string",
"workspace_id": "string"
}