📲 WhatsApp Message API
This API allows organizations to send messages via WhatsApp, supporting text and template-based messages.
🔗 Endpoint
POST https://app.skyfunnel.ai/api/v1/whatsapp/message
📥 Request
Headers
x-api-key
(string, required)- You can copy the API key from your Skyfunnel account at: Skyfunnel Dashboard
Body
The request body varies based on the type of message being sent.
1️⃣ Text Message
type
(string, required) - Must be"text"
.message
(string, required) - The text message to send.receiverPhoneNumber
(string, required) - The recipient’s phone number.senderPhoneNumber
(string, required) - The sender’s WhatsApp phone number.
json
{
"type": "text",
"message": "Hello! This is a test message.",
"receiverPhoneNumber": "+1234567890",
"senderPhoneNumber": "+0987654321"
}
2️⃣ Template Message
type
(string, required) - Must be"template"
.receiverPhoneNumber
(string, required) - The recipient’s phone number.senderPhoneNumber
(string, required) - The sender’s WhatsApp phone number.bodyVarValues
(array, optional) - Variables for the template body, each object must includeindex
(number) andvalue
(string).templateName
(string, required) - The name of the WhatsApp message template.sendAs
(string, optional) - The email of the sender (must belong to an organization user).
{
"type": "template",
"receiverPhoneNumber": "+1234567890",
"senderPhoneNumber": "+0987654321",
"bodyVarValues": [
{
"index": 0,
"value": "John Doe"
},
{
"index": 1,
"value": "3 PM"
}
],
"templateName": "appointment_reminder",
"sendAs": "admin@company.com"
}
📤 Response
If the request is successful, the API will return a confirmation message.
✅ Success Response
- Status Code:
200 OK
- Response Body:
json
{
"message": "Message Sent"
}
❌ Error Responses
Status Code | Message |
---|---|
400 | "Invalid body" (if request body validation fails) |
400 | "WhatsApp phone not found for this organization." |
400 | "WhatsApp phone is not active. Please verify phone number." |
400 | "We were not able to find the user for the passed sendAs." |
403 | "You are not authorized to send messages." |
500 | "Something went wrong. Please try again later." |
⚠️ Note: A 400 Bad Request response can be caused by multiple issues such as invalid input format, missing required fields, or an unverified sender phone number.
⚠️ Notes
- Only text and template message types are currently supported.
- Ensure your sender’s WhatsApp number is verified in the Skyfunnel WhatsApp dashboard.
- The API automatically selects an admin user if
sendAs
is not provided.
🚀 Use this API to send WhatsApp messages directly to your users!