List approved templates for a number
List approved templates for a number
/api/v1/whatsapp/templatesBefore you start
Connect your business and number in Portal → WhatsApp → Numbers & accounts first. Use an account-owner Production API key. Create templates in the Portal.
Result
Provide an IllyVoIP number_id from GET /numbers. Returns approved templates for its business with components and parameter_format so you can fill their fields. Create, edit, submit and refresh templates in the Portal. Results use cursor pagination. Legacy connection_id is accepted only instead of number_id for existing integrations.
Charges and safe retries
Inspect uncertain operations before retrying. A queued message is not delivered. IllyVoIP reserves its fee at queue admission and charges only delivered outbound messages; incoming messages are free.
Authentication
Send your account API key in the X-Api-Key header. Keep it on your server; never embed it in browser code.
Request examples
Replace the example values with your own inputs. Examples do not run on this page. Production requests can change your account or incur charges.
cURL
curl -X GET "https://app.illyvoip.com/api/v1/whatsapp/templates?number_id=YOUR_NUMBER_ID" \
-H "X-Api-Key: ${ILLYVOIP_API_KEY:?Set ILLYVOIP_API_KEY}"Node.js
const response = await fetch("https://app.illyvoip.com/api/v1/whatsapp/templates?number_id=YOUR_NUMBER_ID", {
method: "GET",
headers: {
"X-Api-Key": process.env.ILLYVOIP_API_KEY
}
});
const data = await response.json();
console.log(response.status, data);PHP
<?php
$ch = curl_init('https://app.illyvoip.com/api/v1/whatsapp/templates?number_id=YOUR_NUMBER_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: ' . getenv('ILLYVOIP_API_KEY')
],
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . PHP_EOL;
echo $response;Python
import os
import json
import requests
response = requests.request(
"GET",
"https://app.illyvoip.com/api/v1/whatsapp/templates?number_id=YOUR_NUMBER_ID",
headers={
"X-Api-Key": os.environ["ILLYVOIP_API_KEY"]
},
)
print(response.status_code)
print(response.json())Node.js examples run on the server (Node.js 22.17+). Python examples require requests; PHP examples require cURL. Set the environment variables referenced in each example.
Request parameters
Query parameters
number_idintegeroptionalRequired unless using the legacy connection_id selector. Supply exactly one selector.
connection_idintegeroptionalafterintegeroptionallimitintegeroptionalRequest behavior
Provide an IllyVoIP number_id from GET /numbers. Returns approved templates for its business with components and parameter_format so you can fill their fields. Create, edit, submit and refresh templates in the Portal. Results use cursor pagination. Legacy connection_id is accepted only instead of number_id for existing integrations.
Conditions and examples
Production only; no WhatsApp Sandbox is available. Replace placeholders with your own account data. Response examples are abbreviated; use the OpenAPI schemas for the full contract. Meta bills its charges separately.
Response fields
data: Endpoint-specific result object. Its nested fields are shown in the sample response.
HTTP responses
Expand a status to inspect its documented response format and examples. Example prices, IDs and timestamps are illustrative values, not quotes or account records.
200 Inspect the returned status. Local draft or submission receipt does not mean Meta approval.
application/json
successbooleanrequireddataobjectrequiredView nested fields
itemsarray<object>optionalView nested fields
Array items
idvalueoptionalView nested fields
oneOf schema alternatives
Type: integer
Type: string
namestringoptionallanguagestringoptionalcategorystringoptionalstatusstringoptionalparameter_formatstringoptionalupdated_atstringoptionalcomponentsarray<object>optionalView nested fields
Array items
Type: object
Additional properties: not allowed.
next_cursorintegeroptionalFull schema
{
"type": "object",
"required": [
"success",
"data"
],
"properties": {
"success": {
"type": "boolean"
},
"data": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"name": {
"type": "string"
},
"language": {
"type": "string"
},
"category": {
"type": "string"
},
"status": {
"type": "string"
},
"parameter_format": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"components": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"additionalProperties": false
}
},
"next_cursor": {
"type": "integer",
"nullable": true
}
}
}
}
}400 Invalid template or request.
401 Invalid API credential.
403 Insufficient account permissions.
409 Unavailable template, identity conflict, in-progress operation or recovery required.
503 Outcome unconfirmed. Inspect current state before a replacement operation.
Production only
This operation is not available in Sandbox. Use an enabled Production account and review its effects before executing.