Conversations & Live Chat

Send live chat reply

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.

post/conversations/{phone}/messages

Request

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

Path parameters

phonestring required
Example:+212612345678

Request body

messagestring

Text of the reply (or the caption of media_url)

channel'whatsapp' | 'sms'
phone_number_idstring

Which connected WhatsApp number replies

template_namestring

Approved WhatsApp template to send instead of free text

template_idstring
template_languagestring
variablesstring[]

Template placeholder values in order

media_urlstring

https URL (or data: URI) of an image or PDF to attach

media_type'image' | 'document'
filenamestring

Example request

{
  "template_language": "fr"
}

Response

Reply sent

okboolean

Example response

{
  "message": {
    "role": "agent",
    "status": "sent"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.