Skip to main content

Requesting message history

Last updated: 23 July 2026

The /api/messages/history method is used to request the recipient’s message history.

info

The message history is returned based on the recipient, not on a specific identifier — sending a request will return the entire message history.

Calling the method​

To call the /api/messages/history method, send a POST request to the URL:

https://app.edna.io/api/messages/history

If the request is successful, the method returns a response with a code of 200 and a JSON object with text and information about the message. If the request fails, the method returns an error code.

Request body format​

{
"subscriberFilter": {
"address": "35000000000",
"type": "PHONE"
},
"offset": 0,
"limit": 0,
"channelTypes": [
"SMS"
],
"messageId": 567890,
"direction": "OUT",
"dateFrom": "2024-07-01T00:00:00Z",
"dateTo": "2024-07-22T00:00:00Z",
"sort": [
{
"property": "messageId",
"direction": "DESC"
}
],
"trafficTypes": [
"AD"
],
"subjectId": 0
}

Request example​

POST https://app.edna.io/api/messages/history
x-api-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Content-Type: application/json

Request body with the subscriberFilter parameter​

{
"subscriberFilter": {
"address": "35000000000",
"type": "PHONE"
},
"offset": 0,
"limit": 1000,
"channelTypes": [
"SMS"
],
"messageId": 567891,
"direction": "OUT",
"dateFrom": "2024-07-01T00:00:00Z",
"dateTo": "2024-07-22T00:00:00Z",
"sort": [
{
"property": "messageId",
"direction": "DESC"
}
],
"trafficTypes": [
"AD"
],
"subjectId": 50192
}

Request body without the subscriberFilter parameter​

{
"offset": 0,
"limit": 1000,
"channelTypes": [
"SMS"
],
"direction": "OUT",
"dateFrom": "2024-07-01T00:00:00Z",
"dateTo": "2024-07-22T00:00:00Z",
"sort": [
{
"property": "messageId",
"direction": "DESC"
}
],
"trafficTypes": [
"AD"
],
"subjectId": 50192
}

Request parameters​

ParameterData typeCharacterDescription
subscriberFilterobjectRequiredRecipient filter.
subscriberFilter.addressstringRequiredRecipient's address. For example, a phone number.
subscriberFilter.typestringRequiredRecipient address type:
- PHONE
- EMAIL
- UTM
- COOKIE_ID
- INSTAGRAM_ID
- TELEGRAM_ID
- GOOGLE_ID
- APPLE_ID
- YANDEX_ID
- FACEBOOK_ID
- EXT_USER_ID
- WHATSAPP_BSUID.
- WHATSAPP_PARENT_BSUID.
offsetnumberOptionalThe number of messages to skip after sorting. The default value is 0.
limitnumberOptionalThe number of messages in the response. The default value is 0, and the maximum value is 1000.
channelTypesarray of stringsOptionalChannel type:
- WHATSAPP — WhatsApp channel;
- VIBER — Viber channel.
You can pass multiple values.
directionstringRequired if the messageId parameter is usedThe direction of the message.
- IN — from the recipient;
- OUT — to the recipient.
DateFromstringOptionalThe date in the ISO 8601 format (for example, 2024-07-01T00:00:00Z) from which the messages are requested. By default, messages for the last 30 days are requested.
To receive all messages from a certain date in the past to the present, specify the required date only in the DateFrom parameter and leave the DateTo parameter empty.
If necessary, specify the number of messages you want to receive in the limit parameter. ISO 8601
dateTostringOptionalThe date in the ISO 8601 format (for example, 2024-07-01T00:00:00Z) from which the messages are requested. By default, messages for the last 30 days are requested.
The maximum range of values between the DateFrom and DateTo parameters is 366 days.
To get all messages for the last 30 days, specify the date in the last 30 days in the DateTo parameter and leave the DateFrom parameter empty. If you specify a date later than 30 days ago in the DateTo parameter and leave the DateFrom parameter empty, the response will contain an empty list.
If necessary, specify the number of messages you want to receive in the limit parameter. ISO 8601
sortobjectOptionalSorting options.
sort.propertystringOptionalValue of the parameter for sorting. You can use the value of any parameter from the sample response.
sort.directionstringOptionalSorting direction:
- ASC — ascending sort;
- DESC — descending sort (default)
Used only with the sort.property parameter.
trafficTypesarray of stringsOptionalThe type of traffic with the value of the direction:OUT parameter. For WhatsApp and Viber channels. Possible values:
- AD — Viber advertising messages;
- SERVICE — Viber service messages;
- HSM — WhatsApp template messages;
- CHAT — WhatsApp chat messages in free form.
SubjectIDnumberOptionalSignature identifier.
messageIdnumberOptionalInternal message identifier.

Response format​

In response to the request, a JSON object is returned with messages sent to or received from the user according to the specified conditions.

Response example​

