---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/thread-message
title: ThreadMessage object
updated_at: 2026-06-23T11:42:06.999Z
---

> 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


# ThreadMessage object

`ThreadMessage` represents a single message in a thread.

## Properties

The `ThreadMessage` interface extends the [Message interface](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/message), so it takes its properties. It also has:

```kotlin
interface ThreadMessage : Message {
    val parentChannelId: String
}
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| parentChannelId | String | Optional |  | Unique identifier of the main channel on which you create a subchannel (thread channel) and thread messages. |

## Methods

The `ThreadMessage` object exposes the following methods.

### Regular methods

* [editText()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/updates#edit-messages)
* [pinToParentChannel()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/threads#pin-thread-message-to-parent-channel)
* [restore()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/restore)
* [toggleReaction()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/reactions#add--delete)
* [unpinFromParentChannel()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/threads#unpin-thread-message-from-parent-channel)

### Event listeners

* [onThreadMessageUpdated()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/updates#get-message-updates)
* [streamUpdatesOn()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/threads#get-thread-message-updates)

All methods available under the [Message object](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/message) also apply to `ThreadMessage`.

## Use case

`ThreadMessage` methods enable:

* Sending messages in [threads](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/threads)
* [Pinning](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/threads#pin-thread-message-to-parent-channel) thread messages to the parent channel