Skip to main content

Error Response Format

When an error occurs, the API returns a standardized JSON response:
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error description"
  }
}

Error Codes

CodeHTTP StatusDescription
AUTH_FAILED401Invalid or missing API key
INVALID_PAYLOAD400Missing required fields in request body
VALIDATION_ERROR400Field format is incorrect (e.g., invalid email)
NOT_FOUND404Requested resource (lead ID) doesn’t exist
RATE_LIMITED429Too many requests - slow down
SERVER_ERROR500Unexpected server issue

Error Examples

AUTH_FAILED

Missing or invalid API key:
{
  "success": false,
  "error": {
    "code": "AUTH_FAILED",
    "message": "Invalid API key"
  }
}

INVALID_PAYLOAD

Required field missing:
{
  "success": false,
  "error": {
    "code": "INVALID_PAYLOAD",
    "message": "first_name is required"
  }
}

VALIDATION_ERROR

Field format incorrect:
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid email format"
  }
}

NOT_FOUND

Lead doesn’t exist or doesn’t belong to your partner account:
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Lead not found"
  }
}

RATE_LIMITED

Exceeded request limits:
{
  "success": false,
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests. Please wait before retrying."
  }
}

Rate Limits

Default limits per partner:
DirectionLimit
Inbound (Partner → Credzu)100 requests/minute
Outbound (Credzu → Partner webhooks)300 callbacks/minute
If you need higher limits for enterprise volume, contact Credzu support to request increased quotas.

Best Practices

1

Check HTTP status codes

Use HTTP status codes for initial error classification (4xx = client error, 5xx = server error).
2

Parse the error code

Use the error.code field to determine the specific error type and handle accordingly.
3

Log the full response

Store the complete error response for debugging and support requests.
4

Implement retry logic

For SERVER_ERROR or RATE_LIMITED, implement exponential backoff before retrying.