Skip to main content

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:
For production deployments, use your configured hostname:
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

API Versioning

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
Mission Control is alpha software. APIs and database schemas may change between releases. Pin your version and review migration guides when upgrading.

Rate Limiting

API-wide rate limiting is enforced to prevent abuse:
  • Default limit: 100 requests per minute per IP
  • Trusted proxies: Configure MC_TRUSTED_PROXIES for 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:
Status code: 429 Too Many Requests

Request Format

All POST, 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:

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 (matches a.example.com, not example.com)
  • 192.168.* - IP prefix match
In production (NODE_ENV=production), access is denied by default unless explicitly allowed. Set MC_ALLOWED_HOSTS or deploy behind a reverse proxy.

Real-time Updates

Mission Control provides real-time updates via:

Server-Sent Events (SSE)

Receive database change events:

WebSocket (Gateway)

For OpenClaw gateway connections:

OpenAPI Specification

Download the full OpenAPI 3.1.0 specification:
Interactive API explorer available at:

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