Core Concepts
Errors
Scrub follows standard HTTP status codes. Application-level errors are identified by error_code and error_type in the response body — use these instead of HTTP status alone, similar to Plaid's error model.
Error response format
{
"error_code": "INVALID_BVN",
"error_type": "INVALID_REQUEST",
"message": "BVN must be exactly 11 digits",
"request_id": "req_8f3k2m9x1p"
}jsonError codes
| error_code | error_type | HTTP | message |
|---|---|---|---|
INVALID_BVN | INVALID_REQUEST | 400 | BVN must be exactly 11 digits |
INVALID_NIN | INVALID_REQUEST | 400 | NIN format or checksum invalid |
CONSENT_REQUIRED | INVALID_REQUEST | 403 | Customer consent reference missing or expired |
UNAUTHORIZED | AUTHENTICATION | 401 | Invalid or missing Bearer token |
ACCOUNT_NOT_FOUND | NOT_FOUND | 404 | Account not in Scrub network |
REPORT_NOT_FOUND | NOT_FOUND | 404 | Credit report ID invalid or expired |
RATE_LIMIT_EXCEEDED | RATE_LIMIT | 429 | Too many requests — check X-RateLimit-Reset |
DUPLICATE_IDEMPOTENCY | INVALID_REQUEST | 409 | Same key used with different payload |
INSUFFICIENT_DATA | INVALID_REQUEST | 422 | Not enough signals for fraud analysis |
INTERNAL_ERROR | INTERNAL | 500 | Unexpected server error — include request_id in support ticket |
HTTP status reference
| Status | Meaning |
|---|---|
200 OK | Request succeeded |
201 Created | Resource created (fraud report, inquiry) |
202 Accepted | Async operation started (credit report) |
400 Bad Request | Malformed or invalid input |
401 Unauthorized | Missing or invalid authentication |
403 Forbidden | Consent missing or insufficient permissions |
404 Not Found | Account, report, or resource not found |
409 Conflict | Idempotency key reused with different payload |
422 Unprocessable Entity | Valid JSON but insufficient data for analysis |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server error — contact support with request_id |
Security
All traffic must use HTTPS (TLS 1.2+). Store API keys and webhook secrets securely. Never expose tokens on the client side.