# 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](/search-and-pagination-parameters/introduction-to-searching-and-pagination.md) for details.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.mobivatebulksms.com/message-history/search-sent-and-received-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
