Errors

Error response format and HTTP status codes.

Error format

All errors follow a consistent shape:

{
  "error": {
    "code": "error_code",
    "message": "Human-readable description.",
    "details": {}
  }
}

The code field is machine-readable and stable. The message field is human-readable and may change. The details field provides additional context where applicable.

Error codes

HTTP StatusCodeDescription
400invalid_requestMalformed JSON body
401unauthorizedMissing API key or session token
401invalid_api_keyKey format invalid or key not found
401invalid_credentialsWrong email or password
402insufficient_creditsNo credits remaining
403origin_not_allowedOrigin header missing or not in allowed list
403email_not_verifiedEmail not yet verified
404not_foundDevice or resource not found
409email_already_registeredAccount with this email already exists
422validation_errorRequest body failed schema validation
429rate_limitedRate limit exceeded
503service_unavailablePricing data temporarily unavailable

Validation errors

When the request body fails schema validation (422), the details field includes an array of issues:

{
  "error": {
    "code": "validation_error",
    "message": "Validation failed.",
    "details": {
      "issues": [
        { "field": "devices.1.qty", "message": "Expected positive integer" }
      ]
    }
  }
}

Each issue includes the field path (dot-notation) and a description of the problem.