---
source_url: https://www.pubnub.com/docs/sdks/rest-api/get-message-history-1
title: Get message history
---

# Get message history

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

:::warning deprecated
This endpoint has been deprecated and may be removed in future versions of the API.
:::

| Path Parameters |
| --- |
| `sub_key`string—**REQUIRED**Your app's subscribe key from Admin Portal.Example: sub-c-50264475-1902-558x-d213-7p19052012n2 |
| `channel`string—**REQUIRED**The channel ID to perform the operation on.Example: myChannel |

| Query Parameters |
| --- |
| `stringtoken`booleanIf false, 0, or not provided, the returned start and end Timetoken values will be returned as long ints. If 1, or true, the start and end Timetoken values will be returned as strings. |
| `count`integerThe maximum number of messages to return per response. If the count parameter is not provided, the server will default to the maximum value of 100. When the count parameter is provided, you may request between 1 and 100 messages.Example: 100 |
| `reverse`booleanDirection of time traversal. Default is false, which means timeline is traversed newest to oldest. |
| `start`numberTimetoken delimiting the start of time slice (exclusive) to pull messages from.If provided, lets you select a start date, in Timetoken format. If not provided, it will default to current time. Page through results by providing a start OR end time token. Retrieve a slice of the time line by providing both a start AND end time token. start is exclusive, that is, the first item returned will be the one immediately after the start Timetoken value.Example: 123323123123123 |
| `end`numberTimetoken delimiting the end of time slice (inclusive) to pull messages from.If provided, lets you select an end date, in Timetoken format. Page through results by providing a start OR end time token. Retrieve a slice of the time line by providing both a start AND end time token. End is inclusive, that is, if a message is associated exactly with the end Timetoken, it will be included in the result.Example: 123323123123123 |
| `include_token`booleanpass true to recieve a timetoken with each history message. Defaults to false |
| `auth`stringString which is either the auth key (Access Manager legacy) or a valid token (Access Manager) used to authorize the operation if access control is enabled.Example: authKey / p0thisAkFl043rhDdHRsCkNyZXisRGNoYW6hanNlY3JldAFDZ3Jwsample3KgQ3NwY6BDcGF0pERjaGFuoENnctokenVzcqBDc3BjoERtZXRhoENzaWdYIGOAeTyWGJI |
| `uuid`stringA UTF-8 encoded string of up to 92 characters used to identify the client.Example: myUniqueUserId |
| `include_meta`booleanSet to true to include metadata with returned messages. This metadata is set using the meta parameter with the publish operation. Default is false.Example: true |
| `signature`stringSignature used to verify that the request was signed with the secret key associated with the subscriber key.If Access Manager is enabled, either a valid authorization token or a signature are required.See Access Manager documentation for details on how to compute the signature. |
| `timestamp`integerUnix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 second offset from NTP.Required if signature parameter is supplied. |

| Responses |
| --- |
| `200`Success.Schema — OPTIONAL undefined[] | Schema—**OPTIONAL** | undefined[] |
| Schema—**OPTIONAL** |
| undefined[] |
| `400`Invalid request.Schema — OPTIONAL undefined[] | Schema—**OPTIONAL** | undefined[] |
| Schema—**OPTIONAL** |
| undefined[] |
| `403`Do not have permissionSchema — OPTIONAL undefined[] | Schema—**OPTIONAL** | undefined[] |
| Schema—**OPTIONAL** |
| undefined[] |

`sub_key`*

Type: string

Your app's subscribe key from [Admin Portal](https://admin.pubnub.com).

`channel`*

Type: string

The channel ID to perform the operation on.

`stringtoken`

Type: boolean

If false, 0, or not provided, the returned start and end Timetoken values will be returned as long ints. If 1, or true, the start and end Timetoken values will be returned as strings.

`count`

Type: integer

The maximum number of messages to return per response. If the count parameter is not provided, the server will default to the maximum value of 100. When the count parameter is provided, you may request between 1 and 100 messages.

`reverse`

Type: boolean

Direction of time traversal. Default is false, which means timeline is traversed newest to oldest.

`start`

Type: number

Timetoken delimiting the start of time slice (exclusive) to pull messages from. If provided, lets you select a *start* date, in Timetoken format. If not provided, it will default to current time. Page through results by providing a start OR end time token. Retrieve a slice of the time line by providing both a start AND end time token. start is *exclusive*, that is, the first item returned will be the one immediately after the start Timetoken value.

`end`

Type: number

Timetoken delimiting the end of time slice (inclusive) to pull messages from. If provided, lets you select an *end* date, in Timetoken format. Page through results by providing a start OR end time token. Retrieve a slice of the time line by providing both a start AND end time token. End is *inclusive*, that is, if a message is associated exactly with the end Timetoken, it will be included in the result.

`include_token`

Type: boolean

pass true to recieve a timetoken with each history message. Defaults to false

`auth`

Type: string

String which is either the auth key (Access Manager legacy) or a valid token ([Access Manager](https://www.pubnub.com/docs/security/access-control/overview.md)) used to authorize the operation if access control is enabled.

`uuid`

Type: string

A UTF-8 encoded string of up to 92 characters used to [identify the client](https://www.pubnub.com/docs/architecture/core-concepts.md).

`include_meta`

Type: boolean

Set to true to include metadata with returned messages. This metadata is set using the meta parameter with the publish operation. Default is false.

`signature`

Type: string

Signature used to verify that the request was signed with the secret key associated with the subscriber key. If Access Manager is enabled, either a valid authorization token or a signature are required. See Access Manager documentation for details on how to compute the signature.

`timestamp`

Type: integer

Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 second offset from NTP. Required if `signature` parameter is supplied.

Example Response

```
[
  [
    "Pub1",
    "Pub2",
    "Pub3"
  ],
  13406746729185766,
  13406746780720712
]
```

Example Response

```
[
  [
    "Pub1",
    "Pub2",
    "Pub3"
  ],
  13406746729185766,
  13406746780720712
]
```

Example Response

```
[
  [
    "Pub1",
    "Pub2",
    "Pub3"
  ],
  13406746729185766,
  13406746780720712
]
```
