curl --request POST \
--url https://app.thinnest.ai/api/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+91 98765 43210",
"template": "order_confirmation_v1",
"language": "en",
"variables": [
"Priya",
"#10432",
"Tuesday"
],
"buttonVariables": [
"10432"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '+91 98765 43210',
template: 'order_confirmation_v1',
language: 'en',
variables: ['Priya', '#10432', 'Tuesday'],
buttonVariables: ['10432']
})
};
fetch('https://app.thinnest.ai/api/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/messages"
payload = {
"to": "+91 98765 43210",
"template": "order_confirmation_v1",
"language": "en",
"variables": ["Priya", "#10432", "Tuesday"],
"buttonVariables": ["10432"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"messageRef": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQjM2RDVGMEU4QzA3RjE2QTYA"
}Send Message
Sends one approved template to one number and records it in that customer’s conversation. Marketing templates are refused for a customer who opted out; utility and authentication templates are not, since an order confirmation is not something a customer opts out of. Each send is charged like any WhatsApp template from your number, and the Free plan stops at its included messages. At most 60 sends a minute per workspace; send an Idempotency-Key so a retry never sends twice. Needs a full key.
curl --request POST \
--url https://app.thinnest.ai/api/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+91 98765 43210",
"template": "order_confirmation_v1",
"language": "en",
"variables": [
"Priya",
"#10432",
"Tuesday"
],
"buttonVariables": [
"10432"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '+91 98765 43210',
template: 'order_confirmation_v1',
language: 'en',
variables: ['Priya', '#10432', 'Tuesday'],
buttonVariables: ['10432']
})
};
fetch('https://app.thinnest.ai/api/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/messages"
payload = {
"to": "+91 98765 43210",
"template": "order_confirmation_v1",
"language": "en",
"variables": ["Priya", "#10432", "Tuesday"],
"buttonVariables": ["10432"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"messageRef": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQjM2RDVGMEU4QzA3RjE2QTYA"
}Authorizations
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Body
Response
WhatsApp accepted the message — not yet that it arrived; delivery and read are reported afterwards. A replay of an Idempotency-Key that already succeeded answers the same with deduplicated: true and an Idempotent-Replayed: true header.