Teams
A Team is a versioned roster: a manager agent plus other members, each member carrying its own delegation policy. Running a team starts the manager's Run and wires the non-manager members in as its sub-agents — so a team run is just a tree of nested Runs over the same event-log substrate as everything else. It reuses phase-1 sub-agent delegation (nested Runs, per-edge approval gate, isolated context); Teams add the versioned roster on top (Decision 0026).
Because a team run rides on Runs, you observe it exactly like any other run: the root run lands on Sessions, and the delegation tree is read back from the run id. The members are ordinary workspace agents — a team is a roster of references to them, not a new kind of actor.
Endpoints
GET /api/v1/workspaces/{slug}/teams → list teams (+ latest roster)
POST /api/v1/workspaces/{slug}/teams → 201, create/version a team (admin)
POST /api/v1/workspaces/{slug}/teams/{team}/runs → 201, run a goal against a team (member)
GET /api/v1/workspaces/{slug}/runs/{runId}/tree → the delegation tree rooted at runId
All four are authenticated with a workspace API key: -H "Authorization: Bearer $HARMONY_KEY". Creating a team requires the admin role; running one requires member.
The team spec
A team is created and re-versioned from a single teamSpec. Every save is an immutable new version; the newest is marked latest.
{
name: string (1–80)
description?: string (≤2000)
process?: "hierarchical" // default "hierarchical"; sequential|swarm deferred (0026)
roster: Member[] (min 2)
}
Each Member:
{
agent: string (workspace agent name, required)
role?: string (≤200)
isManager?: boolean
policy?: "autorun" | "approval" | "let_agent_decide" // default "approval"
description?: string (≤500)
}
The manager is the member flagged isManager: true; if none is flagged, the first roster member is the manager. At most one member may be flagged — more than one is a validation_failed. Every agent named in the roster must already exist in the workspace, or creation fails with validation_failed.
Each non-manager member's policy governs the delegation edge from the manager to that member:
autorun— the manager may delegate without a gate.approval(default) — each delegation pauses for human approval.let_agent_decide— the manager decides whether to gate per call.
List teams
GET /api/v1/workspaces/{slug}/teams returns every team with its latest roster resolved (members carry their effective policy, defaulting to approval).
curl https://platform.groupany.ai/api/v1/workspaces/acme-research/teams \
-H "Authorization: Bearer $HARMONY_KEY"
{
"teams": [
{
"id": "team_…",
"name": "content-squad",
"description": "Researches and drafts long-form pieces.",
"latestVersion": 3,
"manager": "editor-agent",
"members": [
{ "agent": "editor-agent", "role": "editor", "isManager": true, "policy": "approval" },
{ "agent": "research-agent", "role": "researcher", "isManager": null, "policy": "autorun" },
{ "agent": "writer-agent", "role": "drafter", "isManager": null, "policy": "approval" }
]
}
]
}
Create or version a team
POST /api/v1/workspaces/{slug}/teams (admin). Posting a spec for a name that already exists appends a new immutable version and re-points latest; the version number is returned.
curl -X POST https://platform.groupany.ai/api/v1/workspaces/acme-research/teams \
-H "Authorization: Bearer $HARMONY_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "content-squad",
"description": "Researches and drafts long-form pieces.",
"process": "hierarchical",
"roster": [
{ "agent": "editor-agent", "role": "editor", "isManager": true, "policy": "approval" },
{ "agent": "research-agent", "role": "researcher", "policy": "autorun" },
{ "agent": "writer-agent", "role": "drafter", "policy": "approval" }
]
}'
Response 201:
{
"team": { "id": "team_…", "name": "content-squad" },
"version": { "id": "tv_…", "version": 1 },
"manager": "editor-agent",
"uri": "harmony://ws/acme-research/teams/content-squad@1"
}
Run a goal against a team
POST /api/v1/workspaces/{slug}/teams/{team}/runs (member). The body is just the goal; it starts the manager's Run (against the team's latest version) with the non-manager members wired as its sub-agents, each carrying its delegation policy. The call returns immediately with the root run id — the manager's run — and the manager loop proceeds asynchronously.
{ goal: string (1–10000) }
curl -X POST https://platform.groupany.ai/api/v1/workspaces/acme-research/teams/content-squad/runs \
-H "Authorization: Bearer $HARMONY_KEY" \
-H "Content-Type: application/json" \
-d '{
"goal": "Draft a 1500-word brief on the EU AI Act enforcement timeline."
}'
Response 201:
{
"team_run": {
"root_run_id": "run_…",
"manager": "editor-agent"
},
"uri": "harmony://ws/acme-research/runs/run_…"
}
Watch progress on the root run via Sessions (GET /api/v1/sessions/{root_run_id} or its /stream), and the delegation structure via the tree endpoint below. An unknown team name returns not_found.
Read the delegation tree
GET /api/v1/workspaces/{slug}/runs/{runId}/tree returns the run plus its descendants (linked by parentRunId) as a recursive tree. Delegation is shallow, so traversal is bounded. Each node carries the agent name, status, rolled-up cost from the run's projection, start time, and the final-message ref from its session.completed event (or null if not yet completed). This is the multi-agent view of the same Run/event-log substrate that Sessions reads a single run from (Decision 0026).
curl https://platform.groupany.ai/api/v1/workspaces/acme-research/runs/run_…/tree \
-H "Authorization: Bearer $HARMONY_KEY"
Each node has the shape { id, agent, status, cost_usd, started_at, final_message, children }:
{
"tree": {
"id": "run_…",
"agent": "editor-agent",
"status": "active",
"cost_usd": 0.0412,
"started_at": "2026-05-28T19:02:11.000Z",
"final_message": null,
"children": [
{
"id": "run_…",
"agent": "research-agent",
"status": "completed",
"cost_usd": 0.0231,
"started_at": "2026-05-28T19:02:19.000Z",
"final_message": "harmony://…",
"children": []
},
{
"id": "run_…",
"agent": "writer-agent",
"status": "completed",
"cost_usd": 0.0188,
"started_at": "2026-05-28T19:03:02.000Z",
"final_message": "harmony://…",
"children": []
}
]
}
}
The root must belong to the workspace, or the call returns not_found. cost_usd is read from each run's projection and defaults to 0 when absent.