Skip to main content

Error Handling & Retries

Synchronous Errors

Errors from invalid requests are returned immediately:

{
"success": false,
"error": {
"code": "ERR_INVALID_PARAMS",
"message": "missing X-Reference-ID header"
}
}
CodeHTTP StatusDescription
ERR_INVALID_PARAMS400Missing or invalid parameters
ERR_UNAUTHORIZED401Missing or invalid API token
ERR_DEVICE_NOT_FOUND404cloud_id not registered
ERR_UNSUPPORTED400Operation not supported by this device
ERR_INTERNAL500Internal server error

Webhook Errors

Device errors are delivered via the webhook callback:

{
"referenceId": "my-ref",
"status": "failed",
"error": {
"code": "ERR_INTERNAL",
"message": "device timeout"
}
}

Common device errors:

Error MessageMeaning
device not foundDevice is offline or cloud_id is wrong
device timeoutCommand took longer than 30 minutes
command failed: bad_requestDevice rejected the command (e.g. unsupported biometric type)

Webhook Retries

Webhook delivery uses exponential backoff:

AttemptDelay Before Retry
10s (immediate)
21s
32s
44s
58s (last attempt)

After 5 failed attempts the webhook is dropped. Retry count and timeout are configurable via V2_WEBHOOK_MAX_RETRIES and V2_WEBHOOK_HTTP_TIMEOUT.

Correlation ID

The X-Reference-ID header is a correlation ID you provide. The same value is echoed back in the webhook payload so you can match acks to callbacks. It does not provide idempotency — duplicate requests with the same referenceId will execute the command twice.