Skip to main content

Error Reference

All Naturalead API errors follow a consistent JSON format:
{
  "error": "Human-readable error message",
  "details": "Additional context (optional)"
}

HTTP Status Codes

400 Bad Request

The request body or query parameters are invalid.
Error MessageCauseRecovery
"phone is required"Missing phone field when creating a leadInclude phone in the request body
"Invalid status. Must be one of: new, contacted, qualified, disqualified"Status value not in allowed enumUse one of the listed values
"tags must be an array"tags is not an arrayPass tags as a JSON array: ["tag1", "tag2"]
"customFields must be a key-value object"customFields is not an objectPass as key-value object: {"key": "value"}
"Invalid agent ID format"Agent ID is not a valid MongoDB ObjectIdUse a valid 24-character hex string
"content (CSV string) is required"Empty body for CSV uploadInclude content field with CSV data
"content and mapping are required"Missing mapping in CSV confirmInclude both content and mapping
"filters.conditions array is required"Advanced filter has malformed conditionsInclude filters.conditions as an array

401 Unauthorized

Authentication is missing or invalid.
Error MessageCauseRecovery
"Invalid or expired API key"API key is revoked, expired, or not foundCreate a new key or rotate the existing one
"Authentication required. Provide an API key via X-API-Key header or Authorization: Bearer header."No API key providedAdd X-API-Key or Authorization: Bearer header
"Invalid webhook token"Webhook endpoint token doesn’t match accountVerify the webhook token from your account settings

403 Forbidden

Authenticated but insufficient permissions. 403 responses use a two-field format: {"error": "Forbidden", "message": "..."}.
MessageCauseRecovery
"API key does not have the required scope (requires: {permission})."Key missing the needed permissionCreate a new key with the required scope
"You do not have permission to perform this action (requires: {permission})."Your role lacks the required permissionContact your account owner to update your role

404 Not Found

The requested resource doesn’t exist or belongs to a different account.
Error MessageCauseRecovery
"Lead not found"No lead with that ID in your accountVerify the lead ID and account context
"Conversation not found"Conversation doesn’t exist in your accountCheck the conversation ID
"Agent not found"Agent config doesn’t exist in your accountList agents to find valid IDs
"Campaign not found"Campaign doesn’t existList campaigns to find valid IDs
"Knowledge base not found"KB doesn’t exist in your accountList knowledge bases for valid IDs
"Document not found"Document not in the specified KBList documents for the knowledge base

409 Conflict

The request conflicts with current state.
Error MessageCauseRecovery
"A lead with this phone number already exists"Duplicate phone in the same accountSearch for the existing lead and update it instead
"Cannot delete agent with active campaigns"Agent is used by running campaignsPause or delete the campaigns first
"Campaign is already running"Attempted to launch an active campaignPause the campaign before relaunching

429 Too Many Requests

Rate limit exceeded. Check the RateLimit-* headers for timing.
Error MessageLimitScope
"Too many requests, please try again later"1,000/minPer IP (global)
"API key rate limit exceeded, please try again later"500/minPer API key
"Sync API rate limit exceeded. Maximum 50 batch requests per minute."50/minPer API key (sync only)
"Account rate limit exceeded, please try again later"2,000/minPer account
Recovery: Wait for the Retry-After header value (seconds), then retry. See Rate Limits for details.

500 Internal Server Error

An unexpected error occurred on the server.
Error MessageCauseRecovery
"Failed to {action}"Server-side processing errorRetry with exponential backoff. If persistent, contact support.

503 Service Unavailable

A required integration or service is not configured.
Error MessageCauseRecovery
"Messaging is not configured for this channel"No integration set up for the channelConfigure the integration in Settings > Integrations
"Email integration is not configured"Resend email not set upSet up email integration with a verified domain

Error handling best practices

  1. Check the status code first — branch your logic by HTTP status.
  2. Parse the error field — it contains a human-readable message suitable for logging.
  3. Use details when available — some errors include additional context.
  4. Implement retry with backoff — for 429 and 500 errors, use exponential backoff with jitter.
  5. Never retry 400, 401, 403, 404 — these require fixing the request, not retrying.