Send a new message
POST/conversations/messages
Post the necessary fields for the API to send a new message.
Request
API Version
v3- application/json
- Body
- Example (auto)
Bodyrequired
Type of message being sent
SMSEmailWhatsAppIGFBCustomLive_ChatInternalCommentID of the contact receiving the message
ID of the associated appointment
Array of attachment URLs
Email address to send from
Array of CC email addresses
Array of BCC email addresses
HTML content of the message
Text content of the message. For InternalComment type, use @username<userId>actualUserId</userId> format to mention team members. The mentioned user IDs must also be included in the mentions array.
Subject line for email messages
ID of message being replied to
ID of message template
ID of message thread. For email messages, this is the message ID that contains multiple email messages in the thread
UTC Timestamp (in seconds) at which the message should be scheduled
ID of conversation provider
Email address to send to, if different from contact's primary email. This should be a valid email address associated with the contact.
Mode for email replies
replyreply_allPhone number used as the sender number for outbound messages
Recipient phone number for outbound messages
Message status
deliveredfailedpendingreadArray of user IDs mentioned in the message. Required for InternalComment type. User IDs correspond to team members tagged with @username<userId>id</userId> format in the message text.
Use this field to specify the user who is making the internal comment when type is 'InternalComment'. If not provided, the comment will be attributed to the system or default user.
{
"type": "Email",
"contactId": "abc123def456",
"appointmentId": "appt123",
"attachments": [
"https://storage.com/file1.pdf",
"https://storage.com/file2.jpg"
],
"emailCc": [
],
"emailBcc": [
],
"html": "<p>Hello World</p>",
"message": "Hello, how can I help you today?",
"subject": "Important Update",
"replyMessageId": "msg123",
"templateId": "template123",
"threadId": "thread123",
"scheduledTimestamp": 1669287863,
"conversationProviderId": "provider123",
"emailReplyMode": "reply_all",
"fromNumber": "+1499499299",
"toNumber": "+1439499299",
"status": "delivered",
"mentions": [
"userId123",
"userId456"
],
"userId": "user123"
}
Created the message
- application/json
- Schema
- Example (auto)
Schema
Conversation ID.
This contains the email message id (only for Email type). Use this ID to send inbound replies to CRM to create a threaded email.
This is the main Message ID
When sending via the GMB channel, we will be returning list of messageIds instead of single messageId.
Additional response message when sending a workflow message
{
"conversationId": "ABC12h2F6uBrIkfXYazb",
"emailMessageId": "rnGyqh2F6uBrIkfhFo9A",
"messageId": "t22c6DQcTDf3MjRhwf77",
"messageIds": [
"string"
],
"msg": "Message queued successfully."
}