> ## Documentation Index
> Fetch the complete documentation index at: https://developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get historical messages

The Engage API has three endpoints to fetch the latest SMS, email and postal messages saved for a specific contact.

```http Emails theme={null}
GET /api/v3/contacts/{contactId}/emailmessages
```

```http SMS theme={null}
GET /api/v3/contacts/{contactId}/smsmessages
```

```http Postal theme={null}
GET /api/v3/contacts/{contactId}/postalmessages
```

By default, the newest 100 messages will be fetched.

By adding the parameter `count` to your query, you can request any number up to the maximum of 500.

An actual request to this endpoint might look like this:

```http theme={null}
GET /api/v3/contacts/111d3329-7eef-45c0-37f9-ae9300a0dacei/emailmessages?count=350
```

<Tip>
  This endpoint is primarily for first-line support platforms, allowing customer service employees to quickly troubleshoot a contact's sent messages without having to log into Engage.
</Tip>

### Response codes

You'll get one of these two response codes:

* '200' : OK
* '404' : ContactNotFound

### Example response and fields

```json theme={null}
{
    "count": 2,
    "items": [
        {
            "messageId": "c524e468-pee9-43d5-8f33-af3801140666",
            "name": "test",
            "sendDateTime": "2022-10-24T16:47:45+00:00",
            "type": "SmsMessage",
            "source": "Manual",
            "isTransactional": false,
            "status": "Delivered",
            "messageLink": "https://myurl.customer.staging.eclub.se/Open/SmsOnline/Show/aOQaxknO1UOPRq84ARQDBB",
            "messageText": "Hello and welcome to ExampleShop. Please add your consent and email here [[registrationUrl:123456c7-79bb-41d4-8db8-af2a00894f33]]"
        },
        {
            "messageId": "d4afac12-2222-4d17-b009-af11009b9a1a",
            "name": "Testauto",
            "sendDateTime": "2022-09-15T07:26:32+00:00",
            "type": "EmailMessage",
            "source": "Automation",
            "isTransactional": false,
            "status": "Delivered",
            "messageLink": "https://myurl.customer.staging.eclub.se/open/email/online/Eqyv1ICQF02wCa8FUKlejA/n0pgJu8BBkySna8RAHnP8w/8coDxC_inkCP_K8RAJuajA",
            "messageText": "This is a test email."
        }
    ]
}
```

<ResponseField name="messageId" type="guid">
  Unique message ID.
</ResponseField>

<ResponseField name="name" type="string">
  Name of the message in Voyado.
</ResponseField>

<ResponseField name="sendDateTime" type="datetime">
  Date and time when the message was sent, including offset.
</ResponseField>

<ResponseField name="type" type="string">
  Type of message. Possible values include `EmailMessage`, `SmsMessage`, and `PostalMessage`.
</ResponseField>

<ResponseField name="source" type="string">
  Where the message was sent from in Voyado Engage. Possible values include `Automation`, `Manual`, and `System`.
</ResponseField>

<ResponseField name="isTransactional" type="boolean">
  Indicates whether the message was sent as a transactional message. Does not take opt-in status into account.
</ResponseField>

<ResponseField name="status" type="string">
  Delivery status of the send-out. Example: `Delivered`
</ResponseField>

<ResponseField name="messageLink" type="string">
  URL to the web version of the email.
</ResponseField>

<ResponseField name="messageText" type="string">
  The text content of an SMS message or the subject line of an email.
</ResponseField>
