APIs & Integrations

Response Examples

Annotated JSON responses showing every field returned by the Optra API.

Device Object

{
  "id": "dev_abc123",           // Unique device identifier
  "name": "Printer Floor-3",   // Human-readable name
  "serial": "SN-00123",        // Manufacturer serial number
  "model": "CX730de",          // Device model
  "status": "online",          // "online" | "offline" | "unknown"
  "tags": ["floor-3"],         // User-defined tags
  "created_at": "2026-01-15T09:00:00Z",
  "last_seen_at": "2026-05-12T14:23:11Z"
}

Telemetry Object

{
  "device_id": "dev_abc123",
  "timestamp": "2026-05-12T14:23:11Z",
  "metrics": {
    "temperature": 62.4,       // Degrees Celsius
    "page_count": 18450,       // Cumulative pages printed
    "toner_level": 34,         // Percentage remaining
    "error_codes": []          // Active device error codes
  }
}

Paginated List Response

{
  "data": [ /* array of resource objects */ ],
  "meta": {
    "total": 342,              // Total records matching the query
    "limit": 50,               // Page size requested
    "offset": 0,               // Offset into result set
    "next": "/v1/devices?offset=50&limit=50"
  }
}

Error Response

{
  "error": {
    "code": "DEVICE_NOT_FOUND",
    "message": "No device with id 'dev_xyz999' exists in this organisation.",
    "request_id": "req_7f3a9b"  // Quote this when contacting support
  }
}