واجهة برمجة واتساب

Errors & Limits

Complete reference of API error codes, HTTP status codes, rate limits, and troubleshooting guide for the WhatsApp Business API.

HTTP Status Codes

StatusMeaning
200 OKRequest succeeded
201 CreatedResource created (templates, broadcasts)
400 Bad RequestInvalid request body or parameters
401 UnauthorizedMissing or invalid API key
403 ForbiddenInsufficient permissions
404 Not FoundResource doesn’t exist
409 ConflictDuplicate resource (e.g., template name)
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error — retry with backoff

Error Response Format

All errors return a consistent JSON structure:

{
  "error": {
    "code": "INVALID_RECIPIENT",
    "message": "The recipient phone number is not registered on WhatsApp.",
    "details": {
      "field": "to",
      "value": "1234567890"
    },
    "request_id": "req_abc123"
  }
}

Error Codes Reference

Message Errors

CodeHTTPDescriptionSolution
INVALID_RECIPIENT400Number not on WhatsAppVerify the number is registered
INVALID_MESSAGE_TYPE400Unsupported message typeCheck supported types in docs
MESSAGE_TOO_LONG400Text exceeds 4,096 charsShorten the message
OUTSIDE_WINDOW40024h session expiredUse a template message
TEMPLATE_NOT_FOUND404Template doesn’t existCheck name and language code
TEMPLATE_PAUSED400Template is paused by MetaFix quality issues, resubmit
MEDIA_TOO_LARGE400File exceeds size limitCompress or resize the file
MEDIA_FORMAT_UNSUPPORTED400Unsupported file formatConvert to a supported format
RECIPIENT_BLOCKED400User blocked your numberRemove from contact list

Authentication Errors

CodeHTTPDescriptionSolution
INVALID_API_KEY401API key is invalid or revokedCheck/regenerate your API key
EXPIRED_API_KEY401API key has expiredGenerate a new key
INSUFFICIENT_PERMISSIONS403Key lacks required scopeUse a key with correct permissions
IP_NOT_ALLOWED403Request from blocked IPAdd IP to allowlist

Rate Limit Errors

CodeHTTPDescriptionSolution
RATE_LIMITED429Too many requests/secondWait and retry with backoff
DAILY_LIMIT_REACHED429Daily message quota exceededUpgrade plan or wait until reset
BROADCAST_LIMIT429Max broadcasts/day reachedWait or upgrade plan

Account Errors

CodeHTTPDescriptionSolution
ACCOUNT_SUSPENDED403Account is suspendedContact support
WABA_DISCONNECTED403WhatsApp Business Account disconnectedReconnect in dashboard
NUMBER_NOT_VERIFIED403Phone number not verifiedComplete verification flow

Rate Limits

API Rate Limits (per API key)

PlanRequests/secDaily Messages
Free101,000
Premium100100,000
EnterpriseUp to 1,000Unlimited

WhatsApp Throughput (set by Meta)

Message throughput is controlled by Meta based on your phone number’s quality rating:

TierUnique Users/24hHow to Reach
Tier 11,000New numbers start here
Tier 210,000Maintain quality + volume
Tier 3100,000Consistent quality + higher volume
Tier 4UnlimitedHighest quality + highest volume

StartMessaging handles all Meta-level throttling automatically — you don’t need to manage it yourself.

Implementing Retry Logic

async function sendWithRetry(payload, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try {
      const response = await fetch('https://api.startmessaging.com/v1/messages', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify(payload),
      });

      if (response.status === 429) {
        const retryAfter = response.headers.get('Retry-After') || Math.pow(2, attempt);
        await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
        continue;
      }

      if (response.status >= 500) {
        await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 1000));
        continue;
      }

      return await response.json();
    } catch (error) {
      if (attempt === maxRetries) throw error;
      await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 1000));
    }
  }
}

FAQ

What should I do if I keep getting OUTSIDE_WINDOW errors? The 24-hour customer service window has expired. You must use an approved template message to re-initiate the conversation.

How do I check my current rate limit usage? Check the X-RateLimit-Remaining and X-RateLimit-Reset response headers on any API call.

My quality rating dropped — what can I do? Reduce marketing messages, improve opt-in practices, and make it easy for users to opt out. Quality ratings recover automatically when complaint rates decrease.