Agent Chat APISend an event

Events

Send an event

Sends a message or a file in a chat.

The chat's assignee writes (a bot: only its own chats); an admin may write in any chat they can see, and visibility: agents makes it a note the visitor never sees. event.custom_id makes a retry safe: the same custom_id answers the first event_id and sends nothing. A file event takes url: the URL upload_file answered (or its bare ID); other URLs are refused. A message may carry up to 10 quick_replies buttons. A closed chat answers chat_inactive. Unknown request fields are ignored. Rate limit 30 per 10 s per agent or bot, and 100 calls per 10 s across these methods.

POST/v1/agent/action/send_event

Specifics

Method URLPOST https://app.staging.mlive.chat/v1/agent/action/send_event
Who can call itBots, with a bot token (mlcb_).
WebSocket actionsend_event, the same call over an open socket
Rate limit30 per 10 s per agent or bot, and 100 calls per 10 s across these methods.

Request body

application/json

  • chat_idstringrequired

  • eventobjectrequired

  • event.typestringrequired

    One of message, file.
  • event.textstring

    Message only. 1 to 4000 characters.
  • event.visibilitystring

    One of all, agents. Default "all".
  • event.custom_idstring

    Up to 200 characters.
  • event.urlstring

    File only: the url from upload_file.
  • event.quick_repliesarray of QuickReply

    Buttons under a visible message. Up to 10 items.
  • event.quick_replies[].titlestringrequired

    The button label; tapping sends it as the visitor's message. 1 to 40 characters.
  • event.quick_replies[].postbackstringrequired

    What the bot receives as the message's postback. 1 to 200 characters.

Response

200 · application/json

Sent.

  • event_idstringrequired

Errors

  • default