Create message
Sends a text (or email) to a contact, creating the contact if the phone number is new. Profile fields you include update the contact.
POST
/v1/messagesRequest body
requiredapplication/jsonbodystringrequiredThe message text. Supports merge tags such as `{firstName}`.
customerobjectrequiredThe recipient. `phoneNumber` is required (`phone_number` and `phone` are accepted aliases). Optional `firstName`, `lastName`, and `email` update the contact.
Show propertiesHide properties
phoneNumberstringfirstNamestringlastNamestringemailstringprotocolstringDefaults to `sms`.
Allowed:
smsemailsubjectstringEmail subject, when `protocol` is `email`.
max length 200
scheduleDatestring<date-time>Send later instead of immediately.
threadobjectShow propertiesHide properties
statusstringStatus to set on the contact's thread after sending.
Allowed:
readunreadarchivedprospectResponses
200Successful response
messageMessageShow propertiesHide properties
idstringorgstringgymstringthreadstringcustomerstringuserstringThe team member who sent the message, for messages sent from the inbox.
flowstringThe flow that sent the message, if any.
listMessagestringThe blast that sent the message, if any.
bodystringsubjectstringEmail subject, for email messages.
directionstringAllowed:
incomingoutgoingstatusstringAllowed:
queuedscheduledsendingsentfailedprotocolstring`http` is used for form submissions.
Allowed:
smsemailhttpvoipsegmentsintegerBillable SMS segments.
mediaobject[]Show propertiesHide properties
Array of
objectcontentTypestringurlstringlinksobject[]Tracked short links in the message body.
Show propertiesHide properties
Array of
objectpathstringurlstringscheduleDatestring<date-time>createdAtstring<date-time>updatedAtstring<date-time>threadThreadShow propertiesHide properties
idstringorgstringgymstringcustomerstringThe contact this conversation is with.
userstringThe team member the thread is assigned to, if any.
statusstringAllowed:
readunreadarchivedprospecttagsstring[]lastMessageobjectA summary of the most recent message.
Show propertiesHide properties
bodystringdatestring<date-time>directionstringAllowed:
incomingoutgoingprotocolstringAllowed:
smsemailhttpvoipmediaCountintegercreatedAtstring<date-time>updatedAtstring<date-time>204Customer opted out
Request
curl -X POST "https://api.sendhelios.com/v1/messages" \
-H "Content-Type: application/json" \
-d '{
"body": "string",
"customer": {
"phoneNumber": "string",
"firstName": "string",
"lastName": "string",
"email": "string"
},
"protocol": "sms",
"subject": "string",
"scheduleDate": "2024-01-01T00:00:00Z",
"thread": {
"status": "read"
}
}'const response = await fetch("https://api.sendhelios.com/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"body": "string",
"customer": {
"phoneNumber": "string",
"firstName": "string",
"lastName": "string",
"email": "string"
},
"protocol": "sms",
"subject": "string",
"scheduleDate": "2024-01-01T00:00:00Z",
"thread": {
"status": "read"
}
})
});import requests
response = requests.post(
"https://api.sendhelios.com/v1/messages",
headers={
"Content-Type": "application/json"
},
json={
"body": "string",
"customer": {
"phoneNumber": "string",
"firstName": "string",
"lastName": "string",
"email": "string"
},
"protocol": "sms",
"subject": "string",
"scheduleDate": "2024-01-01T00:00:00Z",
"thread": {
"status": "read"
}
},
)Response
{
"message": {
"id": "string",
"org": "string",
"gym": "string",
"thread": "string",
"customer": "string",
"user": "string",
"flow": "string",
"listMessage": "string",
"body": "string",
"subject": "string",
"direction": "incoming",
"status": "queued",
"protocol": "sms",
"segments": 0,
"media": [
{
"contentType": "string",
"url": "string"
}
],
"links": [
{
"path": "string",
"url": "string"
}
],
"scheduleDate": "2024-01-01T00:00:00Z",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
"thread": {
"id": "string",
"org": "string",
"gym": "string",
"customer": "string",
"user": "string",
"status": "read",
"tags": [
"string"
],
"lastMessage": {
"body": "string",
"date": "2024-01-01T00:00:00Z",
"direction": "incoming",
"protocol": "sms",
"mediaCount": 0
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
}Customer opted out