Introduction
The Mission Control API is a REST API for orchestrating AI agents, managing tasks, tracking token usage, and monitoring system health. All endpoints return JSON and follow OpenAPI 3.1.0 specifications.Base URL
The API is served from the same host as your Mission Control dashboard:The API uses relative URLs (
/) in the OpenAPI specification. All endpoints are prefixed with /api/.Architecture
Mission Control is built on:- Framework: Next.js 16 App Router
- Database: SQLite with better-sqlite3 (WAL mode)
- Real-time: WebSocket + Server-Sent Events (SSE)
- Authentication: Session cookies + API keys + OAuth
- Validation: Zod schemas with detailed error messages
Tech Stack
| Component | Technology |
|---|---|
| Framework | Next.js 16 |
| Language | TypeScript 5.7 |
| Database | SQLite (WAL mode) |
| State Management | Zustand 5 |
| Charts | Recharts 3 |
| Testing | Vitest + Playwright |
API Versioning
- Current Version
- Compatibility
Version 1.2.0The current API version is
1.2.0. Mission Control follows semantic versioning:- Major: Breaking changes to request/response formats
- Minor: New endpoints or optional parameters
- Patch: Bug fixes and security updates
Rate Limiting
API-wide rate limiting is enforced to prevent abuse:- Default limit: 100 requests per minute per IP
- Trusted proxies: Configure
MC_TRUSTED_PROXIESfor X-Forwarded-For parsing - Rate limit headers: Check
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset
Rate Limit Response
When rate limited, you’ll receive:429 Too Many Requests
Request Format
AllPOST, PUT, and PATCH requests must include:
Example Request
Response Format
All responses return JSON with consistent error structures.Success Response
Error Response
HTTP Status Codes
Mission Control uses standard HTTP status codes:| Code | Meaning | Description |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid request body or parameters |
401 | Unauthorized | Authentication required |
403 | Forbidden | Insufficient permissions for this operation |
404 | Not Found | Resource does not exist |
409 | Conflict | Resource already exists (e.g., duplicate username) |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server error (check logs) |
Pagination
Endpoints that return lists support pagination:Parameters
limit: Number of items per page (default: 50, max: 200)offset: Number of items to skip (default: 0)
Example
Response
Filtering
Many endpoints support query parameters for filtering:Agents
Tasks
Token Usage
CSRF Protection
Mutating requests (POST, PUT, DELETE, PATCH) validate the Origin header:
- Origin must match the request host
- Prevents cross-site request forgery attacks
- Session cookie authentication only
API key authentication bypasses CSRF checks since keys are sent in headers, not cookies.
Network Access Control
In production, Mission Control enforces host allowlists:Environment Variables
Host Patterns
mission-control.example.com- Exact match*.example.com- Wildcard subdomain (matchesa.example.com, notexample.com)192.168.*- IP prefix match
Real-time Updates
Mission Control provides real-time updates via:Server-Sent Events (SSE)
WebSocket (Gateway)
For OpenClaw gateway connections:OpenAPI Specification
Download the full OpenAPI 3.1.0 specification:Next Steps
Authentication
Learn about session cookies, API keys, and OAuth
Agents
Manage agent lifecycle and status
Tasks
Create and track agent tasks
Tokens
Monitor token usage and costs