API Reference

All endpoints are served by the Identity API on port 8000. Admin endpoints require X-Admin-API-Key header.

Blueprints

MethodPathAuthDescription
POST/v1/blueprintsAdminCreate a blueprint
GET/v1/blueprintsList all blueprints
GET/v1/blueprints/{id}Get blueprint by ID
PUT/v1/blueprints/{id}AdminUpdate blueprint
POST/v1/blueprints/{id}/activateAdminActivate blueprint
POST/v1/blueprints/{id}/deactivateAdminDeactivate blueprint

Example request:

curl -X POST http://localhost:8000/v1/blueprints 
  -H "X-Admin-API-Key: dev-admin-key-change-in-production" 
  -H "Content-Type: application/json" 
  -d '{"slug": "research-agent", "name": "Research Agent", "max_scopes": ["repo:read"]}'

Agents

MethodPathAuthDescription
POST/v1/agentsAdminRegister an agent
GET/v1/agentsList agents (filter by blueprint_id, status)
GET/v1/agents/{id}Get agent by ID
POST/v1/agents/{id}/activateAdminActivate agent
POST/v1/agents/{id}/suspendAdminSuspend agent
POST/v1/agents/{id}/revokeAdminRevoke agent
POST/v1/agents/{id}/rotate-keyAdminRotate agent public key

Lifecycle state machine:

draft → pending_approval → active → suspended → revoked
                                      ↓
                                decommissioned

Only active agents can create sessions.

Delegations

MethodPathAuthDescription
POST/v1/delegationsAdminCreate delegation grant
GET/v1/delegations/{id}Get delegation
POST/v1/delegations/{id}/revokeAdminRevoke delegation

Sessions

MethodPathAuthDescription
POST/v1/sessionsCreate agent session
GET/v1/sessions/{id}Get session status
POST/v1/sessions/{id}/revokeRevoke session

Session creation request:

{
  "agent_id": "uuid",
  "acting_user_id": "string | null",
  "delegation_grant_id": "uuid | null",
  "requested_scopes": ["repo:read"],
  "requested_ttl_seconds": 900,
  "model_id": "deepseek-chat",
  "prompt_version": "v1",
  "runtime_attestation": {
    "agent_id": "uuid",
    "container_digest": "sha256:...",
    "git_commit": "abc123",
    "environment": "development",
    "host_id": "docker-local-01",
    "framework": "hermes",
    "framework_version": "0.4.0",
    "model": "deepseek-chat",
    "prompt_version": "v1",
    "issued_at": "2026-07-10T16:00:00Z",
    "nonce": "random-value",
    "signature": "hex-encoded-signature"
  }
}

Authorization

MethodPathAuthDescription
POST/v1/authorizeSession tokenEvaluate tool access policy

Request:

{
  "session_token": "eyJ...",
  "tool": "github",
  "operation": "search_code",
  "resource": {"repository": "rmax-ai/example"}
}

Response:

{
  "decision": "allow",
  "effective_scopes": ["repo:read"],
  "reason": "Permission intersection satisfied",
  "decision_id": "dec_...",
  "obligations": ["log_request"]
}

Token Broker

MethodPathAuthDescription
POST/v1/token-exchangeInternalIssue downstream credential

Called by the MCP Gateway (not directly by agents). Returns credential metadata for server-side injection.

Audit

MethodPathDescription
GET/v1/audit/eventsList audit events (filter by trace_id, decision)
GET/v1/audit/events/{id}Get audit event by ID
POST/v1/audit/verify-chainVerify tamper-evident hash chain

Verify chain response:

{
  "valid": true,
  "broken_at": null
}

MCP Gateway

MethodPathAuthDescription
GET/POST/mcp/tools/{tool}.{operation}Session tokenProxy tool call through gateway

GET /mcp/tools/github.search_code — proxy with Authorization: Bearer <session-token> header.

Common Response Codes

CodeMeaning
201Resource created
200Success
400Bad request (validation, lifecycle constraint)
401Unauthorized (missing/invalid admin key or session token)
403Forbidden (policy denied)
404Resource not found
409Conflict (duplicate slug)