Skip to content

External API

The External API lives at:

https://api.consortium.dev/external/v1

A machine-readable spec is published (no auth required) at GET /external/v1/openapi.json.

No install required — the API is plain HTTP with a Bearer token.

Terminal window
export CONSORTIUM_PAT=csm_pat_xxxxxxxxxxxxxxxxxxxx
  • Authenticate with Authorization: Bearer <token> — see Authentication.
  • List endpoints return { "data": [...], "nextCursor": "..." }; cursors are opaque; limit caps at 200.
  • Timestamps are Unix milliseconds.
MethodPathScope
GET/me— (any valid token)
GET/sessionssessions:read
GET/sessions/{id}sessions:read
GET/sessions/{id}/messagessessions:read
POST/sessions/{id}/messagessessions:write
GET/sessions/{id}/messages/{msgId}/contentsessions:content
GET/machinesmachines:read
GET/machines/{id}machines:read
POST/machines/{id}/invokemachines:invoke (PAT-only)
GET/artifacts · /artifacts/{id}artifacts:read
GET/artifacts/{id}/contentartifacts:content
GET/usageusage:read
GET/POST/DELETE/webhooks · /webhooks/{id}webhooks:manage

Writes are relayed to one of your online devices — the server brokers the call and returns what the device replied. Relay calls block up to 30 seconds and have a tighter rate bucket.

Send a message into an active session:

Terminal window
curl -X POST https://api.consortium.dev/external/v1/sessions/$SESSION_ID/messages \
-H "Authorization: Bearer $CONSORTIUM_PAT" \
-H "Content-Type: application/json" \
-d '{"content": "Run the test suite and summarize failures."}'

Run a command on a machine:

Terminal window
curl -X POST https://api.consortium.dev/external/v1/machines/$MACHINE_ID/invoke \
-H "Authorization: Bearer $CONSORTIUM_PAT" \
-H "Content-Type: application/json" \
-d '{"command": "git", "args": ["status"], "cwd": "/home/me/repo", "timeoutMs": 60000}'

Both return:

{ "requestId": "…", "result": { } }

requestId is what to quote in support requests. If no device is online you get 503 no_online_device with a Retry-After header; if the device doesn’t answer in time, 504 timeout. See Errors.

Session messages and artifacts are end-to-end encrypted; metadata endpoints never include content. The …/content endpoints return content only after you create a key grant for the resource from a signed-in device (POST /v1/sessions/{id}/key-grants). Without one they return 403 no_content_grant. Message bodies you send via the relay do transit the server; stored session history remains end-to-end encrypted.

POST /external/v1/webhooks subscribes a URL to event types (the list endpoint reports availableEvents). The response includes the signing secret once. Delivery logs and replay are available in the app’s developer settings.

Per-account quotas, checked on every request and reported in headers X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (plus Retry-After on 429):

BucketDefault
Metadata (reads)600 requests / minute
Relay (writes)60 requests / minute

/external/v1 is the stable prefix. Deprecations are announced in-band: GET /me returns a deprecations array, and affected routes carry deprecation headers ahead of any removal.