1. API at a Glance
Use this quick overview to understand the API architecture before starting integration. Replace {{base_url}} with your API host, add your Bearer Token, and send JSON for all requests.
Endpoint Map
| Resource | Method | Route | Purpose |
|---|---|---|---|
| Contacts | GET | /api/contacts | List contacts collection |
| Contacts | POST | /api/contacts | Create a new contact |
| Contacts | PUT | /api/contacts/{uuid} | Update contact by UUID |
| Contacts | DELETE | /api/contacts/{uuid} | Delete contact by UUID |
| Contact Groups | GET | /api/contact-groups | List all contact groups |
| Contact Groups | POST | /api/contact-groups | Create a new contact group |
| Contact Groups | PUT | /api/contact-groups/{uuid} | Rename / update group |
| Contact Groups | DELETE | /api/contact-groups/{uuid} | Delete contact group |
| Automated Replies | GET | /api/canned-replies | List automated reply rules |
| Automated Replies | POST | /api/canned-replies | Create automated reply rule |
| Automated Replies | PUT | /api/canned-replies/{uuid} | Update automated reply rule |
| Automated Replies | DELETE | /api/canned-replies/{uuid} | Delete automated reply rule |
| Messages | POST | /api/send | Send text / interactive message |
| Messages | POST | /api/send/media | Send image, audio, video, document |
| Messages | POST | /api/send/template | Send approved WhatsApp template |
{{base_url}}. Protected requests require Authorization: Bearer YOUR_AUTHORIZATION_TOKEN. Routes containing {uuid} require the record's UUID string.
2. Authentication & Request Format
WAServe uses Bearer Token authentication. Send your secret access token in the Authorization header on every request.
Authorization: Bearer YOUR_AUTHORIZATION_TOKEN
Content-Type: application/json
Base Request Pattern
curl -X METHOD '{{base_url}}/api/...' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{ ... }'
3. Contacts
Create, retrieve, update, and delete individual contact records programmatically.
Returns the paginated contact collection.
curl -X GET '{{base_url}}/api/contacts' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json'
Creates a new contact record.
Request Fields
| Field | Type | Example | Description |
|---|---|---|---|
first_name |
string | John | Contact first name |
last_name |
string | Doe | Contact last name |
email |
string | johndoe@gmail.com | Contact email address |
phone |
string | +19680825846 | Contact phone number with country code |
curl -X POST '{{base_url}}/api/contacts' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "johndoe@gmail.com",
"phone": "+19680825846"
}'
Updates an existing contact identified by UUID.
curl -X PUT '{{base_url}}/api/contacts/{uuid}' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "johndoe@gmail.com",
"phone": "+19680825846"
}'
Deletes the selected contact permanently.
curl -X DELETE '{{base_url}}/api/contacts/{uuid}' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json'
4. Contact Groups
Organize contacts into named groups for targeted WhatsApp campaign broadcasts and segmentation.
curl -X GET '{{base_url}}/api/contact-groups' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json'
curl -X POST '{{base_url}}/api/contact-groups' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"name": "VIP Customers"}'
curl -X PUT '{{base_url}}/api/contact-groups/{uuid}' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"name": "Lead Segment Q3"}'
curl -X DELETE '{{base_url}}/api/contact-groups/{uuid}' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json'
5. Automated Replies (Canned Responses)
Manage instant automated response rules triggered by incoming message keywords and patterns.
curl -X GET '{{base_url}}/api/canned-replies' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json'
Request Fields
| Field | Type | Example | Description |
|---|---|---|---|
name |
string | About Us | Rule display name |
trigger |
string | what do you do? | Keyword or trigger phrase |
match_criteria |
string | contains | Matching logic: contains, exact |
response_type |
string | text | Content type (text) |
response |
string | We sell shoes and clothes | Automated message sent back |
curl -X POST '{{base_url}}/api/canned-replies' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "About Us",
"trigger": "what do you do?",
"match_criteria": "contains",
"response_type": "text",
"response": "We offer official WhatsApp marketing and CRM solutions."
}'
curl -X PUT '{{base_url}}/api/canned-replies/{uuid}' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "About Us Updated",
"trigger": "pricing details",
"match_criteria": "contains",
"response_type": "text",
"response": "Check out our plans here: https://waserve.com/pricing"
}'
curl -X DELETE '{{base_url}}/api/canned-replies/{uuid}' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json'
6. Messaging Endpoints
Send interactive text, media attachments, and official pre-approved Meta WhatsApp templates.
Sends a standard text message with optional interactive buttons, header, and footer.
curl -X POST '{{base_url}}/api/send' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"phone": "+19680825846",
"message": "Hello John, your order has been received!",
"header": "Order Update",
"footer": "WAServe Notification",
"buttons": [
{"id": "btn_1", "title": "Track Order"},
{"id": "btn_2", "title": "Support"}
]
}'
Sends images, PDF documents, or videos to a recipient via direct public URL.
curl -X POST '{{base_url}}/api/send/media' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"phone": "+19680825846",
"media_type": "image",
"media_url": "https://images.pexels.com/photos/276267/pexels-photo-276267.jpeg",
"caption": "Check out your custom invoice preview",
"file_name": "Invoice-INV-2026.pdf"
}'
Sends a pre-approved Meta WhatsApp template message with dynamic parameters.
curl -X POST '{{base_url}}/api/send/template' \
-H 'Authorization: Bearer YOUR_AUTHORIZATION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"phone": "+19680825846",
"template": {
"name": "order_confirmation",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "John Doe"
},
{
"type": "text",
"text": "#ORD-9842"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": "0",
"parameters": [
{
"type": "payload",
"payload": "TRACK_ORDER"
}
]
}
]
}
}'
7. Multi-Language SDK Samples
Ready-to-use boilerplate code for popular backend technologies (PHP, Node.js, Python, Java, Ruby).
<?php
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post('https://app.waserve.com/api/send', [
'headers' => [
'Authorization' => 'Bearer YOUR_AUTHORIZATION_TOKEN',
'Content-Type' => 'application/json',
],
'json' => [
'phone' => '+19680825846',
'message' => 'Hello John, welcome to WAServe!',
],
]);
echo $response->getBody();
const axios = require('axios');
async function sendWhatsAppMessage() {
const response = await axios.post(
'https://app.waserve.com/api/send',
{
phone: '+19680825846',
message: 'Hello John, welcome to WAServe!'
},
{
headers: {
Authorization: 'Bearer YOUR_AUTHORIZATION_TOKEN',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
}
sendWhatsAppMessage();
import requests
url = 'https://app.waserve.com/api/send'
headers = {
'Authorization': 'Bearer YOUR_AUTHORIZATION_TOKEN',
'Content-Type': 'application/json'
}
payload = {
'phone': '+19680825846',
'message': 'Hello John, welcome to WAServe!'
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
import okhttp3.*;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(
"{\"phone\":\"+19680825846\",\"message\":\"Hello John, welcome to WAServe!\"}",
mediaType
);
Request request = new Request.Builder()
.url("https://app.waserve.com/api/send")
.post(body)
.addHeader("Authorization", "Bearer YOUR_AUTHORIZATION_TOKEN")
.addHeader("Content-Type", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
}
require 'uri'
require 'net/http'
require 'json'
uri = URI('https://app.waserve.com/api/send')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer YOUR_AUTHORIZATION_TOKEN'
req['Content-Type'] = 'application/json'
req.body = {
phone: '+19680825846',
message: 'Hello John, welcome to WAServe!'
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(req)
end
puts res.body
8. Testing & Production Checklist
Verify these critical items before deploying your WhatsApp messaging integration to live production.
Recommended Test Sequence
| Step | Action | What to Verify |
|---|---|---|
| Step 1 | Verify authentication | Call GET /api/contacts with your Bearer token. Verify HTTP 200 OK. |
| Step 2 | Create test record | Call POST /api/contacts and store the returned uuid. |
| Step 3 | Update test record | Call PUT /api/contacts/{uuid} and confirm fields update. |
| Step 4 | Exercise messaging | Send a test text message to your verified WhatsApp number. |
| Step 5 | Clean up | Delete test records with DELETE /api/contacts/{uuid}. |
Client Handoff Checklist
https://app.waserve.com).
+919876543210).