{
"content": [
{
"messageId": 8270556,
"tenantId": 3193,
"channelType": "SMS",
"direction": "OUT",
"address": "35000000000",
"content": "{\"text\": \"Hello. Glad to see\", \"type\": \"TEXT\"}",
"deliveryStatus": "DELIVERED",
"deliveryStatusAt": "2024-07-23T08:08:20.000+0000",
"sentOrReceivedAt": "2024-07-23T08:08:20.201+0000",
"subjectId": 50192,
"subjectName": "subject_sms",
"cascadeId": 32522,
"cascadeName": "cascade_sms",
"cascadeStageUuid": "b75c5b32-d185-4784-aac0-ec3adc468a71",
"broadcastId": 318463,
"broadcastName": "cxzxzcxzcxz",
"trafficType": "AD",
"segments": 1,
"subscriberId": 11354769
},
{
"messageId": 8270515,
"tenantId": 3193,
"channelType": "SMS",
"direction": "OUT",
"address": "35000000000",
"content": "{\"text\": \"Hello. Glad to see\", \"type\": \"TEXT\"}",
"deliveryStatus": "DELIVERED",
"deliveryStatusAt": "2024-07-23T08:02:11.000+0000",
"sentOrReceivedAt": "2024-07-23T08:02:11.223+0000",
"subjectId": 50192,
"subjectName": "subject_sms",
"cascadeId": 32522,
"cascadeName": "cascade_sms",
"matcherId": 6199,
"matcherName": "serv_1",
"cascadeStageUuid": "b75c5b32-d185-4784-aac0-ec3adc468a71",
"broadcastId": 318462,
"broadcastName": "cxvzxc",
"trafficType": "SERVICE",
"segments": 1,
"subscriberId": 11354769
}
],
"hasNext": false
}

Response parameters​

ParameterData typeDescription
contentarray of objectsArray of transmitted messages.
content.messageIdnumberInternal ID of the message.
content.TenantIdnumberID of the user's personal account.
content.channelTypestringChannel type.
content.directionstringMessage direction.
- IN — from the recipient;
- OUT — to the recipient.
By default, all messages are returned.
content.addressstringSender's address for incoming and recipient's address for outgoing messages.
content.contentstringText of the message.
When using WhatsApp Flows, information about Flow will be sent in this parameter:
- for outgoing messages — information about Flow;
- for incoming messages — information about the recipient's responses in Flow.
content.deliveryStatusstringMessage delivery status.
- ACCEPTED — the message was received by edna Pulse;
- INVALID — the outgoing message did not pass the validation stages on the edna Pulse side;
- ENQUEUED — the outgoing message was successfully sent on the edna Pulse side;
- SENT — outgoing message successfully sent to recipient;
- UNDELIVERED — outgoing message not delivered to recipient or unsuccessfully sent;
- DELIVERED — outgoing message delivered to recipient;
- READ — the outgoing message has been read by the recipient.
content.deliveryStatusAtstringDate and time of delivery status in ISO 8601 format (for example, 2024-01-11T01:01:11.000+0000). ISO 8601
content.deliveryStatusMessagestringDelivery status message.
content.sentOrReceivedAtstringDate and time of sending outgoing messages and delivering incoming messages in ISO 8601 format (for example, 2024-01-11T02:02:22.223+0000). ISO 8601
content.subjectIdnumberThe signature ID.
content.subjectNamestringSignature name.
content.cascadeIdnumberCascade ID.
content.cascadeNamestringCascade name.
content.cascadeStageUuidstringCascade step number.
content.broadcastIdnumberThe broadcast list ID.
content.broadcastNamestringMailing list name.
content.trafficTypearray of stringsThe type of traffic with the value of the direction:OUT parameter. For WhatsApp and Viber channels. Possible values:
- AD — Viber advertising messages;
- SERVICE — Viber service messages;
- HSM — WhatsApp template messages;
- CHAT — WhatsApp chat messages in free form.
content.segmentsnumberThe number of message segments.
content.subscriberIdnumberThe recipient's ID in edna Pulse.
content.matcherIdnumberID of the template that messages were sent to when the direction:OUT parameter was set.
content.matcherNamestringThe name of the template used to send messages with the value of the direction:OUT parameter.
content.commentstringComment on the message. The comment parameter can be passed when sending messages and used to uniquely identify messages or newsletters.
hasNextbooleanThe flag for the presence of the next page.
content.replyInMessageIdnumberThe internal identifier of the user's quoted message. The user quotes his message sent to the company.
content.replyOutMessageIdnumberThe internal identifier of the quoted message of the company. The user quotes a message received from the company.
ExternalRequestIdnumberThe external identifier of the company's quoted message, which it specifies when sending an outgoing message via the API. In the event that the user quoted a message received from the company.

Errors​

Possible errors after calling the /api/messages/history method

CodeErrorDescription
401Api key not foundInvalid API key specified.
400not-valid-requestAn empty value of the address parameter is specified.
400limit-not-validA value greater than 1000 is specified in the limit parameter.
400date-range-not-validThe range of values between the DateFrom and DateTo parameters exceeds 366 days.
400message-matcher-subject-not-foundInvalid identifier is specified in the value of the SubjectID parameter.