Skip to content

Send a message

POST
/contact/{identifier}/message
curl --request POST \
--url https://api.aelyst.ai/v1/contact/example/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "channelId": 0, "message": { "type": "text", "text": "There has been an update in your account..." } }'

Sends a message to a specific contact through specific channel. If channelId is not specified, the message will be sent through last interacted channel. Note that for custom payload message type only supported for Telegram, Facebook, Viber and Line, channelId must be specified in order to send a custom payload message. Example for identifier - id:123 | email:abdc@gmail.com | phone:+60121233112

identifier
required
string

Identifier of the contact that can either be a phone number, email or contact ID. Examples: id:123 , email:abdc@gmail.com , phone:+60121233112

Media typeapplication/json
object
channelId

ID of the channel to send the message on.

null to send message on the last interacted channel (if any).

integer
nullable
message
required
One of:
Text
object
type
required
string
Allowed values: text
text
required
string
messageTag

Required if the channel is facebook or instagram and the message is being sent outsde the standard 24 hour messaging window. Reference

string
Allowed values: ACCOUNT_UPDATE POST_PURCHASE_UPDATE CONFIRMED_EVENT_UPDATE
Examples
{
"channelId": 0,
"message": {
"type": "text",
"text": "There has been an update in your account..."
}
}
Media typeapplication/json
object
messageId
required

The id of the message so that you can track it later

integer format: 1262965213
Examplegenerated
{
"messageId": 1
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 400,
"message": "Validation error."
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 401,
"message": "UN_AUTHORIZED"
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 429,
"message": "Too Many Requests"
}
Retry-After
number
Example
1

Number of seconds until you can retry the request

X-RateLimit-Limit
number
Example
10

Number of request allowed for this end point

X-RateLimit-Remaining
number
Example
5

Number of request remaining for this end point

Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 449,
"message": "Your request cannot be processed at the moment as it is currently in queue. Please try again in a few minutes."
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 500,
"message": "Unexpected error occurred"
}