Skip to content

AI Integration Manifest

This is the single source of truth for any AI agent — Gemini, Claude, GPT, or any LLM — operating within Acrobi Cortex. If you are an AI agent, read this document before making any API calls.

How to Read This Manifest

Parse this document in order:

  1. Authentication Protocol (Section 1) — How to identify yourself and obtain credentials
  2. Endpoint Registry (Section 2) — All available API operations grouped by domain
  3. Request/Response Examples (Section 3) — Complete curl + JSON pairs for the five most common operations
  4. Event System (Section 4) — Webhook and WebSocket events you can subscribe to
  5. State Management (Section 5) — How to report your status so the platform knows you are alive
  6. Capability Model (Section 6) — What operations you are permitted to perform
  7. Capabilities Matrix (Section 7) — Quick lookup: full access, read-only, and not-yet-available

Quick Reference

PropertyValue
Base URLhttps://api.cortex.acrobi.com
API Version1.0.3
AuthJWT Bearer token or API Key
Content-Typeapplication/json
Rate LimitingPer-user, per-tier; limits returned in X-RateLimit-* response headers
WebSocketwss://api.cortex.acrobi.com/api/ws?token=<JWT>
SSE StreamingGET /api/streaming/agents/:name/stream

1. Authentication Protocol

Cortex supports three authentication methods. Choose the one appropriate to your deployment context.

Method 1: JWT Bearer Token

Algorithm: HS256. Lifetime: 30 days. Refresh with POST /api/auth/refresh.

bash
# Obtain token
curl -X POST https://api.cortex.acrobi.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "agent@example.com", "password": "your-password"}'
# Response: { "token": "eyJ...", "refreshToken": "eyJ..." }

# Use token on every request
curl https://api.cortex.acrobi.com/api/agents \
  -H "Authorization: Bearer eyJ..."

Method 2: API Key

Long-lived keys stored as SHA-256 hashes server-side. Prefix: sk-ctx-.

X-API-Key: sk-ctx-abc123def456...

Available scopes: read, write, admin. Manage keys at POST /api/auth/api-keys.

Method 3: Scope Headers

Many endpoints are scope-aware. Without these headers, requests default to the authenticated user's personal workspace.

HeaderPurposeExample
X-Organization-IdTarget organizationorg-abc123
X-Project-IdNarrow to a specific projectproj-def456
x-scope-typeOverride scope resolutionorganization | project | user

Agent Identity Headers

When an AI agent calls the API on its own behalf, include these headers so activity is attributed correctly in logs, dashboards, and the activity feed:

HeaderPurposeExample
X-Agent-DefinitionAgent type/rolecoder-agent
X-Agent-Instance-IdUnique instance identifierinst-789xyz
X-Agent-Display-NameHuman-readable labelBackend Coder #3
X-Agent-Owner-IdUser who owns this agentuser-123

2. Complete API Endpoint Registry

All endpoints require Authorization: Bearer <JWT> or X-API-Key: sk-ctx-... unless noted otherwise. The Auth column shows JWT/Key for standard auth and None for public endpoints.

Agents (16 endpoints)

MethodPathDescriptionAuthMutating
GET/api/agentsList agents in catalogJWT/KeyNo
POST/api/agentsCreate agent definitionJWT/KeyYes
GET/api/agents/:nameGet agent by nameJWT/KeyNo
PATCH/api/agents/:nameUpdate agent configJWT/KeyYes
DELETE/api/agents/:nameDelete agentJWT/KeyYes
GET/api/agents/:name/skillsList assigned skillsJWT/KeyNo
POST/api/agents/:name/skills/:skillIdAssign skill to agentJWT/KeyYes
DELETE/api/agents/:name/skills/:skillIdUnassign skillJWT/KeyYes
PATCH/api/agents/:name/soulUpdate SOUL (values/traits)JWT/KeyYes
POST/api/agents/:name/executeTrigger execution with inputJWT/KeyYes
POST/api/agents/:name/delegateDelegate task to this agentJWT/KeyYes
GET/api/agents/executionsList executions across all agentsJWT/KeyNo
GET/api/agents/:name/executionsList executions for one agentJWT/KeyNo
GET/api/agents/:name/executions/:idGet execution detail + outputJWT/KeyNo
GET/api/agents/:name/metricsPerformance metrics (latency, success)JWT/KeyNo
POST/api/agents/:name/self-improveTrigger self-improvement cycleJWT/KeyYes

