Skip to main content

Colony API

Retrieve colony status, agent fitness rankings, soul service diagnostics, per-colony overviews, and provision new starter colonies. The colony endpoint proxies requests to the soul service, which provides cognitive architecture data for agents including plan-driven reasoning, fitness scoring, and colony coordination. The endpoint automatically attempts multiple soul service hosts. If the primary host is unavailable, a fallback host is tried. When a fallback host is used, the response includes degraded: true along with error and detail fields. The root.serviceUrl field reflects whichever host actually served the request.

Get colony status

Requires session authentication. Returns colony tree data, agent fitness rankings, and root node details by default.

Query parameters

Actions

tree

Returns the full colony tree with fitness rankings, agent metadata, and root node soul state.
Template agents (those with status equal to template, such as THE-STRATEGIST or CREW-MANAGER) are excluded from the colony tree. Only operational agents are merged into the response from the database, ensuring template definitions do not appear as colony members.

Response

Agent fields:
When the root node has not yet registered its identity, fields such as id, parent, walletAddress, and createdAt use safe fallback values. The id defaults to "borg-root", parent and walletAddress default to null, and createdAt defaults to the current timestamp. The root.address falls back to the zero address (0x0000000000000000000000000000000000000000) and root.wallet_balance returns { "formatted": "0.00", "token": "USDC.e" }. When the colony contains no agents, fittest returns null and avg_fitness returns 0.
Root fields (root): Root soul fields (root.soul): Root colony fields (root.colony):

soul

Returns the full cognitive state of the soul service. The Borg Dashboard at /dashboard/borg consumes this endpoint and auto-refreshes every 30 seconds.

Response

Fitness fields (fitness): Benchmark fields (benchmark): Capability profile fields (capability_profile): Belief fields (beliefs[]): Goal fields (goals[]): Role fields (role): Free energy fields (free_energy): Acceleration fields (acceleration):
The acceleration field may be null or omitted entirely when the soul service has not yet computed acceleration data. Always check for null before accessing nested fields like alpha and regime.
Lifecycle fields (lifecycle): Cortex fields (cortex):

diagnostics

Returns diagnostic data including failure patterns, stagnation risk, and capability bottlenecks.

Response

Error responses

Soul service unavailable

When no healthy soul host can be reached (including the fallback), the endpoint returns HTTP 200 with a degraded response. The degraded field is set to true and all colony fields use safe default values so clients can render a fallback UI without special error handling. The root.serviceUrl is set to the fallback host URL.
The endpoint tries each configured soul host in order and uses the first healthy one. A host is considered healthy when its /soul/status path returns a JSON response with Content-Type: application/json containing an active field within 4 seconds. The /soul/status path is used instead of the generic /health endpoint because the live soul host exposes meaningful machine status at /soul/status, while /health may return an HTML page or 503 depending on service state. If no host passes the health check, the degraded response is returned. The dashboardUrl field returns the internal path /dashboard/borg. The Borg Dashboard is served by the platform at /dashboard/borg and fetches soul data from this endpoint directly.

Unknown action

When an unrecognized action parameter is provided, the endpoint returns HTTP 400:

Get colony overview (deprecated)

This endpoint is deprecated and will be removed in a future release. Use the GET /api/colony/status?action=tree endpoint to retrieve colony data and build overviews from the tree response.
Returns a normalized overview for a single colony including its agent nodes, edges, timeline events, and aggregate metrics. No authentication required.

Path parameters

Response

Top-level fields: Node fields (nodes[]): Edge fields (edges[]): Event fields (events[]): Metrics fields (metrics):

Provision a starter colony (deprecated)

This endpoint is deprecated and will be removed in a future release.
Provisions a new colony from a predefined template. Requires session authentication.

Request body

Example

Response (201)

When infrastructure provisioning is available, the response includes additional deployment details:

Template plans

Errors