Retail Leads
Use for contacts collected from retail campaigns or landing pages.
Create a new account-wide contact book.
Create a new account-wide contact book.
Endpoint: POST /api/v2/contact-books. Create a contact book before linking contacts through the bulk upload endpoint. The contact book is created with ACTIVE status.
/api/v2/contact-books| Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | header | Required | Bearer w91_public_token_here. Must be a global public API token. |
Content-Type | header | Required | Content-Type: application/json. |
authToken | string | Optional | Compatibility body token. auth_token and token are also accepted. |
name | string | Required | Contact book name. |
description | string | Optional | Short explanation of the book purpose. |
color | string | Optional | Hex color used for dashboard grouping, for example #0f62fe. |
curl -X POST "https://graph.whats91.com/api/v2/contact-books" \
-H "Authorization: Bearer w91_public_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Retail Leads",
"description": "Retail campaign contacts",
"color": "#0f62fe"
}'{
"success": true,
"message": "Contact book created",
"data": {
"contactBook": {
"contactBookUid": "grp_abc",
"uid": "grp_abc",
"name": "Retail Leads",
"description": "Retail campaign contacts",
"color": "#0f62fe",
"status": "ACTIVE",
"contactCount": 0
}
},
"metadata": {
"apiVersion": "v2",
"requestId": "request-uuid"
}
}Use for contacts collected from retail campaigns or landing pages.
Use for high-value customers and priority broadcasts.
Use for onboarding journeys and product education campaigns.
Use for event follow-up, reminders, and feedback collection.
Use these examples as starting points for server-side implementations.
curl -X POST "https://graph.whats91.com/api/v2/contact-books" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d 'curl -X POST "https://graph.whats91.com/api/v2/contact-books" \
-H "Authorization: Bearer w91_public_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Retail Leads",
"description": "Retail campaign contacts",
"color": "#0f62fe"
}''const response = await fetch("https://graph.whats91.com/api/v2/contact-books", {
method: "POST",
headers: {
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify(curl -X POST "https://graph.whats91.com/api/v2/contact-books" \
-H "Authorization: Bearer w91_public_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Retail Leads",
"description": "Retail campaign contacts",
"color": "#0f62fe"
}')
});
const data = await response.json();
console.log(data);$ch = curl_init("https://graph.whats91.com/api/v2/contact-books");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer w91_live_xxx",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode(curl -X POST "https://graph.whats91.com/api/v2/contact-books" \
-H "Authorization: Bearer w91_public_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Retail Leads",
"description": "Retail campaign contacts",
"color": "#0f62fe"
}')
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;import requests
response = requests.request(
"POST",
"https://graph.whats91.com/api/v2/contact-books",
headers={
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json",
},
json=curl -X POST "https://graph.whats91.com/api/v2/contact-books" \
-H "Authorization: Bearer w91_public_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Retail Leads",
"description": "Retail campaign contacts",
"color": "#0f62fe"
}'
)
print(response.json())using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer w91_live_xxx");
var request = new HttpRequestMessage(HttpMethod.Post, "https://graph.whats91.com/api/v2/contact-books");
request.Content = new StringContent(
"""curl -X POST \"https://graph.whats91.com/api/v2/contact-books\" \
-H \"Authorization: Bearer w91_public_token_here\" \
-H \"Content-Type: application/json\" \
-d '{
\"name\": \"Retail Leads\",
\"description\": \"Retail campaign contacts\",
\"color\": \"#0f62fe\"
}'""",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());