API error codes

Hosted API errors return a legacy error string for backward compatibility and an additive error_v2 object with machine-readable codes, a request id, and documentation links.

Response shape

{
  "error": "Watch not found",
  "error_v2": {
    "code": "not_found",
    "message": "Watch not found",
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "docs_url": "https://developers.driftguard.org/docs/errors#not_found"
  }
}

Every error response includes an X-Request-Id header matching error_v2.request_id. Include this id when contacting support.

Error codes

CodeHTTPMeaning
unauthorized401Missing or invalid API key / trial session.
payment_required402Feature requires Pro or Team plan.
validation_failed400Invalid request body or query parameters.
not_found404Resource does not exist or is not visible to your account.
rate_limited429Too many requests — retry after the Retry-After header.
conflict409State conflict (duplicate or concurrent update).
internal5xxUnexpected server error — retry with the same request id.

Rollout

error_v2 is live on watches, drift, and command-center API families. Remaining routes continue to return the legacy error string until migrated.