API introduction
Get started with the Wasapia API. Learn about authentication and basic endpoints to manage flows and recipients in your WhatsApp automation.
Get started with the Wasapia API. Learn about authentication and basic endpoints to manage flows and recipients in your WhatsApp automation.
Welcome to the Wasapia API! Our simple REST API allows you to manage flows and recipients for your WhatsApp automation campaigns.
All API requests should be made to:
https://api.wasapia.com/v1
The API uses API keys for authentication. Generate your API key from your dashboard.
Include your API key in the X-WASAPIA-API-KEY
header:
curl -H "X-WASAPIA-API-KEY: YOUR_API_KEY" \
https://api.wasapia.com/v1/flows
⚠️ Important: Keep your API key secure and never expose it in client-side code.
Content-Type: application/json
header for POST/PUT requestsAll responses are JSON with this structure:
{
"success": true,
"message": "Recipient added successfully",
"data": {
"phoneNumber": "+1234567890",
"status": "pending",
"variables": {
"name": "John Doe"
},
"metadata": {
"entryPoint": "api",
"tags": ["vip"],
"notes": "Important client",
"addedViaApi": true
}
}
}
{
"success": false,
"message": "Validation failed",
"errors": [
{
"msg": "Phone number must be in international format (+1234567890)",
"param": "phoneNumber",
"location": "body"
}
]
}
Get all your flows.
GET /v1/flows
Query parameters:
status
(optional) - Filter by flow statuslimit
(optional, default: 50) - Number of flows to returnExample:
curl -H "X-WASAPIA-API-KEY: YOUR_API_KEY" \
https://api.wasapia.com/v1/flows?status=active&limit=10
Response:
{
"success": true,
"data": [
{
"_id": "flow123",
"name": "Welcome sequence",
"description": "New user onboarding flow",
"status": "active",
"createdAt": "2024-06-02T10:30:00Z",
"updatedAt": "2024-06-02T10:30:00Z"
}
]
}
Add a new recipient to a specific flow.
POST /v1/flows/{flowId}/recipients
Request body:
{
"phoneNumber": "+1234567890",
"variables": {
"name": "John Doe",
"company": "Acme Inc"
},
"metadata": {
"tags": ["vip", "enterprise"],
"notes": "Important client"
}
}
Required fields:
phoneNumber
- Must be in international format (+1234567890)Optional fields:
variables
- Object with custom variables for the recipientmetadata
- Object with additional datatags
- Array of stringsnotes
- String with notesExample:
curl -X POST https://api.wasapia.com/v1/flows/flow123/recipients \
-H "X-WASAPIA-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+1234567890",
"variables": {
"name": "John Doe"
},
"metadata": {
"tags": ["new-customer"],
"notes": "Signed up today"
}
}'
Get all recipients for a specific flow.
GET /v1/flows/{flowId}/recipients
Query parameters:
page
(optional, default: 1) - Page numberlimit
(optional, default: 50) - Recipients per pagestatus
(optional) - Filter by recipient statussearch
(optional) - Search by phone numberExample:
curl -H "X-WASAPIA-API-KEY: YOUR_API_KEY" \
"https://api.wasapia.com/v1/flows/flow123/recipients?page=1&limit=20&status=pending"
Response:
{
"success": true,
"data": [
{
"_id": "recipient123",
"phoneNumber": "+1234567890",
"status": "pending",
"variables": {
"name": "John Doe"
},
"metadata": {
"entryPoint": "api",
"tags": ["vip"],
"notes": "Important client",
"addedViaApi": true
},
"createdAt": "2024-06-02T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"pages": 5
}
}
Update an existing recipient in a flow.
PUT /v1/flows/{flowId}/recipients/{recipientId}
Request body (all fields optional):
{
"phoneNumber": "+1234567890",
"variables": {
"name": "Jane Doe"
},
"status": "completed",
"metadata": {
"tags": ["premium"],
"notes": "Updated information"
}
}
Valid status values:
pending
in_progress
completed
exited
failed
Code | Description |
---|---|
VALIDATION_ERROR |
Request validation failed |
FLOW_NOT_FOUND |
The specified flow doesn't exist |
RECIPIENT_NOT_FOUND |
The specified recipient doesn't exist |
DUPLICATE_RECIPIENT |
Recipient already exists in this flow |
{
"success": false,
"message": "Validation failed",
"errors": [
{
"msg": "Phone number must be in international format (+1234567890)",
"param": "phoneNumber"
}
]
}
{
"success": false,
"message": "Flow not found"
}
{
"success": false,
"message": "Recipient already exists in this flow",
"data": {
"_id": "existing_recipient_id",
"phoneNumber": "+1234567890"
}
}
The API has rate limits to ensure service quality:
When you exceed the limit, you'll get a 429 Too Many Requests
response.
Ready to start? Get your API key and add your first recipient!