curl --request POST \
--url https://api.automationhub.one/api:RIKjHOHm/campaigns \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"idempotency_key": "presupuesto-4812-followup-1",
"template_name": "seguimiento_presupuesto",
"template_language": "es_AR",
"external_ref": "PRES-4812",
"campaign_name": "Follow-up presupuesto 4812",
"recipients": [
{
"phone": "+5491123456789",
"params": [
"Juan",
"4812"
]
}
]
}
'import requests
url = "https://api.automationhub.one/api:RIKjHOHm/campaigns"
payload = {
"idempotency_key": "presupuesto-4812-followup-1",
"template_name": "seguimiento_presupuesto",
"template_language": "es_AR",
"external_ref": "PRES-4812",
"campaign_name": "Follow-up presupuesto 4812",
"recipients": [
{
"phone": "+5491123456789",
"params": ["Juan", "4812"]
}
]
}
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({
idempotency_key: 'presupuesto-4812-followup-1',
template_name: 'seguimiento_presupuesto',
template_language: 'es_AR',
external_ref: 'PRES-4812',
campaign_name: 'Follow-up presupuesto 4812',
recipients: [{phone: '+5491123456789', params: ['Juan', '4812']}]
})
};
fetch('https://api.automationhub.one/api:RIKjHOHm/campaigns', 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.automationhub.one/api:RIKjHOHm/campaigns",
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([
'idempotency_key' => 'presupuesto-4812-followup-1',
'template_name' => 'seguimiento_presupuesto',
'template_language' => 'es_AR',
'external_ref' => 'PRES-4812',
'campaign_name' => 'Follow-up presupuesto 4812',
'recipients' => [
[
'phone' => '+5491123456789',
'params' => [
'Juan',
'4812'
]
]
]
]),
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.automationhub.one/api:RIKjHOHm/campaigns"
payload := strings.NewReader("{\n \"idempotency_key\": \"presupuesto-4812-followup-1\",\n \"template_name\": \"seguimiento_presupuesto\",\n \"template_language\": \"es_AR\",\n \"external_ref\": \"PRES-4812\",\n \"campaign_name\": \"Follow-up presupuesto 4812\",\n \"recipients\": [\n {\n \"phone\": \"+5491123456789\",\n \"params\": [\n \"Juan\",\n \"4812\"\n ]\n }\n ]\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.automationhub.one/api:RIKjHOHm/campaigns")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"presupuesto-4812-followup-1\",\n \"template_name\": \"seguimiento_presupuesto\",\n \"template_language\": \"es_AR\",\n \"external_ref\": \"PRES-4812\",\n \"campaign_name\": \"Follow-up presupuesto 4812\",\n \"recipients\": [\n {\n \"phone\": \"+5491123456789\",\n \"params\": [\n \"Juan\",\n \"4812\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.automationhub.one/api:RIKjHOHm/campaigns")
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 \"idempotency_key\": \"presupuesto-4812-followup-1\",\n \"template_name\": \"seguimiento_presupuesto\",\n \"template_language\": \"es_AR\",\n \"external_ref\": \"PRES-4812\",\n \"campaign_name\": \"Follow-up presupuesto 4812\",\n \"recipients\": [\n {\n \"phone\": \"+5491123456789\",\n \"params\": [\n \"Juan\",\n \"4812\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"campaign_id": "<string>",
"status": "sent",
"campaign_name": "<string>",
"external_ref": "<string>",
"recipients": {
"added": 123,
"duplicates": 123,
"errors": [
"<string>"
]
},
"replayed": true
}{
"code": "ERROR_CODE_INPUT_ERROR",
"message": "Template 'seguimiento_presupuesto' not found or not APPROVED.",
"payload": {
"campaign_id": null,
"external_ref": null
}
}{
"code": "ERROR_CODE_INPUT_ERROR",
"message": "Template 'seguimiento_presupuesto' not found or not APPROVED.",
"payload": {
"campaign_id": null,
"external_ref": null
}
}{
"code": "ERROR_CODE_INPUT_ERROR",
"message": "Template 'seguimiento_presupuesto' not found or not APPROVED.",
"payload": {
"campaign_id": null,
"external_ref": null
}
}Enviar un template (campaña)
Una sola llamada crea la campaña, carga el/los destinatario(s) y ejecuta
el envío. Devuelve el campaign_id que después llega en el webhook de
respuestas.
Idempotencia: si reintentás con la misma idempotency_key, no se
duplica el envío — devolvemos la respuesta original con replayed: true.
Ante un error 502, reintentá con la misma clave.
curl --request POST \
--url https://api.automationhub.one/api:RIKjHOHm/campaigns \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"idempotency_key": "presupuesto-4812-followup-1",
"template_name": "seguimiento_presupuesto",
"template_language": "es_AR",
"external_ref": "PRES-4812",
"campaign_name": "Follow-up presupuesto 4812",
"recipients": [
{
"phone": "+5491123456789",
"params": [
"Juan",
"4812"
]
}
]
}
'import requests
url = "https://api.automationhub.one/api:RIKjHOHm/campaigns"
payload = {
"idempotency_key": "presupuesto-4812-followup-1",
"template_name": "seguimiento_presupuesto",
"template_language": "es_AR",
"external_ref": "PRES-4812",
"campaign_name": "Follow-up presupuesto 4812",
"recipients": [
{
"phone": "+5491123456789",
"params": ["Juan", "4812"]
}
]
}
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({
idempotency_key: 'presupuesto-4812-followup-1',
template_name: 'seguimiento_presupuesto',
template_language: 'es_AR',
external_ref: 'PRES-4812',
campaign_name: 'Follow-up presupuesto 4812',
recipients: [{phone: '+5491123456789', params: ['Juan', '4812']}]
})
};
fetch('https://api.automationhub.one/api:RIKjHOHm/campaigns', 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.automationhub.one/api:RIKjHOHm/campaigns",
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([
'idempotency_key' => 'presupuesto-4812-followup-1',
'template_name' => 'seguimiento_presupuesto',
'template_language' => 'es_AR',
'external_ref' => 'PRES-4812',
'campaign_name' => 'Follow-up presupuesto 4812',
'recipients' => [
[
'phone' => '+5491123456789',
'params' => [
'Juan',
'4812'
]
]
]
]),
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.automationhub.one/api:RIKjHOHm/campaigns"
payload := strings.NewReader("{\n \"idempotency_key\": \"presupuesto-4812-followup-1\",\n \"template_name\": \"seguimiento_presupuesto\",\n \"template_language\": \"es_AR\",\n \"external_ref\": \"PRES-4812\",\n \"campaign_name\": \"Follow-up presupuesto 4812\",\n \"recipients\": [\n {\n \"phone\": \"+5491123456789\",\n \"params\": [\n \"Juan\",\n \"4812\"\n ]\n }\n ]\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.automationhub.one/api:RIKjHOHm/campaigns")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"presupuesto-4812-followup-1\",\n \"template_name\": \"seguimiento_presupuesto\",\n \"template_language\": \"es_AR\",\n \"external_ref\": \"PRES-4812\",\n \"campaign_name\": \"Follow-up presupuesto 4812\",\n \"recipients\": [\n {\n \"phone\": \"+5491123456789\",\n \"params\": [\n \"Juan\",\n \"4812\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.automationhub.one/api:RIKjHOHm/campaigns")
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 \"idempotency_key\": \"presupuesto-4812-followup-1\",\n \"template_name\": \"seguimiento_presupuesto\",\n \"template_language\": \"es_AR\",\n \"external_ref\": \"PRES-4812\",\n \"campaign_name\": \"Follow-up presupuesto 4812\",\n \"recipients\": [\n {\n \"phone\": \"+5491123456789\",\n \"params\": [\n \"Juan\",\n \"4812\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"campaign_id": "<string>",
"status": "sent",
"campaign_name": "<string>",
"external_ref": "<string>",
"recipients": {
"added": 123,
"duplicates": 123,
"errors": [
"<string>"
]
},
"replayed": true
}{
"code": "ERROR_CODE_INPUT_ERROR",
"message": "Template 'seguimiento_presupuesto' not found or not APPROVED.",
"payload": {
"campaign_id": null,
"external_ref": null
}
}{
"code": "ERROR_CODE_INPUT_ERROR",
"message": "Template 'seguimiento_presupuesto' not found or not APPROVED.",
"payload": {
"campaign_id": null,
"external_ref": null
}
}{
"code": "ERROR_CODE_INPUT_ERROR",
"message": "Template 'seguimiento_presupuesto' not found or not APPROVED.",
"payload": {
"campaign_id": null,
"external_ref": null
}
}Authorizations
API key provista por Xenda (formato xnd_...). Se envía en todas las llamadas.
Body
Clave única por envío. Reintentos con la misma clave no duplican el envío.
1281 - 1000 elementsShow child attributes
Show child attributes
Nombre exacto del template aprobado. Requerido si no mandás template_id.
Código de idioma (ej. es_AR). Requerido solo si el template existe en más de un idioma.
ID del template (alternativa a template_name).
Tu referencia (ej. ID de presupuesto). Se devuelve en la respuesta y en el webhook de respuestas.
Nombre visible de la campaña en la plataforma. Default: API - {template} - {external_ref}.
URL pública https del archivo del header. Obligatorio si el template tiene header de imagen, video o documento (PDF) — sin este campo el envío devuelve 400. No se acepta base64: el archivo tiene que estar hosteado y ser descargable sin autenticación. Límites de WhatsApp: imagen 5 MB (jpg/png), video 16 MB (mp4), documento 100 MB (PDF). Para documentos, el nombre del archivo se toma de la URL.
Response
Envío ejecutado (o replay idempotente de un envío previo).
ID del envío. Guardalo — viene en el webhook de respuestas.
sent Show child attributes
Show child attributes
true si esta respuesta es el replay de un envío previo con la misma idempotency_key.

