Skip to Content

API Reference

TL;DR

The CMDOP REST API provides programmatic access to manage sessions, machines, commands, files, schedules, and webhooks. Authenticate with a Bearer token, send requests to https://api.cmdop.com/v1, and receive JSON responses. Rate limits range from 100 req/min (Free) to 10,000 req/min (Enterprise). Official Python SDK is recommended over raw API calls.

What is the base URL?

https://api.cmdop.com/v1

For self-hosted:

https://your-domain.com/api/v1

How do I authenticate?

All requests require an API key:

# Include API key as Bearer token in Authorization header curl https://api.cmdop.com/v1/sessions \ -H "Authorization: Bearer cmd_xxx"

Get your API key from dashboard settingsΒ .

What is the response format?

All responses are JSON:

{ "data": { ... }, "meta": { "request_id": "req_abc123", "timestamp": "2026-02-14T10:30:00Z" } }

What does a success response look like?

{ "data": { "session_id": "sess_abc123", "status": "CONNECTED" } }

What does an error response look like?

{ "error": { "code": "session_not_found", "message": "Session not found", "details": { "session_id": "sess_invalid" } } }

What HTTP status codes does the API return?

CodeDescription
200Success
201Created
204No Content
400Bad Request β€” Invalid parameters
401Unauthorized β€” Invalid or missing API key
403Forbidden β€” No permission
404Not Found β€” Resource doesn’t exist
409Conflict β€” Resource already exists
422Unprocessable β€” Validation failed
429Rate Limited β€” Too many requests
500Server Error β€” Internal error
503Service Unavailable β€” Temporary outage

What are the rate limits?

Default limits:

TierRequests/minute
Free100
Pro1,000
Enterprise10,000

Headers in response:

X-RateLimit-Limit: 1000 # Max requests per window X-RateLimit-Remaining: 999 # Requests remaining X-RateLimit-Reset: 1707903600 # Unix timestamp when limit resets

When rate limited (429):

{ "error": { "code": "rate_limited", "message": "Rate limit exceeded", "details": { "retry_after": 60 } } }

How does pagination work?

List endpoints support pagination:

# Paginate with limit (page size) and offset (skip count) curl "https://api.cmdop.com/v1/sessions?limit=10&offset=0"

Parameters:

ParameterDefaultMax
limit20100
offset0β€”

Response:

{ "data": [...], "meta": { "total": 45, "limit": 10, "offset": 0, "has_more": true } }

How do I filter results?

Many endpoints support filtering:

# Filter by status curl "https://api.cmdop.com/v1/sessions?status=CONNECTED" # Filter by machine curl "https://api.cmdop.com/v1/sessions?machine_hostname=prod-server" # Multiple filters curl "https://api.cmdop.com/v1/sessions?status=CONNECTED&machine_hostname=prod-server"

How do I sort results?

# Sort by created date (descending) curl "https://api.cmdop.com/v1/sessions?sort=-created_at" # Sort by hostname (ascending) curl "https://api.cmdop.com/v1/machines?sort=hostname"

What endpoints are available?

Sessions

MethodEndpointDescription
GET/sessionsList sessions
GET/sessions/:idGet session
POST/sessions/:id/attachAttach to session
POST/sessions/:id/detachDetach from session

Machines

MethodEndpointDescription
GET/machinesList machines
GET/machines/:idGet machine
DELETE/machines/:idRemove machine

Commands

MethodEndpointDescription
POST/commandsExecute command
GET/commands/:idGet command result

Files

MethodEndpointDescription
GET/filesList files
GET/files/contentRead file
PUT/files/contentWrite file
DELETE/filesDelete file

Webhooks

MethodEndpointDescription
GET/webhooksList webhooks
POST/webhooksCreate webhook
DELETE/webhooks/:idDelete webhook

Are there official SDKs available?

We recommend using official SDKs instead of raw API:

  • Python SDK β€” Full-featured async SDK
  • CLI β€” Command-line access

How do I use real-time streaming?

For real-time streaming, use the gRPC API via SDK.

API keys and OAuth

Session management

Command execution

Last updated on