Push Message
POST /push-message
Triggers an outbound message (e.g. WhatsApp) to a phone number via an approved template.
Use this when the 24-hour window on Send Message has expired and you still need to reach the user. For an active conversation (within 24 hours), prefer /message/send; after the window closes, use push message.
Header: x-access-token is required. See Authentication.
Request
POST /push-message HTTP/1.1
Host: client-api.chatbot.aithinks.net
Content-Type: application/json
x-access-token: <company-access-token>
Body fields
| Field | Type | Required | Description |
|---|---|---|---|
templateId | uuid | Yes | Message template ID |
source | string | Yes | Phone number (min. 11 characters) |
username | string | No | User display name (min. 3 characters) |
If username is omitted, the recipient name is not set.
Example
await fetch(`${BASE_URL}/push-message`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-access-token': ACCESS_TOKEN,
},
body: JSON.stringify({
templateId: '22222222-2222-2222-2222-222222222222',
source: '905551234567',
username: 'Jane Doe',
}),
});
curl -X POST https://client-api.chatbot.aithinks.net/push-message \
-H "Content-Type: application/json" \
-H "x-access-token: YOUR_TOKEN" \
-d '{
"templateId": "22222222-2222-2222-2222-222222222222",
"source": "905551234567",
"username": "Jane Doe"
}'
Successful response
{
"message": "Message sent successfully"
}
Errors
| Code | Meaning |
|---|---|
400 | Validation error |
401 | Missing / invalid token |
404 | Template not found |
Common error body: Error format.