Responder en hilo
Atajo de POST /messages: el número y el destinatario salen de la conversación. Ventana de 24 h.
POSThttps://api.octuvia.com/v1/conversations/{conversation_id}/messages
JSON. Path:
conversation_id. Body: type + el objeto de ese tipo (text, location, …). Opcional reply_to y metadata. Recomendado Idempotency-Key.Parámetros del body
Campo
Descripción
conversation_idstringrequerido
Id del hilo en la ruta (
conv_…).Ej: conv_01J8Z3K4M5N6P7Q8R9S0T1U2V3typestringrequerido
text | image | video | audio | document | sticker | location | contacts | interactive. Fuera de ventana 24 h → solo plantilla vía POST /messages.Ej: texttextobjectrequerido
Obligatorio si
type=text.bodystringrequerido
Texto del mensaje. Máx. 4096.Ej:
Hola, ¿en qué te ayudamos?preview_urlbooleanopcional
Si
true, WhatsApp genera preview de links. Default true.Ej: falsereply_tostringopcional
Opcional.
msg_… del mismo hilo a citar.Ej: msg_01J8Z3K4M5N6P7Q8R9S0T1U2V3metadataobjectopcional
Claves/valores string libres tuyos (vuelven en webhooks).
Request
Body JSON. Envía solo el objeto que corresponde a type (p. ej. con type=text manda text, no image).
Payload textojson
{
"type": "text",
"text": {
"body": "Hola, ¿en qué te ayudamos?",
"preview_url": false
}
}Payload ubicaciónjson
{
"type": "location",
"location": {
"latitude": -12.0464,
"longitude": -77.0428,
"name": "Oficina",
"address": "Lima"
}
}Response
| Campo | Uso |
|---|---|
id | msg_… aceptado. Guárdalo. |
status | Al aceptar suele ser queued. El resultado real llega por webhook (message.sent / message.failed). |
content | Eco del contenido enviado. |
422 MESSAGING_WINDOW_CLOSED
Sin inbound en 24 h no puedes usar este endpoint con texto. Usa POST /messages contype: template.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": "text",
"text": {
"body": "Hola, ¿en qué te ayudamos?",
"preview_url": false
}
})
});
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_01J8Z3K4M5N6P7Q8R9S0T1U2V4",
"conversation_id": "conv_01J8Z3K4M5N6P7Q8R9S0T1U2V3",
"direction": "outbound",
"type": "text",
"content": {
"text": {
"body": "Hola, ¿en qué te ayudamos?"
}
},
"status": "queued",
"created_at": "2026-10-28T12:01:00Z"
}