Skills (6 endpoints)

MethodPathDescriptionAuthMutating
GET/api/skillsList all skillsJWT/KeyNo
POST/api/skillsCreate skillJWT/KeyYes
GET/api/skills/:idGet skill detailJWT/KeyNo
PATCH/api/skills/:idUpdate skillJWT/KeyYes
DELETE/api/skills/:idDelete skillJWT/KeyYes
POST/api/skills/:id/testRun skill test harnessJWT/KeyYes

Tasks (5 endpoints)

MethodPathDescriptionAuthMutating
GET/api/kanban-tasksList tasks (scope-aware)JWT/KeyNo
POST/api/kanban-tasksCreate taskJWT/KeyYes
GET/api/kanban-tasks/:idGet task detailJWT/KeyNo
PATCH/api/kanban-tasks/:idUpdate task (status, assignment, etc.)JWT/KeyYes
DELETE/api/kanban-tasks/:idDelete taskJWT/KeyYes

Valid statuses: backlog, assigned, in_progress, qa_review, up_for_review, done

Swarms (13 endpoints)

MethodPathDescriptionAuthMutating
GET/api/swarmsList swarmsJWT/KeyNo
POST/api/swarmsCreate swarmJWT/KeyYes
GET/api/swarms/:idGet swarm detailJWT/KeyNo
PATCH/api/swarms/:idUpdate swarm configJWT/KeyYes
DELETE/api/swarms/:idDelete swarmJWT/KeyYes
PATCH/api/swarms/:id/statusChange swarm statusJWT/KeyYes
GET/api/swarms/:id/metricsSwarm performance metricsJWT/KeyNo
GET/api/swarms/:id/agentsList agents in swarmJWT/KeyNo
POST/api/swarms/:id/agentsAdd agent to swarmJWT/KeyYes
DELETE/api/swarms/:id/agents/:agentIdRemove agent from swarmJWT/KeyYes
GET/api/swarms/:id/tasksList swarm tasksJWT/KeyNo
POST/api/swarms/:id/tasksCreate swarm taskJWT/KeyYes
PATCH/api/swarms/:id/tasks/:taskIdUpdate swarm taskJWT/KeyYes

Integrations (7 endpoints)

MethodPathDescriptionAuthMutating
GET/api/integrationsList integrationsJWT/KeyNo
POST/api/integrationsAdd integrationJWT/KeyYes
GET/api/integrations/:idGet integration detailJWT/KeyNo
PATCH/api/integrations/:idUpdate integrationJWT/KeyYes
DELETE/api/integrations/:idRemove integrationJWT/KeyYes
POST/api/integrations/:id/syncTrigger manual syncJWT/KeyYes
GET/api/integrations/:id/testTest connection healthJWT/KeyNo

Supported providers: github, discord, slack, notion, linear, gmail, zapier, webhook, custom

Webhooks (6 endpoints)

MethodPathDescriptionAuthMutating
POST/api/webhooks/registerRegister new webhookJWT/KeyYes
GET/api/webhooksList registered webhooksJWT/KeyNo
GET/api/webhooks/:idGet webhook detailJWT/KeyNo
DELETE/api/webhooks/:idDelete webhookJWT/KeyYes
POST/api/webhooks/:id/testSend test payload to URLJWT/KeyYes
GET/api/webhooks/:id/deliveriesDelivery history + status codesJWT/KeyNo

Agent Status (6 endpoints)

