Authentication
Every API request needs Bearer token in headers.
Authorization: Bearer YOUR_API_TOKEN
WA-API Reference
Full examples for MCP integration, sending WhatsApp messages (text/template/media/document), and OTP delivery.
Every API request needs Bearer token in headers.
Authorization: Bearer YOUR_API_TOKEN
Add this in your MCP client config to connect WA API MCP server.
{
"mcpServers": {
"WA API MCP SERVER": {
"url": "https://wa-api.me/api/ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Endpoint: POST https://wa-api.me/api/ai/mcp
curl -X POST "https://wa-api.me/api/ai/mcp" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Use this endpoint for text, template, media, and document messages.
https://wa-api.me/api/wa-accounts/messagescurl -X POST "https://wa-api.me/api/wa-accounts/messages" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"participants": [{ "number": "919876543210" }],
"messageType": "text",
"message": "Hello from WA-API"
}'curl -X POST "https://wa-api.me/api/wa-accounts/messages" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"participants": [{ "number": "919876543210" }],
"messageType": "template",
"template": {
"name": "auth_otp",
"language": { "code": "en" },
"components": [
{
"type": "body",
"parameters": [{ "type": "text", "text": "482901" }]
}
]
}
}'curl -X POST "https://wa-api.me/api/wa-accounts/messages" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"participants": [{ "number": "919876543210" }],
"messageType": "media",
"media": {
"mediaType": "IMAGE",
"link": "https://example.com/product.jpg",
"caption": "Latest offer"
}
}'curl -X POST "https://wa-api.me/api/wa-accounts/messages" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"participants": [{ "number": "919876543210" }],
"messageType": "media",
"media": {
"mediaType": "DOCUMENT",
"link": "https://example.com/invoice.pdf",
"filename": "invoice.pdf",
"caption": "Your invoice"
}
}'Send OTP using default auth_otp template or pass custom template name/language.
https://wa-api.me/api/wa-accounts/messages/send-otpcurl -X POST "https://wa-api.me/api/wa-accounts/messages/send-otp" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"number": "919876543210",
"code": "482901",
"templateName": "auth_otp",
"language": "en"
}'