DocumentationErrors

Errors

Understand response envelopes, diagnose failures, and decide when to retry.

Base URLhttps://api.dehashit.com/api/v1/

Errors

Successful responses return {"status": true, "status_code": 0, "message": "...", "data": {...}}. Failed responses return status: false, set the HTTP response code to match status_code, and usually provide a machine-readable error_code. Branch on error_code, not on message. Use the HTTP status as a fallback when no error code is provided.

Error codes and recovery

HTTPerror_codeMeaning and next step
400invalid_requestRequest payload failed validation. Inspect errors for field details.
401unauthorizedMissing, invalid, or revoked API key.
402insufficient_balanceMatch found, but wallet balance is below the lookup fee. Number withheld.
403forbiddenBrowser origin or CSRF checks failed, permissions are insufficient, or a service key attempted batch access.
404not_foundNo matching hash, unsupported country, missing resource, or expired batch results. Do not retry unchanged.
405—HTTP method is not supported. This response has no error_code; check the endpoint method.
409idempotency_key_in_progressBatch is still processing or its results are not ready. Wait before checking the same job again.
413payload_too_largeRequest body exceeds 8 KiB, or 2 MiB for a batch upload. Reduce its size.
422idempotency_key_reusedThe retry key was used with another hash or different batch bytes. Use a new key for a new lookup or upload.
429rate_limitedRate limit exceeded. Wait for Retry-After seconds before retrying.
502provider_failedM-Pesa gateway call failed (top-ups only).
503dataset_unavailableLookup is temporarily unavailable. Retry later; never billed.
503dataset_format_legacyLookup is paused for maintenance. Retry later or contact support; never billed.
503lookup_timeoutLookup timed out. Retry; never billed.
503unavailableBilling or database unavailable. Never billed.

Error handling example

curl -i -X POST https://api.dehashit.com/api/v1/msisdn/decrypt/ \
  -H "X-Api-Key: invalid_key" \
  -H "Content-Type: application/json" \
  -d '{"msisdn_hash": "7132104d6aae9c3fac82095a42c2817952bca48e09d98d5bf4ac08218982fb90"}'

Error response

{
  "status": false,
  "status_code": 401,
  "error_code": "unauthorized",
  "message": "Invalid API key.",
  "data": {}
}

This 401 example shows an invalid or revoked key. A missing key returns the same envelope with the message Authentication credentials were not provided.

Unknown JSON fields are rejected (400 invalid_request). An Idempotency-Key longer than 128 characters is also 400 invalid_request. Every response carries X-Request-ID; quote it when contacting support.

Need a hand with your integration? Contact support.