curl --request POST \
--url https://app.thinnest.ai/api/v1/codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+91 98123 45678",
"code": "394812"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '+91 98123 45678', code: '394812'})
};
fetch('https://app.thinnest.ai/api/v1/codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/codes"
payload = {
"to": "+91 98123 45678",
"code": "394812"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"sent": true,
"to": "919812345678",
"template": "login_code",
"language": "en",
"messageRef": "wamid.HBgMOTE5ODEyMzQ1Njc4FQIAERgSNEQ3QTlFMkI1QzFGOEQ2MEEA"
}Send One-Time Code
Sends a code you generated to a WhatsApp number, using your approved authentication template — the code goes into the message and the copy-code button. We do not generate, store, expire or check the code; that stays yours. One number may be sent at most 5 codes in 10 minutes, and the workspace at most 120 sends a minute (codes keep the top of the budget it shares with Send Message). Each code is charged at WhatsApp’s authentication rate, which is far higher for numbers abroad. Needs a full key.
curl --request POST \
--url https://app.thinnest.ai/api/v1/codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+91 98123 45678",
"code": "394812"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '+91 98123 45678', code: '394812'})
};
fetch('https://app.thinnest.ai/api/v1/codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/codes"
payload = {
"to": "+91 98123 45678",
"code": "394812"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"sent": true,
"to": "919812345678",
"template": "login_code",
"language": "en",
"messageRef": "wamid.HBgMOTE5ODEyMzQ1Njc4FQIAERgSNEQ3QTlFMkI1QzFGOEQ2MEEA"
}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 code. A replay of an Idempotency-Key returns the first answer, whatever it was, with an Idempotent-Replayed: true header.