MessageContent
Message body, selected by `type`. `text`, `media`, `template`, `richMessage` and `whatsapp` are the types you can send. `formResponse`, `location` and `interactiveReply` come from customers, and `system` marks events in the conversation timeline.
Variants
Set type to one of text, media, template, richMessage, whatsapp, formResponse, location, interactiveReply, system.
TextMessageContent
textPlain text message content.
- Name
type- Type
- const
- required
- Name
text- Type
- TextContent
- required
{
"type": "text",
"text": {
"body": "Hi Anna, your order is ready for pickup."
}
}MediaMessageContent
mediaMedia message content. Upload the file with `POST /media/uploads` first, then pass the returned `mediaId`.
- Name
type- Type
- const
- required
- Name
media- Type
- Content
- required
{
"type": "media",
"media": {
"mediaId": "mda_d7pka1i9v5sfp2ud6chg",
"caption": "Your invoice is attached.",
"filename": "invoice-4827.pdf",
"mimeType": "application/pdf",
"mediaType": "document"
}
}TemplateMessageContent
templateWhatsApp template message content. Use the `name` and `language` of an `APPROVED` template from `GET /inboxes/{id}/whatsapp/templates`.
- Name
type- Type
- const
- required
- Name
template- Type
- WhatsAppTemplateContent
- required
{
"type": "template",
"template": {
"name": "order_ready",
"language": "en",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Anna"
},
{
"type": "text",
"text": "4827"
}
]
}
]
}
}RichMessageContent
richMessageStructured rich message content for channels that support cards or actions.
- Name
type- Type
- const
- required
- Name
richMessage- Type
- RichMessage
- required
{
"type": "richMessage",
"richMessage": {
"cards": [
{
"body": {
"text": "Choose the next step."
},
"actions": [
{
"type": "reply",
"label": "Talk to support",
"value": "support"
}
]
}
]
}
}WhatsAppMessageContent
whatsappWhatsApp-specific message content.
- Name
type- Type
- const
- required
- Name
whatsapp- Type
- WhatsAppContent
- required
{
"type": "whatsapp",
"whatsapp": {
"requestContactInfo": {
"body": "Please share your WhatsApp phone number."
}
}
}FormResponseMessageContent
formResponseA customer's submitted answers from a channel form.
- Name
type- Type
- const
- required
- Name
formResponse- Type
- FormResponseContent
- required
{
"type": "formResponse",
"formResponse": {
"title": "string",
"answers": {}
}
}LocationMessageContent
locationA location shared by a customer.
- Name
type- Type
- const
- required
- Name
location- Type
- LocationContent
- required
{
"type": "location",
"location": {
"latitude": 0,
"longitude": 0,
"name": "order_ready",
"address": "string"
}
}InteractiveReplyMessageContent
interactiveReplyA customer's selection from an interactive message.
- Name
type- Type
- const
- required
- Name
interactiveReply- Type
- InteractiveReplyContent
- required
{
"type": "interactiveReply",
"interactiveReply": {
"source": "button",
"title": "string",
"payload": "string",
"sourceMessageId": "string"
}
}SystemMessageContent
systemTimeline entry that Flownally writes about the conversation. It is never sent to the customer. Events and their `params`: - `conversation.assigned`: `ownerType` (`user`, `chatbot`), `ownerId`. - `conversation.released`: `chatbotId`, `reason` (`completed`, `cancelled`). - `conversation.escalated`: `chatbotId`, `reason` (`escalated`, `failed`, `handoff`, or `held_externally` when the chatbot gave up the conversation because an external holder holds it), and `teamId` when the handoff moved the conversation to a team. - `conversation.closed`: `reason` (`manual`, `deadline`, or `completed`, written by the chatbot whose run completed). - `conversation.held_externally`: `holderId` when the channel named the party that took the conversation, or the party Flownally passed it to, such as `meta_business_agent`. - `conversation.control_returned`: `holderId` of the previous holder, when it was known, and `reason` `escalated` when that holder handed the conversation back. New events may be added. Ignore events you don't recognize.
- Name
type- Type
- const
- required
- Name
system- Type
- SystemContent
- required
{
"type": "system",
"system": {
"event": "conversation.assigned",
"params": {
"ownerType": "user",
"ownerId": "usr_d7phosq4g7mv2l5b9l40"
}
}
}