Collaborations API
Create, configure and run multi-agent collaborations (sequential, router, parallel, debate), follow their executions and send their reports.
Overview
A collaboration runs several agents together on one request. It has a pattern (sequential, router, parallel or debate), a list of members (agents with a role), and a config object with cost and reliability settings. Each run is recorded as an execution with a per-step trace and a final output, which can be rendered as a report and sent to a notification channel.
All routes use a user session:
bashAPI=https://api.arcanflows.com/api/v1 TOKEN=... # access_token from POST /auth/login TENANT=... # workspace id, sent as X-Active-Tenant
See the Collaborations guide for the concepts and the console UI.
Endpoints
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /api/v1/collaborations | agents.read | List collaborations |
POST | /api/v1/collaborations | agents.create | Create (optionally with members) |
GET | /api/v1/collaborations/:id | agents.read | Get with members |
PUT | /api/v1/collaborations/:id | agents.update | Update |
DELETE | /api/v1/collaborations/:id | agents.delete | Delete |
POST | /api/v1/collaborations/:id/members | agents.update | Add a member |
PUT | /api/v1/collaborations/:id/members/:memberId | agents.update | Update a member |
DELETE | /api/v1/collaborations/:id/members/:memberId | agents.delete | Remove a member |
POST | /api/v1/collaborations/:id/execute | agents.execute | Start a run |
GET | /api/v1/collaborations/:id/executions | agents.read | Recent runs |
GET | /api/v1/collaborations/:id/executions/:execId | agents.read | One run with its trace |
GET | /api/v1/collaborations/:id/executions/:execId/report | agents.read | The run's report (HTML or PDF) |
POST | /api/v1/collaborations/:id/executions/:execId/send | agents.execute | Send the report to a notification channel |
Create a collaboration
POST /api/v1/collaborations returns 201 with the collaboration (without members — fetch it with GET to see them).
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | |
pattern | string | Yes | sequential, router, parallel or debate |
description | string | No | |
config | object | No | See Config reference |
members | array | No | Each {agent_id, role, display_order, config}, as for Add a member. Entries with an invalid agent_id are skipped. |
bashcurl -s -X POST "$API/collaborations" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT" \ -H "Content-Type: application/json" \ -d '{ "name": "Support triage", "pattern": "router", "config": {"max_tokens": 300000}, "members": [ {"agent_id": "ROUTER_AGENT_ID", "role": "router", "display_order": 0}, {"agent_id": "BILLING_AGENT_ID", "role": "participant", "display_order": 1, "config": {"keywords": ["billing", "refund"]}} ] }'
A new collaboration is a draft. Only active collaborations can run: set "status":"active" with PUT before executing.
An invalid pattern returns 400 {"error":"Invalid pattern. Must be: sequential, router, parallel, or debate"}.
Collaboration object
| Field | Notes |
|---|---|
id, tenant_id, name, description | |
pattern | sequential, router, parallel, debate |
config | Object, {} by default |
status | draft, active, paused, archived |
created_by, created_at, updated_at | |
members | Only on GET /api/v1/collaborations/:id, ordered by display_order |
List, get, update, delete
GET /api/v1/collaborationsreturns{"collaborations":[...]}, newest first.GET /api/v1/collaborations/:idreturns the collaboration withmembers, or404 {"error":"Collaboration not found"}.PUT /api/v1/collaborations/:idacceptsname,description,pattern,config(replaces the whole object) andstatus. Omitted fields keep their value. Returns200with the updated collaboration.DELETE /api/v1/collaborations/:idreturns200 {"message":"Collaboration deleted"}.
bashcurl -s -X PUT "$API/collaborations/$COLLAB_ID" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT" \ -H "Content-Type: application/json" -d '{"status":"active"}'
Members
POST /api/v1/collaborations/:id/members returns 201 with the member.
| Field | Required | Notes |
|---|---|---|
agent_id | Yes | An agent of your workspace |
role | No | participant (default), router or synthesizer |
display_order | No | Order of the steps in a sequential run |
config | No | Per-member settings, see below |
A member object has id, collaboration_id, agent_id, agent_name, role, display_order, config, is_enabled and created_at. New members are enabled.
PUT /api/v1/collaborations/:id/members/:memberIdacceptsrole,display_order,configandis_enabled; returns200 {"message":"Member updated"}.DELETE /api/v1/collaborations/:id/members/:memberIdreturns200 {"message":"Member removed"}.
Run a collaboration
POST /api/v1/collaborations/:id/execute
| Field | Required | Notes |
|---|---|---|
message | Yes | The request for the team |
attachments | No | [{"name","type","size","data"}] with base64 data. Documents (PDF, Word, text, CSV, Markdown) are extracted to text; images go to vision-capable agents. |
bashcurl -s -X POST "$API/collaborations/$COLLAB_ID/execute" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT" \ -H "Content-Type: application/json" \ -d '{"message":"A customer wants a refund on order 1234."}'
The run starts in the background. The response is 202 with the execution record in status running; poll GET …/executions/:execId until it is completed or failed. A run is stopped after 15 minutes.
| Status | Body | When |
|---|---|---|
400 | Collaboration is not active. Current status: draft | The collaboration is not active |
400 | Invalid request body: ... | Missing message |
404 | Collaboration not found |
Execution object
| Field | Notes |
|---|---|
id, collaboration_id, tenant_id | |
input_message, pattern | |
status | running, completed, failed |
steps | Per-member trace: agent_id, agent_name, input, output, duration_ms, step_order, tokens_used |
final_output | The result (Markdown) |
total_tokens, total_duration_ms | |
error_message | When failed |
metadata | Run details, e.g. tokens_so_far and, for router runs, routing (the chosen specialist) |
created_at, completed_at |
GET /api/v1/collaborations/:id/executions?limit=20 returns {"executions":[...]}, newest first (default limit 20).
Reports
GET /api/v1/collaborations/:id/executions/:execId/report?format=html renders the run's final_output as a formatted report: format=html (default, text/html) or format=pdf (application/pdf, downloaded as <name>-report.pdf).
bashcurl -s -o report.pdf "$API/collaborations/$COLLAB_ID/executions/$EXEC_ID/report?format=pdf" \ -H "Authorization: Bearer $TOKEN" -H "X-Active-Tenant: $TENANT"
POST /api/v1/collaborations/:id/executions/:execId/send delivers the report through one of your notification channels:
| Field | Required | Notes |
|---|---|---|
channel_id | Yes | A notification channel of your workspace |
recipient | No | Recipient for the channel (for example an email address), when it needs one |
Email channels receive the HTML report; other channels receive the Markdown text. Returns 200 {"success":true,"channel":"...","channel_type":"...","log_id":"..."}. Errors: 400 when the run has no output yet (this execution has no report to send) or channel_id is missing, 404 for an unknown execution or channel, 502 when rendering or delivery fails.
Config reference
Collaboration config:
| Key | Default | Meaning |
|---|---|---|
max_tokens | 300000 | Token ceiling for one run (0 = unlimited) |
max_members | 12 | A run with more enabled members than this fails at once (0 = no limit) |
pass_full_context | false | (sequential) give each step the whole pipeline so far, not only the previous output |
context_char_budget | 12000 | (sequential with pass_full_context) bound on the prior-step context |
classifier_prompt | — | (router) custom classification prompt |
default_member_id | — | (router) fallback specialist |
max_rounds | 2 | (debate) number of rounds, 1 to 5 |
Member config:
| Key | Meaning |
|---|---|
retries | Retry the member up to N times when it errors |
optional | The member's failure does not abort the run |
failure_markers | Strings that mark an output as failed even without an error |
keywords | (router) routing keywords for a specialist |