mulaichatDocs
GuidesDeveloperAPI ReferenceChangelog
Inbox
POST
/v1/inbox/conversations/{id}/messages

Queued and sent by Mulaichat within seconds; the messages come back pending, and GET …/messages shows them sent, failed or unknown. Instagram allows replies only within 24 hours of the customer's last message (422 messaging_window_closed).

text: up to 1,000 bytes. media_ids from the media library: JPG/PNG up to 8 MB (up to 10 go as one message), MP4/MOV up to 25 MB (one message each); they go before the text (422 attachment_unsupported, attachment_too_large).

buttons (1-3, text up to 640 characters; Instagram's button template) or quick_replies (1-13, shown on phones only), not both, and only with text. A tap on a postback button or a quick reply comes back as a message of kind postback or quick_reply with postback { title, payload }, and in the message.received webhook.

cards (1-10, Instagram's generic template; one card alone, 2-10 as a carousel scrolled sideways): each a title (up to 80 characters) and at least one of subtitle (80), media_id (JPG/PNG from the media library) or image_url (public https), default_action { url } and 1-3 buttons. Sent after the media and the text as a message of kind cards; not with buttons or quick_replies. Shown in the Instagram phone app only. An image Instagram cannot fetch gives no error: the card goes out without it (400 invalid_image_url for a private or non-https address).

Also 422 messaging_permission_missing. At most 60 a minute per user.

Requires the write scope.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (tb_live_...) from the dashboard, or an OAuth access token.

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key?string

1-128 characters of [A-Za-z0-9_-]. The same key gives back the same messages instead of sending again.

mulaichat-workspace?string

Limits an owner key to one profile (id or external_id). Unknown: 404 profile_not_found.

Request Body

application/json
  1. body
text?string

Up to 1,000 bytes (UTF-8); 640 characters with buttons.

Length1 <= length
media_ids?array<>

From the media library; sent before the text.

Items1 <= items <= 10
reply_to_message_id?string

A message of this conversation to reply to.

Formatuuid
buttons?array<|>

Buttons under the text: web_url opens url, postback sends payload back when tapped. Needs text; not with quick_replies.

Items1 <= items <= 3
quick_replies?array<>

Choices the customer taps to answer; the tapped one comes back with its payload. Shown in the phone app only. Needs text; not with buttons.

Items1 <= items <= 13
cards?array<>

A carousel of cards (1 alone, 2-10 scroll sideways), sent after the media and the text as a message of its own. Shown in the phone app only. Not with buttons or quick_replies.

Items1 <= items <= 10

Response Body

The queued messages, in the order they are sent.

application/json
  1. response
data*array<>
Example Request
curl -X POST 'https://api.mulaichat.com/v1/inbox/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "conversation_id": "cc71b11a-25cd-4c2d-9950-df2cc38e3407",      "direction": "in",      "source": "customer",      "kind": "text",      "status": "received",      "text": "string",      "attachments": [        {          "type": "string",          "url": "string",          "mime_type": "string"        }      ],      "reply_to_message_id": "7ee4bcf0-8f1b-4bb4-86b4-8565dd84787f",      "story": {        "id": "string",        "url": "string"      },      "postback": {        "title": "string",        "payload": "string"      },      "buttons": [        {          "type": "web_url",          "title": "string",          "url": "http://example.com"        }      ],      "quick_replies": [        {          "title": "string",          "payload": "string"        }      ],      "cards": [        {          "title": "string",          "subtitle": "string",          "media_id": "59458438-e712-4754-944d-fc838e1a631d",          "image_url": "string",          "default_action": {            "url": "string"          },          "buttons": [            {              "type": "web_url",              "title": "string",              "url": "http://example.com"            }          ]        }      ],      "reactions": [        {          "by": "customer",          "emoji": "string"        }      ],      "error_code": "string",      "seen_at": "2019-08-24T14:15:22Z",      "sent_at": "2019-08-24T14:15:22Z"    }  ]}

On this page