curl -X POST "https://api.contactship.ai/v1/waba/send-template" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "chn_abc123",
"contact_id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"template_name": "primer_contacto_v1",
"language_code": "es",
"components": [
{
"type": "BODY",
"parameters": [
{ "type": "text", "parameter_name": "nombre", "text": "Juan Pérez" },
{ "type": "text", "parameter_name": "fecha", "text": "ayer" }
]
}
]
}'
const response = await fetch(
'https://api.contactship.ai/v1/waba/send-template',
{
method: 'POST',
headers: {
'x-api-key': 'your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
channel_id: 'chn_abc123',
contact_id: 'c1d2e3f4-a5b6-7890-cdef-123456789012',
template_name: 'primer_contacto_v1',
language_code: 'es',
components: [
{
type: 'BODY',
parameters: [
{ type: 'text', parameter_name: 'nombre', text: 'Juan Pérez' },
{ type: 'text', parameter_name: 'fecha', text: 'ayer' },
],
},
],
}),
}
);
const result = await response.json();
console.log(result.data.thread_id);
import requests
response = requests.post(
'https://api.contactship.ai/v1/waba/send-template',
headers={'x-api-key': 'your-api-key'},
json={
'channel_id': 'chn_abc123',
'contact_id': 'c1d2e3f4-a5b6-7890-cdef-123456789012',
'template_name': 'primer_contacto_v1',
'language_code': 'es',
'components': [
{
'type': 'BODY',
'parameters': [
{'type': 'text', 'parameter_name': 'nombre', 'text': 'Juan Pérez'},
{'type': 'text', 'parameter_name': 'fecha', 'text': 'ayer'},
],
}
],
},
)
print(response.json())
{
"success": true,
"message": "Plantilla enviada y guardada",
"data": {
"message_id": "msg-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"provider_id": "wamid.HBgNMTIxMjM0NTY3ODkwFQIAERgSM...",
"thread_id": "thr-b2c3d4e5-f6a7-8901-bcde-f12345678901"
}
}
WhatsApp (WABA)
Send WhatsApp Template
Send an approved WhatsApp message template to a contact
POST
/
v1
/
waba
/
send-template
curl -X POST "https://api.contactship.ai/v1/waba/send-template" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "chn_abc123",
"contact_id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"template_name": "primer_contacto_v1",
"language_code": "es",
"components": [
{
"type": "BODY",
"parameters": [
{ "type": "text", "parameter_name": "nombre", "text": "Juan Pérez" },
{ "type": "text", "parameter_name": "fecha", "text": "ayer" }
]
}
]
}'
const response = await fetch(
'https://api.contactship.ai/v1/waba/send-template',
{
method: 'POST',
headers: {
'x-api-key': 'your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
channel_id: 'chn_abc123',
contact_id: 'c1d2e3f4-a5b6-7890-cdef-123456789012',
template_name: 'primer_contacto_v1',
language_code: 'es',
components: [
{
type: 'BODY',
parameters: [
{ type: 'text', parameter_name: 'nombre', text: 'Juan Pérez' },
{ type: 'text', parameter_name: 'fecha', text: 'ayer' },
],
},
],
}),
}
);
const result = await response.json();
console.log(result.data.thread_id);
import requests
response = requests.post(
'https://api.contactship.ai/v1/waba/send-template',
headers={'x-api-key': 'your-api-key'},
json={
'channel_id': 'chn_abc123',
'contact_id': 'c1d2e3f4-a5b6-7890-cdef-123456789012',
'template_name': 'primer_contacto_v1',
'language_code': 'es',
'components': [
{
'type': 'BODY',
'parameters': [
{'type': 'text', 'parameter_name': 'nombre', 'text': 'Juan Pérez'},
{'type': 'text', 'parameter_name': 'fecha', 'text': 'ayer'},
],
}
],
},
)
print(response.json())
{
"success": true,
"message": "Plantilla enviada y guardada",
"data": {
"message_id": "msg-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"provider_id": "wamid.HBgNMTIxMjM0NTY3ODkwFQIAERgSM...",
"thread_id": "thr-b2c3d4e5-f6a7-8901-bcde-f12345678901"
}
}
Sends a pre-approved WhatsApp Business message template to a contact. Templates must be approved by Meta before use. Use Get WhatsApp Templates to list available templates.
WhatsApp requires using templates to initiate conversations that have been inactive for more than 24 hours. Free-form messages can only be sent within an active 24-hour window.
Headers
string
requerido
Your API key for authentication.
Body
string
requerido
UUID of the WABA channel to send from.
string
requerido
UUID of the contact to message.
string
requerido
Name of the approved WhatsApp template (e.g.
primer_contacto_v1).string
predeterminado:"es"
Language code for the template (e.g.
es, en_US). Defaults to es.array
Template variable substitutions. Structure follows the Meta Cloud API format.
Mostrar Component object
Mostrar Component object
string
UUID of an existing thread. If provided,
channel_id and contact_id are inferred automatically.boolean
predeterminado:"true"
Whether to save the message in the conversation thread. Defaults to
true.Response
boolean
true if the template was sent successfully.object
Error Codes
400 Bad Request— Missing fields, invalid channel, or template not found, or Meta rejected the request (messagecarries the reason Meta gave, for example an expired channel token or a re-engagement window that closed)401 Unauthorized— Invalid or missing API key404 Not Found— Contact not found429 Too Many Requests— Meta rate limit; retry after a pause500 Internal Server Error— Internal failure502 Bad Gateway— Meta API unavailable; safe to retry
Code Examples
curl -X POST "https://api.contactship.ai/v1/waba/send-template" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "chn_abc123",
"contact_id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"template_name": "primer_contacto_v1",
"language_code": "es",
"components": [
{
"type": "BODY",
"parameters": [
{ "type": "text", "parameter_name": "nombre", "text": "Juan Pérez" },
{ "type": "text", "parameter_name": "fecha", "text": "ayer" }
]
}
]
}'
const response = await fetch(
'https://api.contactship.ai/v1/waba/send-template',
{
method: 'POST',
headers: {
'x-api-key': 'your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
channel_id: 'chn_abc123',
contact_id: 'c1d2e3f4-a5b6-7890-cdef-123456789012',
template_name: 'primer_contacto_v1',
language_code: 'es',
components: [
{
type: 'BODY',
parameters: [
{ type: 'text', parameter_name: 'nombre', text: 'Juan Pérez' },
{ type: 'text', parameter_name: 'fecha', text: 'ayer' },
],
},
],
}),
}
);
const result = await response.json();
console.log(result.data.thread_id);
import requests
response = requests.post(
'https://api.contactship.ai/v1/waba/send-template',
headers={'x-api-key': 'your-api-key'},
json={
'channel_id': 'chn_abc123',
'contact_id': 'c1d2e3f4-a5b6-7890-cdef-123456789012',
'template_name': 'primer_contacto_v1',
'language_code': 'es',
'components': [
{
'type': 'BODY',
'parameters': [
{'type': 'text', 'parameter_name': 'nombre', 'text': 'Juan Pérez'},
{'type': 'text', 'parameter_name': 'fecha', 'text': 'ayer'},
],
}
],
},
)
print(response.json())
{
"success": true,
"message": "Plantilla enviada y guardada",
"data": {
"message_id": "msg-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"provider_id": "wamid.HBgNMTIxMjM0NTY3ODkwFQIAERgSM...",
"thread_id": "thr-b2c3d4e5-f6a7-8901-bcde-f12345678901"
}
}
