# Search Sent and Received Messages

Retrieve a list of messages within a specific date range. Supports filtering by from/to dates.

### <mark style="color:green;">`GET`</mark> `/messages/history`&#x20;

#### Required Permission

```
read:SingleSMS
```

Your API key must have this permission enabled in order to use this endpoint.

#### Example Request

```bash
curl --location 'https://<hostname>/messages/history?fromDate=2025-10-01&toDate=2025-10-11' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

Replace `YOUR_API_KEY` with your API key.

{% hint style="info" %}
All endpoints shown in this documentation use a **sample base URL**. The production API endpoint is provided by our team upon request.
{% endhint %}

#### Query Parameters

| Field    | Type                | Required | Description                                 |
| -------- | ------------------- | -------- | ------------------------------------------- |
| fromDate | string (YYYY-MM-DD) | Yes      | Start date of the search range.             |
| toDate   | string (YYYY-MM-DD) | Yes      | End date of the search range.               |
| offset   | number              | No       | Number of records to skip (for pagination). |
| limit    | number              | No       | Maximum number of records to return.        |

#### Response (HTTP 200)

```json
{
  "success": true,
  "records": [
    {
      "id": "e5815fe-e86-4fd7-9cad-4944f023",
      "recipient": "4479000000001",
      "originator": "test",
      "text": "Hello World",
      "status": "Delivered",
      "sent_on": "2025-10-01T12:34:56.000Z"
    }
  ],
  "offset": 0,
  "limit": 10,
  "total": 42
}
```

{% hint style="success" %}
This endpoint supports sorting and pagination. See [Search & Pagination Parameters](https://wiki.mobivatebulksms.com/search-and-pagination-parameters/introduction-to-searching-and-pagination) for details.
{% endhint %}
