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 / code | Meaning |
|---|---|
401 invalid_api_key | Missing, wrong, revoked or expired key |
402 insufficient_balance | Top up your wallet |
403 service_not_enabled | API not part of your plan |
403 ip_not_allowed | Caller IP not in key allowlist |
404 not_found | Unknown session / resource |
409 session_not_authorized | User has not finished consent |
409 consent_expired | Create a new session |
422 validation_failed | See error.details |
424 invalid_token | User revoked access in DigiLocker |
429 rate_limited | Plan rate limit exceeded |
502 / 503 | DigiLocker unavailable — retry later |
403 insufficient_scope | Your DigiLocker app isn't permitted to access this data (for example e-Aadhaar) |
404 aadhaar_not_linked | The customer's DigiLocker isn't linked to Aadhaar |
502 hmac_mismatch | A file failed the integrity check and was rejected |
Handling errors
- 4xx: fix the request. Don't retry without changes, except
429(wait forRetry-After). - 5xx / 502 / 503: DigiLocker or our service is temporarily unavailable. Retry with exponential backoff.
- Failed calls are never charged.