Skip to content

List Messages

GET
/contact/{identifier}/message/list
curl --request GET \
--url https://api.aelyst.ai/v1/contact/example/message/list \
--header 'Authorization: Bearer <token>'

List all messages of a specific contact.

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

limit
integer
<= 50 <= 50 characters

Number of messages to return i.e. page size.

cursorId
string

Pointer to the message id from where the next batch of records should start from.

Media typeapplication/json
object
items
Array<object>
object
messageId
required

Unique ID of the message

integer
channelMessageId
string | integer
contactId
required

ID of the contact to which the message was sent.

integer
channelId
required
integer
traffic
required

Defines if the message was received or sent

string
Allowed values: outgoing incoming
message
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
status
Any of:
MessageStatus

The delivery statuses of the message

Array<object>
object
value
required
string
Allowed values: pending sent delivered read failed
timestamp
required

Unix timestamp in seconds

integer
message

Reason of the failure.

string
sender
One of:
SenderUser
object
source
string
userId
string
teamId
string
pagination
object
next
required
string
previous
required
string
Example
{
"items": [
{
"messageId": 1262965213,
"channelMessageId": 123,
"contactId": 123,
"channelId": 123,
"traffic": "outgoing",
"message": {
"type": "text",
"text": "Message text",
"messageTag": "ACCOUNT_UPDATE"
},
"status": [
{
"value": "pending",
"timestamp": 1662965213,
"message": "Failed reason"
}
],
"sender": {
"source": "user",
"userId": 123456789,
"teamId": 123456789
}
}
],
"pagination": {
"next": "https://api.aelyst.ai/contact/{identifier}/message/list?limit=10&cursorId=10",
"previous": "https://api.aelyst.ai/contact/{identifier}/message/list?limit=10&cursorId=-10"
}
}
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": 500,
"message": "Unexpected error occurred"
}