WhatsApp messages
Send WhatsApp messages through your Galatext account. Customer endpoints require a bearer JWT. Galatext manages service configuration and sender activation.
Check readiness
const configuration = await client.whatsapp.configuration();GET /api/whatsapp/configuration returns configured, senderNumber, ready, enabled, and callbackConfigured. Contact Galatext if the account is not ready to send.
Send a message
POST /api/whatsapp/send
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json| Field | Type | Description |
|---|---|---|
requestId | UUID | Required; reuse for retries of the same submission |
recipients | string[] | Required; 1–500 recipient numbers |
body | string | Free-text reply, up to 2,000 characters; use within an open reply window |
contentSid | string | Approved Galatext template reference returned by the templates endpoint |
contentVariables | object | Template variable values keyed by placeholder number |
Before sending free text, check recipients:
const audience = await client.whatsapp.audience(['254712345678']);
if (audience.needsTemplate.length === 0) {
const result = await client.whatsapp.send({
requestId: crypto.randomUUID(),
recipients: audience.recipients,
body: 'Your order is ready for collection.',
});
console.log(result.batchId);
}POST /api/whatsapp/audience accepts { recipients } and returns normalized recipients plus needsTemplate. A recipient without an inbound message in the last 24 hours requires an approved template. See templates.
The service queues accepted sends and returns 202 Accepted with batch information, including batchId, totalQueued, totalSent, totalFailed, and remainingCredits. A queued message is not yet delivered.
Retrying an identical submission with the same requestId returns the existing batch. Reusing the ID for different content returns 409.
Track progress
const batch = await client.whatsapp.batch(batchId);
const messages = await client.whatsapp.logs(50);These call GET /api/whatsapp/batches/:id and GET /api/whatsapp/logs?limit=50. Use the batch result and message statuses to track processing. The current customer API does not expose arbitrary media messages or customer service-provisioning endpoints.