Errors

Error response format and common troubleshooting paths.

Error Envelope

Most API errors follow this envelope.

Standard Error Shape
{
  "success": false,
  "error": "Unauthorized",
  "message": ["Invalid API key"],
  "statusCode": 401,
  "timestamp": "2026-02-06T14:22:30.000Z",
  "path": "/v1/messages/send"
}

Validation errors return the same shape, with multiple entries in message.

Validation Error Example (400)
{
  "success": false,
  "error": "Bad Request",
  "message": [
    "Phone number must be in E.164 format (e.g., +1987654321)",
    "to must be a string"
  ],
  "statusCode": 400,
  "timestamp": "2026-02-06T14:22:30.000Z",
  "path": "/v1/messages/send"
}

Common Errors

Common Error Matrix

CodeCauseTypical Fix
400Invalid payload or query valuesFix request format, required fields, or value constraints.
401Missing, invalid, or expired API keySend a valid Bearer API key from dashboard.
403Missing scope or inactive subscriptionUse a key with correct scope and ensure account is active.
404Unknown message/phone resourceVerify identifiers belong to your account.
429Per-key rate limit exceededBack off and retry after retryAfter seconds.
500Unexpected internal errorRetry safely and contact support with messageId/request context.
Rate Limit Error Example (429)
{
  "success": false,
  "error": "Rate limit exceeded",
  "retryAfter": 60
}

Debug Workflow

  1. Verify Authorization: Bearer sk_live_* or sk_test_* header format.
  2. Check key scopes include required permissions (for phone endpoints, include phone_numbers:read).
  3. Confirm sender phone is connected in dashboard.
  4. If using phone number in path, URL-encode it (for example %2B15551234567).
  5. Use idempotency keys and inspect message status endpoint.
Operational Tip
Log messageId values from send responses and use them as the canonical correlation key across polling, webhook processing, and support tickets.