NairaCheck
API reference menu

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 envelope
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Retry in 12 seconds.",
    "request_id": "req_9f4c2b7a8d1e4f60"
  }
}
CodeHTTPAction
missing_api_key401Add the Authorization header; do not retry unchanged.
invalid_auth_scheme401Send the key as Authorization: Bearer <key>.
malformed_api_key401Keys begin with nck_live_ or nck_test_; check for truncation.
invalid_api_key401Use the correct key or create a new one in the API key portal.
api_key_revoked401The key was revoked; switch to an active key.
insufficient_scope403Use a key with the cac:search scope.
validation_failed422Correct the fields listed in error.details.
rate_limit_exceeded429Wait for Retry-After before retrying.
upstream_rate_limited503Back off; CAC throttled the NairaCheck upstream connection.
upstream_unavailable503Retry 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.

Error envelope
{
  "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" }
}
HTTPCodesAction
400MISSING_DOCUMENT, AMBIGUOUS_DOCUMENT, INVALID_BASE64, INVALID_URL, BAD_REQUESTFix the request: send exactly one of documentUrl or documentBase64, or a multipart file field.
401MISSING_API_KEY, MALFORMED_API_KEY, INVALID_API_KEY, API_KEY_REVOKEDSend a valid, active key as Authorization: Bearer <key>.
403INSUFFICIENT_SCOPEUse a key with the document:verify scope.
403HOST_NOT_ALLOWEDThe URL resolves to a private or internal address. Use a public URL or upload the file.
404 / 405NOT_FOUND, METHOD_NOT_ALLOWEDCall POST /v1/document/verify or GET /v1/document/health.
413DOCUMENT_TOO_LARGE, TOO_MANY_PAGESSend a file under 5 MB, or a PDF of at most 20 pages.
415VIDEO_NOT_ALLOWED, ANIMATED_IMAGE_NOT_ALLOWED, UNSUPPORTED_TYPESend a PDF or a still image.
422EMPTY_DOCUMENT, CORRUPT_DOCUMENT, ENCRYPTED_DOCUMENTThe file can't be analysed; ask for an unencrypted original.
422URL_RETURNED_WEB_PAGEThe URL serves a viewer or sign-in page. Use a direct download link.
429RATE_LIMITEDWait for Retry-After before retrying.
500INTERNAL_ERRORRetry once with backoff; quote reference_id if it persists.
502DOWNLOAD_FAILEDThe file was unreachable, private or missing. Check the URL and its sharing settings.
502DOWNLOAD_BLOCKEDThe site's bot protection refuses automated downloads. Upload the file instead.
503AUTH_UNAVAILABLEKey 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:search anddocument:verify. Calling another product returns 403.
  • nck_test_ and nck_live_ keys currently reach the same production services; there is no sandbox yet.