Send a new message

POSThttps://services.leadconnectorhq.com/conversations/conversations/messages
Post the necessary fields for the API to send a new message.
Request

Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123
Body
type
string
required

Type of message being sent

Allowed values:
SMSEmailWhatsAppIGFBCustomLive_Chat
Example:
Email
contactId
string
required

ID of the contact receiving the message

Example:
abc123def456
appointmentId
string

ID of the associated appointment

Example:
appt123
attachments
array[string]

Array of attachment URLs

Example:
["https://storage.com/file1.pdf","https://storage.com/file2.jpg"]
emailFrom
string

Email address to send from

Example:
sender@company.com
emailCc
array[string]

Array of CC email addresses

Example:
["cc1@company.com","cc2@company.com"]
emailBcc
array[string]

Array of BCC email addresses

Example:
["bcc1@company.com","bcc2@company.com"]
html
string

HTML content of the message

Example:
<p>Hello World</p>
message
string

Text content of the message

Example:
Hello, how can I help you today?
subject
string

Subject line for email messages

Example:
Important Update
replyMessageId
string

ID of message being replied to

Example:
msg123
templateId
string

ID of message template

Example:
template123
threadId
string

ID of message thread. For email messages, this is the message ID that contains multiple email messages in the thread

Example:
thread123
scheduledTimestamp
number

UTC Timestamp (in seconds) at which the message should be scheduled

Example:
1669287863
conversationProviderId
string

ID of conversation provider

Example:
provider123
emailTo
string

Email address to send to, if different from contact's primary email. This should be a valid email address associated with the contact.

Example:
recipient@company.com
emailReplyMode
string

Mode for email replies

Allowed values:
replyreply_all
Example:
reply_all
fromNumber
string

Phone number used as the sender number for outbound messages

Example:
+1499499299
toNumber
string

Recipient phone number for outbound messages

Example:
+1439499299
Headers
Authorization
string
required

Access Token

Example:
Bearer 9c48df2694a849b6089f9d0d3513efe
Version
string
required

API Version

Allowed value:
2021-07-28

Responses

Successful response

conversationId
string
required

Conversation ID.

Example:
ABC12h2F6uBrIkfXYazb
emailMessageId
string

This contains the email message id (only for Email type). Use this ID to send inbound replies to GHL to create a threaded email.

Example:
rnGyqh2F6uBrIkfhFo9A
messageId
string
required

This is the main Message ID

Example:
t22c6DQcTDf3MjRhwf77
messageIds
array[string]

When sending via the GMB channel, we will be returning list of messageIds instead of single messageId.

msg
string

Additional response message when sending a workflow message

Example:
Message queued successfully.

Unprocessable Entity

statusCode
number
Example:
422
message
array[string]
Example:
["Unprocessable Entity"]
error
string
Example:
Unprocessable Entity

Unauthorized

statusCode
number
Example:
401
message
string
Example:
Invalid token: access token is invalid
error
string
Example:
Unauthorized

Bad Request

statusCode
number
Example:
400
message
string
Example:
Bad Request