---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/build/features/messages/details
title: Get message details
updated_at: 2026-06-12T11:22:30.928Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Get message details

Get message details, retrieve content, and check if the message was deleted.

## Get message details

`getMessage()` fetches the [Message object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/message) from Message Persistence based on the message timetoken.

### Method signature

This method takes the following parameters:

```ts
channel.getMessage(
    timetoken: string
): Promise<Message>
```

#### Input

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| timetoken | string | Yes |  | Timetoken of the message you want to retrieve from Message Persistence. |

#### Output

| Type | Description |
| --- | --- |
| `Promise<Message>` | Returned [Message object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/message). |

### Sample code

Get the message with the `16200000000000001` timetoken.

```ts
// reference the "incident-management" channel
const channel = await chat.getChannel("incident-management")
// get the timetoken of the last message on the channel
const messageTimetoken = (await channel.getHistory({count: 1})).messages[0].timetoken
// return the message object
const message = await channel.getMessage("16200000000000001")
```

## Get historical details

With [Message Persistence](https://www.pubnub.com/docs/sdks/javascript/api-reference/storage-and-playback) enabled, PubNub stores all historical message data, metadata, and actions.

Fetch historical message details with [getHistory()](https://www.pubnub.com/docs/chat/chat-sdk/build/features/messages/history). By default, all message actions and metadata are included in the response.

## Get message content

Access the text content of a [Message object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/message) using the `text` property.

### Method signature

This method has the following signature:

```ts
message.text: string
```

#### Properties

| Property | Description |
| --- | --- |
| `text`Type: `string` | Text content of the returned message. |

### Sample code

Get the content of the message with the `16200000000000000` timetoken.

```ts
// reference the "message" that you're interested in
const message = await channel.getMessage("16200000000000000")

// get message content
message.text
```

## Check deletion status

Check if a [Message object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/message) was soft-deleted using the `deleted` property.

### Method signature

This method has the following signature:

```ts
message.deleted: boolean
```

#### Properties

| Property | Description |
| --- | --- |
| `deleted`Type: `boolean` | Info on whether the message has the `deleted` status (because it was previously [soft-deleted](https://www.pubnub.com/docs/chat/chat-sdk/build/features/messages/delete#other-examples)) or not. |

### Sample code

Get the status of the message with the `16200000000000000` timetoken.

```ts
// reference the "message" that you're interested in
const message = await channel.getMessage("16200000000000000")

// get message deletion status
message.deleted
```