🎉 Cmdop v1.0 is here! Download now →
Skip to Content
DocsAPI ReferenceAuthentication

Authentication

Authenticate your API requests.

API Token

Include your API token in the Authorization header:

curl https://api.cmdop.com/v1/machines \ -H "Authorization: Bearer cmdop_xxx..."

Get API Token

  1. Go to dashboard settings 
  2. Click “Create Token”
  3. Set name and permissions
  4. Copy the token (shown once)

Token Permissions

PermissionDescription
machines:readList and view machines
machines:writeModify machine settings
commands:executeExecute commands
files:readRead files
files:writeWrite/upload files
schedules:readView schedules
schedules:writeCreate/modify schedules
webhooks:manageManage webhooks

Request Example

curl -X GET https://api.cmdop.com/v1/auth/me \ -H "Authorization: Bearer cmdop_xxx..." \ -H "Content-Type: application/json"

Response

{ "data": { "id": "user_abc123", "email": "[email protected]", "name": "John Doe", "plan": "pro", "permissions": [ "machines:read", "machines:write", "commands:execute" ] } }

Error Responses

Invalid Token

{ "error": { "code": "unauthorized", "message": "Invalid or expired API token" } }

Insufficient Permissions

{ "error": { "code": "forbidden", "message": "Token lacks required permission: commands:execute" } }

Token Security

  • Never expose tokens in client-side code
  • Use environment variables
  • Rotate tokens regularly
  • Use minimum required permissions
  • Revoke unused tokens

Rate Limits

Per-token limits:

  • 1000 requests/minute
  • Headers indicate remaining quota

When rate limited (429):

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

API Authentication | Cmdop