Skip to main content
Arcanflows

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:

bash
API=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

MethodPathPermissionPurpose
GET/api/v1/collaborationsagents.readList collaborations
POST/api/v1/collaborationsagents.createCreate (optionally with members)
GET/api/v1/collaborations/:idagents.readGet with members
PUT/api/v1/collaborations/:idagents.updateUpdate
DELETE/api/v1/collaborations/:idagents.deleteDelete
POST/api/v1/collaborations/:id/membersagents.updateAdd a member
PUT/api/v1/collaborations/:id/members/:memberIdagents.updateUpdate a member
DELETE/api/v1/collaborations/:id/members/:memberIdagents.deleteRemove a member
POST/api/v1/collaborations/:id/executeagents.executeStart a run
GET/api/v1/collaborations/:id/executionsagents.readRecent runs
GET/api/v1/collaborations/:id/executions/:execIdagents.readOne run with its trace
GET/api/v1/collaborations/:id/executions/:execId/reportagents.readThe run's report (HTML or PDF)
POST/api/v1/collaborations/:id/executions/:execId/sendagents.executeSend 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).

FieldTypeRequiredNotes
namestringYes
patternstringYessequential, router, parallel or debate
descriptionstringNo
configobjectNoSee Config reference
membersarrayNoEach {agent_id, role, display_order, config}, as for Add a member. Entries with an invalid agent_id are skipped.
bash
curl -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

FieldNotes
id, tenant_id, name, description
patternsequential, router, parallel, debate
configObject, {} by default
statusdraft, active, paused, archived
created_by, created_at, updated_at
membersOnly on GET /api/v1/collaborations/:id, ordered by display_order

List, get, update, delete

  • GET /api/v1/collaborations returns {"collaborations":[...]}, newest first.
  • GET /api/v1/collaborations/:id returns the collaboration with members, or 404 {"error":"Collaboration not found"}.
  • PUT /api/v1/collaborations/:id accepts name, description, pattern, config (replaces the whole object) and status. Omitted fields keep their value. Returns 200 with the updated collaboration.
  • DELETE /api/v1/collaborations/:id returns 200 {"message":"Collaboration deleted"}.
bash
curl -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.

FieldRequiredNotes
agent_idYesAn agent of your workspace
roleNoparticipant (default), router or synthesizer
display_orderNoOrder of the steps in a sequential run
configNoPer-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/:memberId accepts role, display_order, config and is_enabled; returns 200 {"message":"Member updated"}.
  • DELETE /api/v1/collaborations/:id/members/:memberId returns 200 {"message":"Member removed"}.

Run a collaboration

POST /api/v1/collaborations/:id/execute

FieldRequiredNotes
messageYesThe request for the team
attachmentsNo[{"name","type","size","data"}] with base64 data. Documents (PDF, Word, text, CSV, Markdown) are extracted to text; images go to vision-capable agents.
bash
curl -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.

StatusBodyWhen
400Collaboration is not active. Current status: draftThe collaboration is not active
400Invalid request body: ...Missing message
404Collaboration not found

Execution object

FieldNotes
id, collaboration_id, tenant_id
input_message, pattern
statusrunning, completed, failed
stepsPer-member trace: agent_id, agent_name, input, output, duration_ms, step_order, tokens_used
final_outputThe result (Markdown)
total_tokens, total_duration_ms
error_messageWhen failed
metadataRun 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).

bash
curl -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:

FieldRequiredNotes
channel_idYesA notification channel of your workspace
recipientNoRecipient 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:

KeyDefaultMeaning
max_tokens300000Token ceiling for one run (0 = unlimited)
max_members12A run with more enabled members than this fails at once (0 = no limit)
pass_full_contextfalse(sequential) give each step the whole pipeline so far, not only the previous output
context_char_budget12000(sequential with pass_full_context) bound on the prior-step context
classifier_prompt—(router) custom classification prompt
default_member_id—(router) fallback specialist
max_rounds2(debate) number of rounds, 1 to 5

Member config:

KeyMeaning
retriesRetry the member up to N times when it errors
optionalThe member's failure does not abort the run
failure_markersStrings that mark an output as failed even without an error
keywords(router) routing keywords for a specialist