API contract
Errors and rate limits
Each product returns errors in its own envelope. Branch on the error code, log the identifier it gives you and retry only the conditions documented as transient.
CAC Company Info
Nested error object
Codes are lowercase. Log request_id and quote it to support.
{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Retry in 12 seconds.",
"request_id": "req_9f4c2b7a8d1e4f60"
}
}| Code | HTTP | Action |
|---|---|---|
| missing_api_key | 401 | Add the Authorization header; do not retry unchanged. |
| invalid_auth_scheme | 401 | Send the key as Authorization: Bearer <key>. |
| malformed_api_key | 401 | Keys begin with nck_live_ or nck_test_; check for truncation. |
| invalid_api_key | 401 | Use the correct key or create a new one in the API key portal. |
| api_key_revoked | 401 | The key was revoked; switch to an active key. |
| insufficient_scope | 403 | Use a key with the cac:search scope. |
| validation_failed | 422 | Correct the fields listed in error.details. |
| rate_limit_exceeded | 429 | Wait for Retry-After before retrying. |
| upstream_rate_limited | 503 | Back off; CAC throttled the NairaCheck upstream connection. |
| upstream_unavailable | 503 | Retry with exponential backoff and jitter. |
Document Verification
Flat FAILED response
Codes are uppercase, and status is FAILED. Errors after authentication also echo your reference_id and include storage.record_id, the audit record to quote to support.
{
"status": "FAILED",
"error": "DOWNLOAD_FAILED",
"message": "Google Drive refused access (HTTP 403). For Google Drive, set link sharing to 'Anyone with the link'.",
"reference_id": "ref_123",
"processing_ms": 412,
"storage": { "stored": true, "record_id": "jp2diMUhcEvoTxN3dkvx" }
}| HTTP | Codes | Action |
|---|---|---|
| 400 | MISSING_DOCUMENT, AMBIGUOUS_DOCUMENT, INVALID_BASE64, INVALID_URL, BAD_REQUEST | Fix the request: send exactly one of documentUrl or documentBase64, or a multipart file field. |
| 401 | MISSING_API_KEY, MALFORMED_API_KEY, INVALID_API_KEY, API_KEY_REVOKED | Send a valid, active key as Authorization: Bearer <key>. |
| 403 | INSUFFICIENT_SCOPE | Use a key with the document:verify scope. |
| 403 | HOST_NOT_ALLOWED | The URL resolves to a private or internal address. Use a public URL or upload the file. |
| 404 / 405 | NOT_FOUND, METHOD_NOT_ALLOWED | Call POST /v1/document/verify or GET /v1/document/health. |
| 413 | DOCUMENT_TOO_LARGE, TOO_MANY_PAGES | Send a file under 5 MB, or a PDF of at most 20 pages. |
| 415 | VIDEO_NOT_ALLOWED, ANIMATED_IMAGE_NOT_ALLOWED, UNSUPPORTED_TYPE | Send a PDF or a still image. |
| 422 | EMPTY_DOCUMENT, CORRUPT_DOCUMENT, ENCRYPTED_DOCUMENT | The file can't be analysed; ask for an unencrypted original. |
| 422 | URL_RETURNED_WEB_PAGE | The URL serves a viewer or sign-in page. Use a direct download link. |
| 429 | RATE_LIMITED | Wait for Retry-After before retrying. |
| 500 | INTERNAL_ERROR | Retry once with backoff; quote reference_id if it persists. |
| 502 | DOWNLOAD_FAILED | The file was unreachable, private or missing. Check the URL and its sharing settings. |
| 502 | DOWNLOAD_BLOCKED | The site's bot protection refuses automated downloads. Upload the file instead. |
| 503 | AUTH_UNAVAILABLE | Key validation is briefly unavailable. Retry with exponential backoff. |
A COMPLETED response with verdict TAMPERED is a successful analysis, not an error. See Verify a document for verdicts.
Rate-limit headers
Limits are per key, per minute. Document Verification allows 10 requests a minute by default. Both APIs send the same headers.
X-RateLimit-Limit— requests allowed per minute.X-RateLimit-Remaining— requests left in the current window.X-RateLimit-Reset— seconds until capacity returns.Retry-After— wait time included on a 429 response.
Keys and revocation
- A revoked key stops working on every API within about 60 seconds.
- A key works only for the products whose scopes it carries:
cac:searchanddocument:verify. Calling another product returns 403. nck_test_andnck_live_keys currently reach the same production services; there is no sandbox yet.