---
title: "Send live chat reply"
method: POST
path: "/conversations/{phone}/messages"
tags: ["Conversations & Live Chat"]
---

# Send live chat reply

`POST /conversations/{phone}/messages`

## Request

- Base URL: `https://api.envoisms.ma/v1`
- URL: `https://api.envoisms.ma/v1/conversations/{phone}/messages`
- Auth: HTTP bearer

Sends an agent message to a contact and mutes the bot on that conversation (un-mute with POST /conversations/{phone}/toggle-bot). A free-form WhatsApp message (text or media) requires the contact to have written in the last 24 hours — otherwise 400 OUT_OF_24H_WINDOW; a template (template_id or template_name) may be sent at any time. Billed like the same send on POST /messages.

## Path parameters

- `phone` string, required

## Request body

- object
  - `message` string: Text of the reply (or the caption of media_url)
  - `channel` 'whatsapp' | 'sms'
  - `phone_number_id` string: Which connected WhatsApp number replies
  - `template_name` string: Approved WhatsApp template to send instead of free text
  - `template_id` string
  - `template_language` string
  - `variables` string[]: Template placeholder values in order
  - `media_url` string: https URL (or data: URI) of an image or PDF to attach
  - `media_type` 'image' | 'document'
  - `filename` string

## Response `201`

Reply sent

- object
  - `ok` boolean
  - `message` object
    - `id` string
    - `phone` string
    - `role` string
    - `message` string
    - `status` string
    - `channel` string
    - `created_at` string, date-time

## Other responses

- `400`: OUT_OF_24H_WINDOW, TEMPLATE_NOT_APPROVED or MISSING_MESSAGE
- `404`: TEMPLATE_NOT_FOUND

---

[API](https://skmtc.dev/envoisms/apis/envoisms-ma-api.md) · [All operations](https://skmtc.dev/envoisms/apis/envoisms-ma-api/llms.txt) · [OpenAPI document](https://skmtc.dev/envoisms/apis/envoisms-ma-api/revisions/662db074bd86?raw)
