# Whatsapp messages

## Send WhatsApp message

> Send a WhatsApp message to any phone number using your connected WhatsApp account.\
> \
> \*\*Rate Limits (per account):\*\*\
> \- Burst: 6 messages capacity (refills 1 token every 20 seconds = 3/min)\
> \- Hourly: 60 messages per hour (sliding window)\
> \
> \*\*Response Headers:\*\*\
> \- \`X-RateLimit-Burst-Limit\`: Maximum burst capacity\
> \- \`X-RateLimit-Burst-Remaining\`: Remaining burst tokens\
> \- \`X-RateLimit-Hour-Limit\`: Maximum messages per hour\
> \- \`X-RateLimit-Hour-Remaining\`: Remaining hourly quota\
> \- \`Retry-After\`: Seconds to wait if rate limited (429 response)\
> \
> \*\*Processing:\*\*\
> Messages are processed asynchronously. The endpoint returns 201 immediately and processing happens in the background.

```json
{"openapi":"3.1.0","info":{"title":"RogerRoger API","version":"1.0.0"},"tags":[{"name":"WhatsAppMessage","description":"Resource 'WhatsAppMessage' operations."}],"servers":[{"url":"https://api.rogerroger.io","description":"API"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Your API key, available from the dashboard","name":"X-API-KEY","in":"header"}},"schemas":{"WhatsAppMessage":{"type":"object","required":["accountId","phoneNumber","message"],"properties":{"accountId":{"format":"uuid","description":"Your WhatsApp account ID from RogerRoger","type":["string","null"]},"phoneNumber":{"pattern":"^(\\+?[1-9]\\d{1,14})$","description":"Recipient phone number in E.164 format (with country code)","type":["string","null"]},"message":{"minLength":1,"maxLength":4096,"description":"Message text to send (1-4096 characters)","type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL to the file to attach"}},"required":["url"]}}}}}},"paths":{"/whatsapp/messages":{"post":{"operationId":"api_whatsappmessages_post","tags":["WhatsAppMessage"],"responses":{"201":{"description":"Message queued successfully. Check rate limit headers for remaining quota.","headers":{"X-RateLimit-Burst-Limit":{"description":"Maximum burst capacity (6)","schema":{"type":"integer"}},"X-RateLimit-Burst-Remaining":{"description":"Remaining burst tokens","schema":{"type":"integer"}},"X-RateLimit-Hour-Limit":{"description":"Maximum messages per hour (60)","schema":{"type":"integer"}},"X-RateLimit-Hour-Remaining":{"description":"Remaining hourly quota","schema":{"type":"integer"}}},"links":{}},"400":{"description":"Validation error (invalid UUID, phone format, or message length)","links":{}},"401":{"description":"Unauthorized (invalid JWT token or API key)"},"403":{"description":"Forbidden","links":{}},"404":{"description":"WhatsApp account not found or access denied"},"422":{"description":"An error occurred","links":{}},"429":{"description":"Rate limit exceeded. Check Retry-After header for wait time in seconds.","headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"integer"}},"X-RateLimit-Burst-Remaining":{"description":"Remaining burst tokens (0 if burst limit hit)","schema":{"type":"integer"}},"X-RateLimit-Hour-Remaining":{"description":"Remaining hourly quota (0 if hourly limit hit)","schema":{"type":"integer"}}}}},"summary":"Send WhatsApp message","description":"Send a WhatsApp message to any phone number using your connected WhatsApp account.\n\n**Rate Limits (per account):**\n- Burst: 6 messages capacity (refills 1 token every 20 seconds = 3/min)\n- Hourly: 60 messages per hour (sliding window)\n\n**Response Headers:**\n- `X-RateLimit-Burst-Limit`: Maximum burst capacity\n- `X-RateLimit-Burst-Remaining`: Remaining burst tokens\n- `X-RateLimit-Hour-Limit`: Maximum messages per hour\n- `X-RateLimit-Hour-Remaining`: Remaining hourly quota\n- `Retry-After`: Seconds to wait if rate limited (429 response)\n\n**Processing:**\nMessages are processed asynchronously. The endpoint returns 201 immediately and processing happens in the background.","parameters":[],"requestBody":{"description":"The new WhatsAppMessage resource","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/WhatsAppMessage"}},"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppMessage"}}},"required":true}}}}}
```