MethodPathDescriptionAuthMutating
POST/api/agent-statusReport a status eventJWT/KeyYes
POST/api/agent-status/heartbeatUpsert heartbeat (keep-alive)JWT/KeyYes
GET/api/agent-statusList recent status reportsJWT/KeyNo
GET/api/agent-status/summaryAll agents with current status countsJWT/KeyNo
GET/api/agent-status/liveActive agents only (working/idle)JWT/KeyNo
GET/api/agent-status/:agentNameStatus history for one agentJWT/KeyNo

Memories (8 endpoints — scope-aware)

All memory endpoints respect X-Organization-Id and X-Project-Id headers to isolate data.

MethodPathDescriptionAuthMutating
POST/api/memories/bulkBulk store multiple entriesJWT/KeyYes
GET/api/memories/searchSemantic / FTS searchJWT/KeyNo
GET/api/memories/statsMemory count, type breakdownJWT/KeyNo
GET/api/memoriesList memories (paginated)JWT/KeyNo
POST/api/memoriesStore single memory entryJWT/KeyYes
GET/api/memories/:idGet memory by IDJWT/KeyNo
PATCH/api/memories/:idUpdate memory contentJWT/KeyYes
DELETE/api/memories/:idDelete memoryJWT/KeyYes

LLM Providers (6 endpoints)

MethodPathDescriptionAuthMutating
GET/api/llm/providersList configured providersJWT/KeyNo
POST/api/llm/providersAdd provider + API keyJWT/KeyYes
GET/api/llm/providers/:idGet provider detailJWT/KeyNo
PATCH/api/llm/providers/:idUpdate provider configJWT/KeyYes
DELETE/api/llm/providers/:idRemove providerJWT/KeyYes
POST/api/llm/providers/:id/testValidate connection + credentialsJWT/KeyNo

Supported provider types (16+): openai, anthropic, google, xai, mistral, deepseek, cohere, openrouter, ollama, groq, cerebras, moonshot, minimax, nvidia, claude-code, custom

Conversations (5 endpoints)

Stored with FTS5 full-text indexing for fast search across all agent conversations.

MethodPathDescriptionAuthMutating
POST/api/conversations/storeStore a conversation messageJWT/KeyYes
GET/api/conversations/searchFull-text search across conversationsJWT/KeyNo
GET/api/conversations/:agentIdList conversations for an agentJWT/KeyNo
GET/api/conversations/:agentId/overviewSummarized viewJWT/KeyNo
GET/api/conversations/:agentId/expandExpand a summary to messagesJWT/KeyNo

Cron Jobs (4 endpoints)

MethodPathDescriptionAuthMutating
GET/api/cron-jobsList scheduled jobsJWT/KeyNo
POST/api/cron-jobsCreate cron jobJWT/KeyYes
PATCH/api/cron-jobs/:idUpdate schedule or payloadJWT/KeyYes
DELETE/api/cron-jobs/:idRemove jobJWT/KeyYes

Documents (5 endpoints)

MethodPathDescriptionAuthMutating
GET/api/documentsList documents (scope-aware)JWT/KeyNo
POST/api/documentsCreate documentJWT/KeyYes
GET/api/documents/:idGet document with full contentJWT/KeyNo
PATCH/api/documents/:idUpdate title or contentJWT/KeyYes
DELETE/api/documents/:idDelete documentJWT/KeyYes

Supported types: markdown, code, text, json, yaml, html, css

Additional Domains

The following route groups are part of the API but not expanded here. Each follows the same { success, data } / { error } response convention.

