Send Message
const url = 'https://api.nuntius.chat/public/v1/conversations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"content":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.nuntius.chat/public/v1/conversations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "content": "example" }'Send a free-text message into an existing conversation (SPEC_API_PUBLICA.md §2.3).
Foreign/unknown conversationId -> 404, zero persistence. For a whatsapp
conversation, the contact’s 24h session window is checked FIRST, via the SAME
SessionWindowStore every other proactive-send path in this codebase already consults –
closed (or no linked channel identity to check at all, fail-closed) -> 409 WHATSAPP_SESSION_WINDOW_CLOSED, with NOTHING written and NO attempt to resolve a channel
adapter or reach the provider (closes the gap the internal POST /conversations/{id}/ messages leaves open, this module’s own docstring). Every other channel kind (web,
telegram, messenger, instagram_dm) has no such window, so a message is always
attempted; a real delivery FAILURE past that point (bad/missing provider credentials, a
rejected send) still persists the message with deliveryStatus='failed' and returns 201
– same best-effort treatment KAP-95 already gives the internal endpoint, never silently
dropped nor mistaken for the window gate above.
Idempotency-Key (API-3, D-API-4) is optional: a repeat with the SAME header and SAME body
replays the original response without sending a second message; the SAME header with a
DIFFERENT body -> 422 IDEMPOTENCY_KEY_REUSE_MISMATCH. NOT cached: the 409 window-
closed rejection itself (a retry re-checks the window fresh, never trapped behind a stale
cached rejection).
Permiso necesario: tenant:conversations.manage
