API Reference
Integrate What Sender into your applications
Authentication
All API requests require an API key. You can generate API keys from your dashboard under Settings > API Keys.
Include your API key in the request header:
X-API-Key: your_api_key_hereSecurity: Never expose your API key in client-side code. Always make API calls from your backend server.
Base URL
https://whatsender.dev/api/v1Endpoints
GET
/api/v1/auth/meGet current user information
Headers
Authorization: Bearer {token}
Response
{
"id": "user_123",
"email": "user@example.com",
"name": "John Doe",
"tenant": {
"id": "tenant_456",
"name": "My Company"
}
}Rate Limits
API rate limits vary by plan. Exceeding limits returns a 429 error.
| Plan | API Requests | Messages |
|---|---|---|
| Free | 100/hour | 50/day |
| Pro | 1,000/hour | 1,000/day |
| Enterprise | 10,000/hour | Unlimited |
Error Codes
| Code | Message | Description |
|---|---|---|
| 400 | Bad Request | Invalid request body or parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions or plan limits |
| 404 | Not Found | Resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal server error |
Code Examples
JavaScript (Node.js)
const axios = require('axios');
const API_KEY = 'your_api_key';
const BASE_URL = 'https://whatsender.dev/api/v1';
// Send a message
async function sendMessage(to, message) {
const response = await axios.post(
`${BASE_URL}/messages/send`,
{ to, message },
{ headers: { 'X-API-Key': API_KEY } }
);
return response.data;
}
sendMessage('+1234567890', 'Hello!')
.then(console.log)
.catch(console.error);Python
import requests
API_KEY = 'your_api_key'
BASE_URL = 'https://whatsender.dev/api/v1'
def send_message(to, message):
response = requests.post(
f'{BASE_URL}/messages/send',
json={'to': to, 'message': message},
headers={'X-API-Key': API_KEY}
)
return response.json()
result = send_message('+1234567890', 'Hello!')
print(result)cURL
curl -X POST https://whatsender.dev/api/v1/messages/send \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"to": "+1234567890", "message": "Hello!"}'See also: Documentation | Contact Support