Path PrefixDescription
/api/auth/*Login, register, refresh token, forgot/reset password, 2FA (TOTP + SMS), API key management
/api/organizations/*Org CRUD, member invites, role assignment
/api/projects/*Project CRUD, cover images
/api/settings/*User preferences, notification settings
/api/dashboard/*Summary metrics, widget data
/api/marketplace/*Publish, search, install agents from marketplace
/api/knowledge-graph/*Graph nodes, edges, traversal queries
/api/ideas/*Idea capture and pipeline management
/api/content/*Content sources (YouTube transcripts, articles)
/api/rbac/*Role-based access control — roles, permissions, grants
/api/persistent-agents/*Long-lived agent instances with scheduled wake-ups
/api/sandbox/*Isolated execution sandbox for untrusted agent code
/api/agent-capabilities/*Capability profiles, resolve effective permissions
/api/agent-health/*Health checks, degraded-mode detection
/api/browser/*Browser automation — navigate, screenshot, scrape
/api/scheduled-agents/*Agent scheduling via cron expressions
/api/agent-versions/*Version history, rollback
/api/sessions/*Session management for multi-turn agents
/api/qmd/*QMD (Query/Mutate/Delegate) search protocol
/api/mission/*Mission Control — high-level objective tracking
/api/evals/*LLM evaluation runs and scoring
/api/collaboration/*Real-time multi-agent collaboration sessions
/api/notifications/*Notification center, delivery preferences
/api/graphqlGraphQL API (mirrors REST; useful for complex queries)
/api/workflows/*Workflow orchestration — DAG-based pipelines
/api/streaming/*SSE streaming for long-running agent outputs
/api/oauth/*OAuth 2.0 — authorize, callback, token exchange
/api/feature-flags/*Runtime feature flag evaluation
/api/billing/*Subscriptions, usage records, invoices
/api/mobile/*Mobile-optimized API (compact responses)

3. Critical Request/Response Examples

The five most common operations an AI agent will need to perform. All examples assume $TOKEN is a valid JWT.

Example 1: Create an Agent

bash
curl -X POST https://api.cortex.acrobi.com/api/agents \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-coder-agent",
    "displayName": "My Coder Agent",
    "description": "Implements features and fixes bugs with self-testing quality gates",
    "category": "development",
    "model": "claude-sonnet-4-20250514",
    "status": "active",
    "systemPrompt": "You are an expert TypeScript developer. Always run tsc and eslint before marking work complete.",
    "capabilities": ["code_review", "implementation", "testing"]
  }'

Response 201 Created:

json
{
  "success": true,
  "data": {
    "id": "agent-abc123",
    "name": "my-coder-agent",
    "displayName": "My Coder Agent",
    "category": "development",
    "model": "claude-sonnet-4-20250514",
    "status": "active",
    "createdAt": "2026-04-03T12:00:00.000Z"
  }
}

Example 2: Execute an Agent

bash
curl -X POST https://api.cortex.acrobi.com/api/agents/my-coder-agent/execute \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "task-456",
    "input": "Implement the login page with email/password authentication",
    "context": { "projectId": "proj-123", "stack": "Next.js 15, TypeScript" }
  }'

Response 200 OK:

json
{
  "success": true,
  "data": {
    "executionId": "exec-789",
    "agentName": "my-coder-agent",
    "status": "running",
    "startedAt": "2026-04-03T12:01:00.000Z"
  }
}

Poll execution status at GET /api/agents/my-coder-agent/executions/exec-789 or subscribe via WebSocket for real-time updates.

Example 3: Create a Task

bash
curl -X POST https://api.cortex.acrobi.com/api/kanban-tasks \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Project-Id: proj-123" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Implement login page",
    "description": "Build email/password login with JWT authentication",
    "status": "backlog",
    "priority": "high",
    "assigned_agent": "my-coder-agent",
    "project_id": "proj-123"
  }'

Response 201 Created:

json
{
  "success": true,
  "data": {
    "id": "task-456",
    "title": "Implement login page",
    "status": "backlog",
    "priority": "high",
    "assigned_agent": "my-coder-agent",
    "project_id": "proj-123",
    "createdAt": "2026-04-03T12:00:00.000Z"
  }
}

Example 4: Report Agent Status

Call this whenever your status changes. Also send a heartbeat every 30 seconds while working.

bash
curl -X POST https://api.cortex.acrobi.com/api/agent-status \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agentName": "my-coder-agent",
    "status": "working",
    "message": "Implementing login form component — 40% complete",
    "taskId": "task-456",
    "metadata": { "progress": 0.4, "filesChanged": 2, "phase": "implementation" }
  }'

Response 200 OK:

json
{ "success": true, "id": "status-report-789" }

Valid status values: idle, working, completed, blocked, error

Example 5: Register a Webhook

bash
curl -X POST https://api.cortex.acrobi.com/api/webhooks/register \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/cortex-webhook",
    "events": ["agent.completed", "agent.failed", "task.status_changed"],
    "secret": "min-32-char-webhook-signing-secret"
  }'

Response 201 Created:

json
{
  "success": true,
  "data": {
    "id": "wh-abc123",
    "url": "https://your-server.com/cortex-webhook",
    "events": ["agent.completed", "agent.failed", "task.status_changed"],
    "createdAt": "2026-04-03T12:00:00.000Z"
  }
}

4. Event System

Webhook Events (6 events)

Register a target URL via POST /api/webhooks/register (see Example 5 above). Cortex will deliver a POST to your URL for each subscribed event.

EventTrigger
task.createdA new task was created
task.completedTask status transitioned to done
task.status_changedAny other task status transition
agent.spawnedAn agent execution was started
agent.completedAn agent execution completed successfully
agent.failedAn agent execution errored

Webhook Signature Verification

Every delivery includes these request headers for HMAC-SHA256 authentication:

HeaderValue
X-Cortex-Signaturesha256=<HMAC-SHA256 of raw body using your webhook secret>
X-Cortex-EventEvent name, e.g. agent.completed
X-Cortex-DeliveryUnique UUID for this delivery attempt
X-Cortex-TimestampUnix timestamp of delivery

To verify: compute HMAC-SHA256(rawBody, webhookSecret), hex-encode it, and compare to the value after sha256= in X-Cortex-Signature. Reject deliveries that fail verification or have a timestamp older than 5 minutes.

WebSocket Activity Events (18+ event types)

Connect to: wss://api.cortex.acrobi.com/api/ws?token=<JWT>

After connecting, subscribe to channels:

json
{ "type": "subscribe", "channelId": "agent:my-coder-agent" }
{ "type": "subscribe", "channelId": "swarm:swarm-123" }
{ "type": "subscribe", "channelId": "project:proj-456" }

Full list of activity events:

EventDescription
agent.spawnedAgent execution started
agent.completedAgent execution finished
agent.failedAgent execution errored
agent.statusAgent status update (working, blocked, etc.)
task.createdNew task created
task.status_changedTask status changed
task.updatedTask fields updated
task.deletedTask removed
chief.plan.createdChief Coordinator produced an execution plan
chief.task.assignedChief assigned a task to an agent
chief.task.progressProgress update from Chief
swarm.phase.startedSwarm entered a new phase
swarm.phase.completedSwarm phase finished
swarm.phase.failedSwarm phase errored
gate.passedA quality gate check passed
gate.failedA quality gate check failed
chat.messageNew chat message from agent or user

See WebSocket for full protocol and message schema documentation.


5. State Management

Cortex uses three complementary tiers for agent state. An agent should use all three to ensure visibility in dashboards, logs, and real-time feeds.

Tier 1: Database-Backed Status (mandatory)

Every status change and every heartbeat is stored in the database and visible in the Mission Control dashboard.

bash
# Report a status change
POST /api/agent-status
{
  "agentName": "my-coder-agent",
  "status": "working",           # idle | working | completed | blocked | error
  "message": "Running tsc check",
  "taskId": "task-456",
  "metadata": { "progress": 0.7 }
}

# Heartbeat — send every 30 seconds while running (prevents stale "live" entries)
POST /api/agent-status/heartbeat
{
  "agentName": "my-coder-agent",
  "status": "working",
  "currentTask": "task-456"
}

Agents that stop sending heartbeats are automatically marked as offline after 90 seconds.

Tier 2: WebSocket Real-Time

Connect to wss://api.cortex.acrobi.com/api/ws?token=<JWT> to:

  • Receive events from other agents and the Chief Coordinator in real-time
  • Discover newly assigned tasks without polling
  • Observe swarm phase transitions and gate results

This is the fastest path for agent-to-agent coordination. A coder agent waiting for QA approval should subscribe to gate.passed / gate.failed events rather than polling GET /api/kanban-tasks/:id.

Tier 3: SSE Streaming

For long-running agent outputs (code generation, research reports, etc.) that need to stream back to a UI or calling process:

GET /api/streaming/agents/:name/stream
Authorization: Bearer <JWT>
Accept: text/event-stream

The server sends data: events as the agent produces output. Use this when you need incremental delivery rather than a single response payload.


6. Capability and Permission Model

Overview

Cortex has 56 granular capabilities across 13 categories. Every API call is checked against the calling agent's resolved capability set.

Access levels:

LevelNameBehavior
0noneOperation blocked — returns 403 Forbidden
1readGET/list operations only
2writeRead + create/update/delete (dangerous ops require explicit confirmation)
3autonomousFull access including dangerous operations without confirmation

Dangerous Capabilities (10)

These 10 capabilities require autonomous access level or explicit write confirmation:

agent.delete, agent.execute (with external network), swarm.delete, swarm.execute (parallel spawning), integration.delete, memory.delete_all, document.delete, cron.delete, webhook.delete, sandbox.escape_policy

Preset Profiles (7)

ProfileKey CapabilitiesTypical Assignment
ChiefAll at autonomousChief Coordinator only
Coderagent.execute, task.update, document.write, skill.readDevelopment agents
Testertask.read/update, agent.read, memory.readQA agents
Researchermemory.write, knowledge-graph.write, document.writeResearch agents
Architectagent.create/update, swarm.create, skill.createArchitect agents
PMtask.* (all), swarm.read, agent.readProject manager agents
ViewerAll domains at readReporting/analytics agents

Effective Permission Resolution

Effective permissions are the intersection of four layers. An agent can never exceed the most restrictive layer:

effective = definition_capabilities ∩ instance_overrides ∩ project_policy ∩ workspace_policy

To check your effective capabilities at runtime:

bash
POST /api/agent-capabilities/resolve
{
  "agentName": "my-coder-agent",
  "scope": "project",
  "entityId": "proj-123"
}

Response includes the resolved capability map plus any warnings about restricted operations.

See Capabilities for the full 56-capability list and Capability Control for the full access-level system and override mechanics.


7. Capabilities Matrix

Quick reference for what AI agents can do today.

Full Access (Read and Write)

DomainOperations
AgentsCreate, read, update, delete, execute, delegate, self-improve
TasksCreate, read, update, delete, assign, transition status
SkillsCreate, read, update, delete, test
SwarmsCreate, read, update, delete, execute, manage agents/tasks
IntegrationsCreate, read, update, delete, sync, test
WebhooksRegister, list, delete, test, view deliveries
MemoriesBulk store, search, CRUD, stats (scope-isolated)
LLM ProvidersAdd, configure, update, remove, test
ConversationsStore, search FTS5, list, summarize, expand
DocumentsCreate, read, update, delete (all document types)
Cron JobsCreate, update, delete, list
Agent StatusReport, heartbeat, list, summarize

Read-Only

DomainNotes
Execution logsGET /api/agents/:name/executions — no cancel or replay endpoint yet
Agent metricsPerformance and success-rate stats
Swarm metricsPhase timing, task completion rates
Webhook delivery historyDelivery status codes only; no replay
Audit logAppend-only by design
Activity feedGET /api/activity-feed — aggregate event stream
Dashboard summaryGET /api/dashboard — read-only aggregations
System healthGET /api/health — no auth required

Not Yet Available

These capabilities are documented in Gap Analysis as known missing features:

Missing CapabilityWorkaround
Agent self-registrationRegister via human user or Chief Coordinator
Config self-updateUse PATCH /api/agents/:name via an authorized orchestrator
Task dependency graphUse metadata field to encode dependency info manually
Bi-directional agent messagingUse WebSocket channel subscriptions
Secret self-managementSecrets managed by human admins via wrangler secret put
Execution cancel/replayMonitor via WebSocket; no cancel endpoint yet
Task checkpointingStore progress in memories as a manual workaround

Built by Acrobi