---
title: "ListMessages"
method: GET
path: "/messages"
tags: ["Messages"]
---

# ListMessages

`GET /messages`

Fetch historical device messages.

Currently supported parameter combinations:

`appId + deviceId`

`topic + deviceId`

`appId`

`deviceId`

`topic`

Not supported:

`appId + topic`

`appId + topic + deviceId`

For more information, see our [nRF Cloud documentation on device messages](https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/MessagesAndAlerts/DeviceMessages.html).

## Query parameters

- `inclusiveStart` string, date-time — HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
- `start` string, date-time — HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
- `exclusiveEnd` string, date-time — HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
- `end` string, date-time — HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
- `appId` string
- `deviceId` string — This is the canonical device id used in the device certificate, and as the MQTT client id.
- `topic` string — A string specifying an MQTT topic.
- `pageLimit` integer — Maximum number of items you want returned in the response (<=100).
- `pageSort` 'asc' | 'desc' — Sorting order for the paginated results => desc (descending; default) or asc (ascending).
- `pageNextToken` string — If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding.

## Response `200`

Ok

- PaginatedResultDeviceMessage
  - `items` DeviceMessage[], required
    - `tenantId` string, required — The UUID of the team owning the device(s)
    - `topic` string, required — A string specifying an MQTT topic.
    - `deviceId` string, required — This is the canonical device id used in the device certificate, and as the MQTT client id.
    - `receivedAt` string, date-time, required
    - `message` AnyKeyedObject, required — Construct a type with a set of properties K of type T
  - `total` integer — Reflects the total results returned by the query, which may be less than the total number of items available. If the response contains a `pageNextToken` value, you can supply the `pageNextToken` in the next request to get more results. The maximum value of `total` is the page limit of the request, or ten pages if no page limit is provided.
  - `pageNextToken` string — Token used to retrieve the next page of items in the list. Present in a response only if the total available results exceeds the specified limit on a page. This token does not change between requests. When supplying as a request parameter, use URL-encoding.

---

[API](https://skmtc.dev/nrfcloud/apis/nrf-cloud-rest-api.md) · [All operations](https://skmtc.dev/nrfcloud/apis/nrf-cloud-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nrfcloud/nrf-cloud-rest-api/revisions/c4e56e458ebf/schema)
