---
title: "Load History (Realtime)"
slug: "load-room-stream-realtime"
updated: 2026-05-14T21:49:14Z
published: 2026-05-14T21:49:14Z
---

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

# Load History (Realtime)

![](https://cdn.us.document360.io/27ca1fd4-36d7-4cde-b4eb-97fc1652954c/Images/Documentation/Deprecated.svg)

Load room history. After the initial load, you can [stream room messages](/v1/docs/stream-room-messages).

## Payload Parameters

| Argument | Example | Required | Description |
| --- | --- | --- | --- |
| `roomId` | `64a1f373376181965ab77f54` | Required | The room ID. |
| `timestamp` | null | Required | The newest message timestamp date (or null) to only retrieve messages before this time. |
| `quantity` | 50 | Required | The quantity of results to be returned. |
| `date` | `{ "$date": 1480377601 }` | Required | The date of the last time the client got data for the room. |

## Example call

**Request of the latest 50 messages:**

```json
{
    "msg": "method",
    "method": "loadHistory",
    "id": "42",
    "params": [ "64e37db1fedadc25c854843d", { "$date": 1480377205 }, 50, { "$date": 1480377601 } ]
}
```

**Request of the latest 50 messages, using pagination:**

```json
{
    "msg": "method",
    "method": "loadHistory",
    "id": "42",
    "params": [ "64e37db1fedadc25c854843d", { "$date": 1480377205 }, 50, { "$date": 1480377601 } ]
}
```

## **Example response**

The response consists of the `message` and `unreadNotLoaded`. The `unreadNotLoaded` counts the number of unread messages not loaded by the call.

```json
{
    "msg": "result",
    "id": "42",
    "result": {
        "messages": [
            {
                "_id": "PbqaTCegrjT2aMY5B",
                "rid": "64e37db1fedadc25c854843d",
                "msg": "hi",
                "ts": {
                    "$date": 1693045291715
                },
                "u": {
                    "_id": "4SebuZCHhQKvTt23o",
                    "username": "funke.olasupo",
                    "name": "Funke Olasupo"
                },
                "_updatedAt": {
                    "$date": 1693045291977
                },
                "urls": [],
                "mentions": [],
                "channels": [],
                "md": [
                    {
                        "type": "PARAGRAPH",
                        "value": [
                            {
                                "type": "PLAIN_TEXT",
                                "value": "hi"
                            }
                        ]
                    }
                ]
            },
            {
                "_id": "Sj2genTaum82B4xRh",
                "rid": "64e37db1fedadc25c854843d",
                "msg": "hi",
                "ts": {
                    "$date": 1692630610658
                },
                "u": {
                    "_id": "4SebuZCHhQKvTt23o",
                    "username": "funke.olasupo",
                    "name": "Funke Olasupo"
                },
                "_updatedAt": {
                    "$date": 1692630610822
                },
                "urls": [],
                "mentions": [],
                "channels": [],
                "md": [
                    {
                        "type": "PARAGRAPH",
                        "value": [
                            {
                                "type": "PLAIN_TEXT",
                                "value": "hi"
                            }
                        ]
                    }
                ]
            }
        ],
        "unreadNotLoaded": 0
    }
}
```
