Skip to content

Create Message Request Payload

You can create a message

Any of:

You can create a message

message_typestring

The kind of message being created. Values: in_app, email or whatsapp. inapp is also accepted for in-app messages, and responses always show in-app messages as inapp.

Enum:"in_app""inapp""email""whatsapp"
Example:"in_app"
subjectstring

The title of the email.

Example:"Thanks for everything"
bodystring

The content of the message. HTML and plaintext are supported.

Example:"Hello there"
templatestring

The style of the outgoing message. Possible values plain or personal.

Example:"plain"
fromobject

The sender of the message. If not provided, the default sender will be used.

toRecipient (object) or Array of objects or WhatsApp recipient (object)
One of:

A recipient of a message

ccRecipient (object) or Array of objects
One of:

A recipient of a message

bccRecipient (object) or Array of objects
One of:

A recipient of a message

created_atinteger

The time the message was created. If not provided, the current time will be used.

Example:1590000000
create_conversation_without_contact_replyboolean

Whether a conversation should be opened in the inbox for the message without the contact replying. Defaults to false if not provided.

Default:false
Example:true
componentsArray of objects

The components of the WhatsApp template, with the values for its variables. Required for whatsapp messages.

Example:
[ { "type": "BODY", "parameters": [ … ] } ]
localestring

The locale of the WhatsApp template to send, such as en. If you leave it out, the contact's messenger locale is used, then the workspace locale. A template that isn't available in the locale returns a 400 error.

Example:"en"
brand_idstring

The id of the brand to send the message from. Not used for whatsapp messages. A brand that doesn't exist returns a 400 error.

Example:"1234"
{ "message_type": "in_app", "subject": "Thanks for everything", "body": "Hello there", "template": "plain", "from": { "type": "admin", "id": 394051 }, "to": { "type": "user", "id": "536e564f316c83104c000020" }, "cc": { "type": "user", "id": "536e564f316c83104c000020" }, "bcc": { "type": "user", "id": "536e564f316c83104c000020" }, "created_at": 1590000000, "create_conversation_without_contact_reply": true, "components": [ { … } ], "locale": "en", "brand_id": "1234" }