Enviar mensaje interactivo
Botones, lista, CTA URL, flow, ubicación, contacto, llamada, producto, catálogo o carrusel. Ventana de 24 h.
POSThttps://api.octuvia.com/v1/conversations/{conversation_id}/messages
JSON con
type: interactive + objeto interactive. body es obligatorio salvo product. Máx. 3 botones; lista máx. 10 filas.Parámetros del body
Campo
Descripción
conversation_idstringrequerido
Id del hilo en la ruta (
conv_…).Ej: conv_01J8Z3K4M5N6P7Q8R9S0T1U2V3typestringrequerido
Debe ser
interactive.Ej: interactiveinteractiveobjectrequerido
Contenido interactivo.
typestringrequerido
buttons | list | cta_url | flow | location_request | contact_request | voice_call | product | catalog | carousel.Ej: buttonsheaderstringopcional
Texto de cabecera. Máx. 60.
bodystringrequerido
Cuerpo. Máx. 1024. Obligatorio salvo
product.footerstringopcional
Pie. Máx. 60.
buttonsarrayopcional
Si
type=buttons: 1–3 ítems { id, title } (title ≤ 20).listobjectopcional
Si
type=list: { button_text, sections: [{ title, rows: [{ id, title, description? }] }] }.cta_urlobjectopcional
Si
type=cta_url: { display_text, url } (http/https).flowobjectopcional
Si
type=flow: { id, cta, name?, token?, mode?, action?, screen?, data? }.reply_tostringopcional
msg_… a citar (opcional).Request
Elige interactive.type y manda solo la rama que corresponda (buttons, list, cta_url, …).
Botonesjson
{
"type": "interactive",
"interactive": {
"type": "buttons",
"header": "Hola",
"body": "¿Cómo quieres continuar?",
"footer": "OCTUVIA",
"buttons": [
{ "id": "btn_1", "title": "Botón 1" },
{ "id": "btn_2", "title": "Botón 2" }
]
}
}Listajson
{
"type": "interactive",
"interactive": {
"type": "list",
"body": "Elige una opción",
"list": {
"button_text": "Ver opciones",
"sections": [
{
"title": "Servicios",
"rows": [
{ "id": "row_1", "title": "Soporte", "description": "24/7" },
{ "id": "row_2", "title": "Ventas" }
]
}
]
}
}
}CTA URLjson
{
"type": "interactive",
"interactive": {
"type": "cta_url",
"body": "Revisa tu pedido",
"cta_url": {
"display_text": "Abrir",
"url": "https://example.com/pedido/1042"
}
}
}Response
| Campo | Uso |
|---|---|
id | msg_… encolado. |
type | Siempre interactive. |
status | queued → webhooks message.sent / message.failed. |
Respuesta del contacto
Cuando pulse un botón o fila, llegamessage.received con type: interactive_reply (o flow_reply en Flows).Language
Credentials
Header
Authorization
Token de la empresa · HTTP directo
Fetch Request
$ # Node 18+ fetch
const response = await fetch("https://api.octuvia.com/v1/conversations/conv_01J8Z3K4M5N6P7Q8R9S0T1U2V3/messages", {
method: "POST",
headers: {
"Authorization": "Bearer octuvia_live_…",
"Content-Type": "application/json"
},
body: JSON.stringify({
"type": "interactive",
"interactive": {
"type": "buttons",
"header": "Hola",
"body": "¿Cómo quieres continuar?",
"footer": "OCTUVIA",
"buttons": [
{
"id": "btn_1",
"title": "Botón 1"
},
{
"id": "btn_2",
"title": "Botón 2"
}
]
}
})
});
const data = await response.json();
console.log(data);HTTP directo · funciona con cualquier cliente HTTP
Response
Elige un ejemplo de respuesta:
application/json
202OK
{
"object": "message",
"id": "msg_01J8Z3K4M5N6P7Q8R9S0T1U2V6",
"type": "interactive",
"status": "queued"
}