Create WhatsApp Templates in Bulk
curl --request POST \
--url https://api.getnexor.ai/api/public/templates/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"templates": [
{
"name": "<unknown>",
"body": "<unknown>",
"variables": "<unknown>",
"language": "<unknown>",
"category": "<unknown>",
"header": "<unknown>",
"footer": "<unknown>",
"buttons": "<unknown>",
"channel_id": "<unknown>",
"internal_type": "<unknown>"
}
],
"review_id": "<string>",
"confirm": true
}
'import requests
url = "https://api.getnexor.ai/api/public/templates/batch"
payload = {
"templates": [
{
"name": "<unknown>",
"body": "<unknown>",
"variables": "<unknown>",
"language": "<unknown>",
"category": "<unknown>",
"header": "<unknown>",
"footer": "<unknown>",
"buttons": "<unknown>",
"channel_id": "<unknown>",
"internal_type": "<unknown>"
}
],
"review_id": "<string>",
"confirm": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templates: [
{
name: '<unknown>',
body: JSON.stringify('<unknown>'),
variables: '<unknown>',
language: '<unknown>',
category: '<unknown>',
header: '<unknown>',
footer: '<unknown>',
buttons: '<unknown>',
channel_id: '<unknown>',
internal_type: '<unknown>'
}
],
review_id: '<string>',
confirm: true
})
};
fetch('https://api.getnexor.ai/api/public/templates/batch', 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.getnexor.ai/api/public/templates/batch",
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([
'templates' => [
[
'name' => '<unknown>',
'body' => '<unknown>',
'variables' => '<unknown>',
'language' => '<unknown>',
'category' => '<unknown>',
'header' => '<unknown>',
'footer' => '<unknown>',
'buttons' => '<unknown>',
'channel_id' => '<unknown>',
'internal_type' => '<unknown>'
]
],
'review_id' => '<string>',
'confirm' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getnexor.ai/api/public/templates/batch"
payload := strings.NewReader("{\n \"templates\": [\n {\n \"name\": \"<unknown>\",\n \"body\": \"<unknown>\",\n \"variables\": \"<unknown>\",\n \"language\": \"<unknown>\",\n \"category\": \"<unknown>\",\n \"header\": \"<unknown>\",\n \"footer\": \"<unknown>\",\n \"buttons\": \"<unknown>\",\n \"channel_id\": \"<unknown>\",\n \"internal_type\": \"<unknown>\"\n }\n ],\n \"review_id\": \"<string>\",\n \"confirm\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.getnexor.ai/api/public/templates/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"templates\": [\n {\n \"name\": \"<unknown>\",\n \"body\": \"<unknown>\",\n \"variables\": \"<unknown>\",\n \"language\": \"<unknown>\",\n \"category\": \"<unknown>\",\n \"header\": \"<unknown>\",\n \"footer\": \"<unknown>\",\n \"buttons\": \"<unknown>\",\n \"channel_id\": \"<unknown>\",\n \"internal_type\": \"<unknown>\"\n }\n ],\n \"review_id\": \"<string>\",\n \"confirm\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/templates/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templates\": [\n {\n \"name\": \"<unknown>\",\n \"body\": \"<unknown>\",\n \"variables\": \"<unknown>\",\n \"language\": \"<unknown>\",\n \"category\": \"<unknown>\",\n \"header\": \"<unknown>\",\n \"footer\": \"<unknown>\",\n \"buttons\": \"<unknown>\",\n \"channel_id\": \"<unknown>\",\n \"internal_type\": \"<unknown>\"\n }\n ],\n \"review_id\": \"<string>\",\n \"confirm\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"complete": true,
"submitted": 10,
"failed": 0,
"review_id": "<string>",
"results": [
{
"name": "<string>",
"language": "<string>",
"success": true,
"already_existed": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"meta_template_id": "<string>",
"status": "<string>",
"internal_type": "<string>",
"warning": "<string>"
}
],
"next_step": "<string>"
}{
"success": false,
"complete": false,
"submitted": 9,
"failed": 10,
"review_id": "<string>",
"results": [
{
"name": "<string>",
"language": "<string>",
"success": true,
"already_existed": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"meta_template_id": "<string>",
"status": "<string>",
"internal_type": "<string>",
"warning": "<string>"
}
],
"next_step": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"field": "<string>",
"value": "<unknown>",
"allowed": [
"<unknown>"
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Review changed",
"message": "<string>",
"review": {
"success": true,
"all_valid": true,
"review_id": "<string>",
"templates": [
{
"valid": true,
"errors": [
"<string>"
],
"warnings": [
"<string>"
],
"template": {
"name": "<string>",
"body": "<string>",
"variables": {},
"language": "es",
"category": "MARKETING",
"header": {
"content": "<unknown>",
"format": "TEXT",
"examples": {}
},
"footer": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>"
}
],
"channel_id": "<string>",
"internal_type": "greeting"
},
"index": 1,
"business_account_id": "<string>",
"already_exists": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"name": "<string>"
}
}
],
"normalized_templates": [
{
"name": "<string>",
"body": "<string>",
"variables": {},
"language": "es",
"category": "MARKETING",
"header": {
"content": "<unknown>",
"format": "TEXT",
"examples": {}
},
"footer": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>"
}
],
"channel_id": "<string>",
"internal_type": "greeting"
}
],
"connected_accounts": [
{
"business_account_id": "<string>",
"channels": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"display_name": "<string>"
}
]
}
],
"next_step": "<string>"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"field": "<string>",
"value": "<unknown>",
"allowed": [
"<unknown>"
]
}Crear plantillas de WhatsApp en lote
Esta operación permite crear plantillas de WhatsApp en lote en la cuenta autenticada de Nexor. Esta referencia documenta campos verificados de ruta, consulta y cuerpo JSON de nivel superior, códigos de estado observados y campos de respuesta de nivel superior. Las respuestas del proveedor o con estructuras anidadas profundas pueden permanecer abiertas.
POST
/
templates
/
batch
Create WhatsApp Templates in Bulk
curl --request POST \
--url https://api.getnexor.ai/api/public/templates/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"templates": [
{
"name": "<unknown>",
"body": "<unknown>",
"variables": "<unknown>",
"language": "<unknown>",
"category": "<unknown>",
"header": "<unknown>",
"footer": "<unknown>",
"buttons": "<unknown>",
"channel_id": "<unknown>",
"internal_type": "<unknown>"
}
],
"review_id": "<string>",
"confirm": true
}
'import requests
url = "https://api.getnexor.ai/api/public/templates/batch"
payload = {
"templates": [
{
"name": "<unknown>",
"body": "<unknown>",
"variables": "<unknown>",
"language": "<unknown>",
"category": "<unknown>",
"header": "<unknown>",
"footer": "<unknown>",
"buttons": "<unknown>",
"channel_id": "<unknown>",
"internal_type": "<unknown>"
}
],
"review_id": "<string>",
"confirm": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
templates: [
{
name: '<unknown>',
body: JSON.stringify('<unknown>'),
variables: '<unknown>',
language: '<unknown>',
category: '<unknown>',
header: '<unknown>',
footer: '<unknown>',
buttons: '<unknown>',
channel_id: '<unknown>',
internal_type: '<unknown>'
}
],
review_id: '<string>',
confirm: true
})
};
fetch('https://api.getnexor.ai/api/public/templates/batch', 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.getnexor.ai/api/public/templates/batch",
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([
'templates' => [
[
'name' => '<unknown>',
'body' => '<unknown>',
'variables' => '<unknown>',
'language' => '<unknown>',
'category' => '<unknown>',
'header' => '<unknown>',
'footer' => '<unknown>',
'buttons' => '<unknown>',
'channel_id' => '<unknown>',
'internal_type' => '<unknown>'
]
],
'review_id' => '<string>',
'confirm' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getnexor.ai/api/public/templates/batch"
payload := strings.NewReader("{\n \"templates\": [\n {\n \"name\": \"<unknown>\",\n \"body\": \"<unknown>\",\n \"variables\": \"<unknown>\",\n \"language\": \"<unknown>\",\n \"category\": \"<unknown>\",\n \"header\": \"<unknown>\",\n \"footer\": \"<unknown>\",\n \"buttons\": \"<unknown>\",\n \"channel_id\": \"<unknown>\",\n \"internal_type\": \"<unknown>\"\n }\n ],\n \"review_id\": \"<string>\",\n \"confirm\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.getnexor.ai/api/public/templates/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"templates\": [\n {\n \"name\": \"<unknown>\",\n \"body\": \"<unknown>\",\n \"variables\": \"<unknown>\",\n \"language\": \"<unknown>\",\n \"category\": \"<unknown>\",\n \"header\": \"<unknown>\",\n \"footer\": \"<unknown>\",\n \"buttons\": \"<unknown>\",\n \"channel_id\": \"<unknown>\",\n \"internal_type\": \"<unknown>\"\n }\n ],\n \"review_id\": \"<string>\",\n \"confirm\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/templates/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templates\": [\n {\n \"name\": \"<unknown>\",\n \"body\": \"<unknown>\",\n \"variables\": \"<unknown>\",\n \"language\": \"<unknown>\",\n \"category\": \"<unknown>\",\n \"header\": \"<unknown>\",\n \"footer\": \"<unknown>\",\n \"buttons\": \"<unknown>\",\n \"channel_id\": \"<unknown>\",\n \"internal_type\": \"<unknown>\"\n }\n ],\n \"review_id\": \"<string>\",\n \"confirm\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"complete": true,
"submitted": 10,
"failed": 0,
"review_id": "<string>",
"results": [
{
"name": "<string>",
"language": "<string>",
"success": true,
"already_existed": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"meta_template_id": "<string>",
"status": "<string>",
"internal_type": "<string>",
"warning": "<string>"
}
],
"next_step": "<string>"
}{
"success": false,
"complete": false,
"submitted": 9,
"failed": 10,
"review_id": "<string>",
"results": [
{
"name": "<string>",
"language": "<string>",
"success": true,
"already_existed": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"meta_template_id": "<string>",
"status": "<string>",
"internal_type": "<string>",
"warning": "<string>"
}
],
"next_step": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"field": "<string>",
"value": "<unknown>",
"allowed": [
"<unknown>"
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Review changed",
"message": "<string>",
"review": {
"success": true,
"all_valid": true,
"review_id": "<string>",
"templates": [
{
"valid": true,
"errors": [
"<string>"
],
"warnings": [
"<string>"
],
"template": {
"name": "<string>",
"body": "<string>",
"variables": {},
"language": "es",
"category": "MARKETING",
"header": {
"content": "<unknown>",
"format": "TEXT",
"examples": {}
},
"footer": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>"
}
],
"channel_id": "<string>",
"internal_type": "greeting"
},
"index": 1,
"business_account_id": "<string>",
"already_exists": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"name": "<string>"
}
}
],
"normalized_templates": [
{
"name": "<string>",
"body": "<string>",
"variables": {},
"language": "es",
"category": "MARKETING",
"header": {
"content": "<unknown>",
"format": "TEXT",
"examples": {}
},
"footer": "<string>",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "<string>"
}
],
"channel_id": "<string>",
"internal_type": "greeting"
}
],
"connected_accounts": [
{
"business_account_id": "<string>",
"channels": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"display_name": "<string>"
}
]
}
],
"next_step": "<string>"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"field": "<string>",
"value": "<unknown>",
"allowed": [
"<unknown>"
]
}Notas de seguridad y comportamiento
- HTTP 201 no significa aprobación de Meta. Las plantillas suelen permanecer PENDING hasta que una sincronización o consulta posterior informe APPROVED o REJECTED.
- Si un business_account_id activo se comparte fuera del modelo administrado por partners, la revisión puede observar el catálogo de plantillas de otro tenant.
- La revisión de plantillas existentes usa ids de WABA derivados del tenant sin un predicado client_id adicional, por lo que la suposición de propiedad del WABA compartido es importante.
- HTTP 207 es un resultado parcial normal. Revisa cada elemento de results y no reintentes a ciegas los elementos exitosos.
- Las escrituras al proveedor ocurren en secuencia y no son atómicas. Las plantillas anteriores permanecen enviadas cuando falla un elemento posterior.
- review_id vincula los borradores normalizados, incluido channel_id resuelto, pero no bloquea el estado del proveedor entre la revisión y el envío.
Autorizaciones
API key for authentication. Keys are prefixed with nxr_live_.
Cuerpo
application/json
Respuesta
Every draft was accepted/idempotently resolved by the provider service.
Opciones disponibles:
true Opciones disponibles:
true Rango requerido:
1 <= x <= 20Opciones disponibles:
0 Pattern:
^[a-f0-9]{64}$- Option 1
- Option 2
Show child attributes
Show child attributes
Última modificación el 8 de septiembre de 2026
⌘I