Skip to content

Error Codes Reference

Complete list of all SendAPI error codes, their causes, and recommended remediation steps.

HTTP Status Codes

HTTP CodeMeaning
200 OKRequest succeeded
201 CreatedResource created
400 Bad RequestInvalid request body or parameters
401 UnauthorizedMissing or invalid API key
403 ForbiddenValid key but insufficient permissions
404 Not FoundResource not found
409 ConflictConflict with existing resource
410 GoneResource expired (e.g., OTP)
422 Unprocessable EntityValidation error
429 Too Many RequestsRate limit exceeded
402 Payment RequiredQuota exceeded, plan upgrade needed
500 Internal Server ErrorUnexpected server error

Error Response Format

All errors return a consistent JSON structure:

json
{
  "success": false,
  "error": {
    "type": "rate_limit_exceeded",
    "message": "Too many requests. Please retry after 12 seconds.",
    "code": 4029,
    "request_id": "req_01H9...XQ"
  }
}

Authentication Errors (401, 403)

CodeTypeDescriptionFix
4010missing_api_keyNo Authorization header providedAdd Authorization: Bearer sk_live_... header
4011invalid_api_keyAPI key is malformed or not recognizedCheck the key value — it should start with sk_live_
4012revoked_api_keyThe API key has been revokedCreate a new key in the dashboard
4013expired_api_keyThe key's expiry date has passedCreate a new key in the dashboard
4030insufficient_scopeKey lacks permission for this endpointIssue a key with the required scope

Quota and Billing Errors (402, 429)

CodeTypeDescriptionFix
4020quota_exceededMonthly plan quota reachedUpgrade your plan
4021sms_balance_lowInsufficient SMS credit balanceTop up credits in billing dashboard
4029rate_limit_exceededToo many requests per minuteBack off and retry after retry_after seconds

Validation Errors (400, 422)

CodeTypeDescriptionFix
4000invalid_requestGeneric validation failureCheck the details field for field-level errors
4001invalid_phonePhone number is not valid E.164Use the Phone Validation endpoint to normalize
4002invalid_sessionsession_id does not exist or is not yoursList sessions to find the correct ID
4003session_not_connectedSession exists but is not connectedCheck session status; re-pair if disconnected
4004recipient_suppressedAddress is on your suppression listRemove from suppression list in dashboard if unintended
4005invalid_templateTemplate ID not found or template is not approvedVerify the template exists and is approved by Meta

OTP / Verify Errors

CodeTypeDescriptionFix
4040verification_not_foundid does not match any verificationEnsure you're passing the ID from /verify/send
4041verification_expiredOTP TTL has passedAsk the user to request a new OTP
4042max_attempts_exceeded5 wrong attempts — lockedStart a new verification session
4043otp_rate_limitToo many OTPs sent to this numberWait before sending another OTP

Server Errors (500)

CodeTypeDescriptionFix
5000internal_errorUnexpected server errorRetry with exponential backoff; contact support if persistent
5001provider_errorDownstream SMS/WhatsApp provider errorRetry; check the dashboard for system status

Released under the MIT License.