Error Handling

Learn how to handle API errors and implement proper error recovery.

Error Response Format

All API errors follow a consistent format:

error-response.jsonjson
Loading...
FieldTypeDescription
codestringMachine-readable error code
messagestringHuman-readable error message
statusintegerHTTP status code
detailsobjectAdditional error context (optional)
requestIdstringUnique request ID for debugging

HTTP Status Codes

StatusMeaningCommon Causes
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid parameters, malformed JSON
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions
404Not FoundResource doesn't exist
409ConflictResource already exists
422UnprocessableValidation errors
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error
503Service UnavailableTemporary maintenance

Error Codes Reference

Authentication Errors (401, 403)

CodeDescription
invalid_api_keyThe API key is invalid or malformed
expired_api_keyThe API key has been revoked
missing_api_keyNo API key was provided
insufficient_permissionsKey doesn't have access to this resource
ip_not_allowedRequest from unauthorized IP address

Validation Errors (400, 422)

CodeDescription
invalid_requestRequest body is malformed
missing_required_fieldA required field is missing
invalid_field_valueA field has an invalid value
invalid_urlURL is malformed or not HTTPS
invalid_flow_typeFlow type must be "standard" or "enhanced"
payload_too_largeRequest body exceeds 10MB limit
image_too_largeImage file exceeds 10MB limit. Compress or resize before uploading.
suspicious_contentRequest blocked due to suspicious patterns in submitted text
invalid_webhook_urlWebhook URL must be HTTPS and not point to internal/private IPs

Resource Errors (404, 409)

CodeDescription
resource_not_foundThe requested resource doesn't exist
verification_not_foundVerification with given ID not found
link_not_foundVerification link not found
link_expiredVerification link has expired
link_already_usedVerification link was already used
webhook_existsWebhook with this URL already exists

Rate Limiting Errors (429)

CodeDescription
rate_limit_exceededToo many requests
verification_limit_exceededMonthly verification quota reached

Handling Errors in Code

JavaScript/Node.js

error-handling.jsjavascript
Loading...

Python

error_handling.pypython
Loading...

Validation Error Details

Validation errors include detailed field-level information:

validation-error.jsonjson
Loading...
validation-handling.jsjavascript
Loading...

Retrying Failed Requests

Implement exponential backoff for retryable errors:

retry-logic.jsjavascript
Loading...

Debugging with Request ID

Every API response includes a unique requestId. Include this when contacting support:

debugging.jsjavascript
Loading...