Submit a WhatsApp template
curl --request POST \
--url https://api.inbox.adraa.ai/api/v1/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+15551230000",
"name": "order_tracking_update",
"category": "UTILITY",
"language": "en_US",
"bodyText": "Hello {{1}}, your order {{2}} has shipped. Track its delivery below.",
"bodyExamples": [
"Sara",
"A-100"
],
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/orders/{{1}}",
"example": [
"https://shop.example.com/orders/A-100"
]
}
]
}
'import requests
url = "https://api.inbox.adraa.ai/api/v1/whatsapp/templates"
payload = {
"from": "+15551230000",
"name": "order_tracking_update",
"category": "UTILITY",
"language": "en_US",
"bodyText": "Hello {{1}}, your order {{2}} has shipped. Track its delivery below.",
"bodyExamples": ["Sara", "A-100"],
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/orders/{{1}}",
"example": ["https://shop.example.com/orders/A-100"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '+15551230000',
name: 'order_tracking_update',
category: 'UTILITY',
language: 'en_US',
bodyText: 'Hello {{1}}, your order {{2}} has shipped. Track its delivery below.',
bodyExamples: ['Sara', 'A-100'],
buttons: [
{
type: 'URL',
text: 'Track order',
url: 'https://shop.example.com/orders/{{1}}',
example: ['https://shop.example.com/orders/A-100']
}
]
})
};
fetch('https://api.inbox.adraa.ai/api/v1/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.inbox.adraa.ai/api/v1/whatsapp/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '+15551230000',
'name' => 'order_tracking_update',
'category' => 'UTILITY',
'language' => 'en_US',
'bodyText' => 'Hello {{1}}, your order {{2}} has shipped. Track its delivery below.',
'bodyExamples' => [
'Sara',
'A-100'
],
'buttons' => [
[
'type' => 'URL',
'text' => 'Track order',
'url' => 'https://shop.example.com/orders/{{1}}',
'example' => [
'https://shop.example.com/orders/A-100'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.inbox.adraa.ai/api/v1/whatsapp/templates"
payload := strings.NewReader("{\n \"from\": \"+15551230000\",\n \"name\": \"order_tracking_update\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"bodyText\": \"Hello {{1}}, your order {{2}} has shipped. Track its delivery below.\",\n \"bodyExamples\": [\n \"Sara\",\n \"A-100\"\n ],\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/orders/{{1}}\",\n \"example\": [\n \"https://shop.example.com/orders/A-100\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.inbox.adraa.ai/api/v1/whatsapp/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"+15551230000\",\n \"name\": \"order_tracking_update\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"bodyText\": \"Hello {{1}}, your order {{2}} has shipped. Track its delivery below.\",\n \"bodyExamples\": [\n \"Sara\",\n \"A-100\"\n ],\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/orders/{{1}}\",\n \"example\": [\n \"https://shop.example.com/orders/A-100\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.inbox.adraa.ai/api/v1/whatsapp/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"+15551230000\",\n \"name\": \"order_tracking_update\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"bodyText\": \"Hello {{1}}, your order {{2}} has shipped. Track its delivery below.\",\n \"bodyExamples\": [\n \"Sara\",\n \"A-100\"\n ],\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/orders/{{1}}\",\n \"example\": [\n \"https://shop.example.com/orders/A-100\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"template": {
"id": "123456789012345",
"status": "PENDING",
"category": "UTILITY"
}
}{
"error": {
"code": "WHATSAPP_SENDER_AMBIGUOUS",
"message": "Multiple WhatsApp numbers are connected; specify \"from\""
}
}{
"error": {
"code": "INVALID_API_TOKEN",
"message": "Invalid or revoked API token"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}WhatsApp
Submit a WhatsApp template
Submits a new message template for WhatsApp approval using a connected account in your workspace. Supports utility and marketing templates with a text body, optional text header/footer, and quick reply, website, or phone buttons. Approval is asynchronous; a successful submission does not mean the template is approved and does not send a message. Check its status under Settings → Templates. GET /api/v1/whatsapp/templates lists approved templates only.
For a dynamic website button, end the URL with {{1}} and provide one full example URL with a sample value in place of the placeholder. When sending the approved template, use buttonParameters with subtype url to supply the variable suffix. Authentication templates and media headers are not supported by this submission endpoint.
Rate limit: 30 requests per minute per IP.
POST
/
api
/
v1
/
whatsapp
/
templates
Submit a WhatsApp template
curl --request POST \
--url https://api.inbox.adraa.ai/api/v1/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+15551230000",
"name": "order_tracking_update",
"category": "UTILITY",
"language": "en_US",
"bodyText": "Hello {{1}}, your order {{2}} has shipped. Track its delivery below.",
"bodyExamples": [
"Sara",
"A-100"
],
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/orders/{{1}}",
"example": [
"https://shop.example.com/orders/A-100"
]
}
]
}
'import requests
url = "https://api.inbox.adraa.ai/api/v1/whatsapp/templates"
payload = {
"from": "+15551230000",
"name": "order_tracking_update",
"category": "UTILITY",
"language": "en_US",
"bodyText": "Hello {{1}}, your order {{2}} has shipped. Track its delivery below.",
"bodyExamples": ["Sara", "A-100"],
"buttons": [
{
"type": "URL",
"text": "Track order",
"url": "https://shop.example.com/orders/{{1}}",
"example": ["https://shop.example.com/orders/A-100"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '+15551230000',
name: 'order_tracking_update',
category: 'UTILITY',
language: 'en_US',
bodyText: 'Hello {{1}}, your order {{2}} has shipped. Track its delivery below.',
bodyExamples: ['Sara', 'A-100'],
buttons: [
{
type: 'URL',
text: 'Track order',
url: 'https://shop.example.com/orders/{{1}}',
example: ['https://shop.example.com/orders/A-100']
}
]
})
};
fetch('https://api.inbox.adraa.ai/api/v1/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.inbox.adraa.ai/api/v1/whatsapp/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '+15551230000',
'name' => 'order_tracking_update',
'category' => 'UTILITY',
'language' => 'en_US',
'bodyText' => 'Hello {{1}}, your order {{2}} has shipped. Track its delivery below.',
'bodyExamples' => [
'Sara',
'A-100'
],
'buttons' => [
[
'type' => 'URL',
'text' => 'Track order',
'url' => 'https://shop.example.com/orders/{{1}}',
'example' => [
'https://shop.example.com/orders/A-100'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.inbox.adraa.ai/api/v1/whatsapp/templates"
payload := strings.NewReader("{\n \"from\": \"+15551230000\",\n \"name\": \"order_tracking_update\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"bodyText\": \"Hello {{1}}, your order {{2}} has shipped. Track its delivery below.\",\n \"bodyExamples\": [\n \"Sara\",\n \"A-100\"\n ],\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/orders/{{1}}\",\n \"example\": [\n \"https://shop.example.com/orders/A-100\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.inbox.adraa.ai/api/v1/whatsapp/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"+15551230000\",\n \"name\": \"order_tracking_update\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"bodyText\": \"Hello {{1}}, your order {{2}} has shipped. Track its delivery below.\",\n \"bodyExamples\": [\n \"Sara\",\n \"A-100\"\n ],\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/orders/{{1}}\",\n \"example\": [\n \"https://shop.example.com/orders/A-100\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.inbox.adraa.ai/api/v1/whatsapp/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"+15551230000\",\n \"name\": \"order_tracking_update\",\n \"category\": \"UTILITY\",\n \"language\": \"en_US\",\n \"bodyText\": \"Hello {{1}}, your order {{2}} has shipped. Track its delivery below.\",\n \"bodyExamples\": [\n \"Sara\",\n \"A-100\"\n ],\n \"buttons\": [\n {\n \"type\": \"URL\",\n \"text\": \"Track order\",\n \"url\": \"https://shop.example.com/orders/{{1}}\",\n \"example\": [\n \"https://shop.example.com/orders/A-100\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"template": {
"id": "123456789012345",
"status": "PENDING",
"category": "UTILITY"
}
}{
"error": {
"code": "WHATSAPP_SENDER_AMBIGUOUS",
"message": "Multiple WhatsApp numbers are connected; specify \"from\""
}
}{
"error": {
"code": "INVALID_API_TOKEN",
"message": "Invalid or revoked API token"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Body
application/json
Customer message, with at least two words. Numbered placeholders such as {{1}} require matching sample values in bodyExamples.
Required string length:
10 - 1024Example:
"Hello {{1}}, your order {{2}} has shipped. Track its delivery below."