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

Machines API

Manage your connected machines.

List Machines

GET /machines

Query Parameters

ParameterTypeDescription
statusstringFilter by status: online, offline
tagsstringComma-separated tags
searchstringSearch by name
limitnumberResults per page (default: 20)
offsetnumberOffset for pagination

Example

curl "https://api.cmdop.com/v1/machines?status=online&limit=10" \ -H "Authorization: Bearer TOKEN"

Response

{ "data": [ { "id": "mach_abc123", "name": "production-server", "status": "online", "os": "linux", "arch": "amd64", "hostname": "prod-1.example.com", "tags": ["production", "web"], "created_at": "2024-01-15T10:30:00Z", "last_seen": "2024-01-20T15:45:00Z" } ], "meta": { "total": 5, "limit": 10, "offset": 0 } }

Get Machine

GET /machines/:id

Example

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

Response

{ "data": { "id": "mach_abc123", "name": "production-server", "status": "online", "os": "linux", "arch": "amd64", "hostname": "prod-1.example.com", "ip": "192.168.1.100", "tags": ["production", "web"], "agent_version": "1.2.3", "created_at": "2024-01-15T10:30:00Z", "last_seen": "2024-01-20T15:45:00Z" } }

Get Machine Status

GET /machines/:id/status

Response

{ "data": { "connected": true, "uptime": 86400, "last_ping": "2024-01-20T15:45:00Z", "cpu": { "usage": 45.2, "cores": 4 }, "memory": { "total": 8589934592, "used": 4294967296, "free": 4294967296 }, "disk": { "total": 107374182400, "used": 53687091200, "free": 53687091200 } } }

Update Machine

PATCH /machines/:id

Request Body

{ "name": "new-name", "tags": ["production", "api"] }

Example

curl -X PATCH https://api.cmdop.com/v1/machines/mach_abc123 \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "new-name"}'

Delete Machine

DELETE /machines/:id

Example

curl -X DELETE https://api.cmdop.com/v1/machines/mach_abc123 \ -H "Authorization: Bearer TOKEN"

Response

{ "data": { "deleted": true } }

Machines API | Cmdop