Skip to content
API documentation

Errors

API error format, HTTP status codes and error codes with how to handle them.

Errors return a non-2xx HTTP status and an error object. Validation errors include field details.

{
  "success": false,
  "error": { "code": "validation_failed", "message": "The redirect url field must be a valid URL.",
             "details": { "redirect_url": ["The redirect url field must be a valid URL."] } },
  "meta": { "request_id": "9b1f…", "charged": 0 }
}

Error codes

Status / codeMeaning
401 invalid_api_keyMissing, wrong, revoked or expired key
402 insufficient_balanceTop up your wallet
403 service_not_enabledAPI not part of your plan
403 ip_not_allowedCaller IP not in key allowlist
404 not_foundUnknown session / resource
409 session_not_authorizedUser has not finished consent
409 consent_expiredCreate a new session
422 validation_failedSee error.details
424 invalid_tokenUser revoked access in DigiLocker
429 rate_limitedPlan rate limit exceeded
502 / 503DigiLocker unavailable — retry later
403 insufficient_scopeYour DigiLocker app isn't permitted to access this data (for example e-Aadhaar)
404 aadhaar_not_linkedThe customer's DigiLocker isn't linked to Aadhaar
502 hmac_mismatchA file failed the integrity check and was rejected

Handling errors

  • 4xx: fix the request. Don't retry without changes, except 429 (wait for Retry-After).
  • 5xx / 502 / 503: DigiLocker or our service is temporarily unavailable. Retry with exponential backoff.
  • Failed calls are never charged.