---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/forward
title: Forward messages
updated_at: 2026-06-15T10:43:21.561Z
---

> 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


# Forward messages

Forward messages between channels to share information or facilitate collaboration.

Use `forward()` on a message object or `forwardMessage()` on a channel object. Both produce the same result with different input parameters.

:::note Additional info in the forwarded message
Forwarded messages include `originalPublisher` (original sender's user ID) and `originalChannelId` (source channel ID).
:::

### Method signature

These methods take the following parameters:

* forward() 1message.forward(channelId: String): PNFuture<PNPublishResult>
* forwardMessage() 1channel.forwardMessage(message: Message): PNFuture<PNPublishResult>

#### Input

| Parameter | Required in forward() | Required in forwardMessage() | Description |
| --- | --- | --- | --- |
| channelId | String | Optional |  | Yes | No | Unique identifier of the channel to which you want to forward the message. You can forward a message to the same channel on which it was published or to any other. |
| message | Message | Optional |  | No | Yes | [Message object](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/message) that you want to forward to the selected channel. |

#### Output

| Type | Description |
| --- | --- |
| `PNFuture<PNPublishResult>` | `PNFuture` containing the `PNPublishResult` that contains `timetoken` of the forwarded message. |

### Sample code

Forward the latest message from the `support` channel to the `incident-management` channel.

* forward() 1val supportChannel: Channel2// ...3 4supportChannel.getHistory(count = 1).async { historyResult ->5 historyResult.onSuccess { history ->6 // handle success7 val latestMessage = history.messages.firstOrNull()8 9 if (latestMessage != null) {10 latestMessage.forward("incident-management").async { forwardResult ->11 forwardResult.onSuccess {12 // handle success13 }.onFailure {14 // handle failure15 }16 }17 } else {18 // handle failure (no messages found)19 }20 }.onFailure {21 // handle failure22 }23}
* forwardMessage() 1val supportChannel: Channel2// ...3 4supportChannel.getHistory(count = 1).async { historyResult ->5 historyResult.onSuccess { history ->6 // handle success7 val latestMessage = history.messages.firstOrNull()8 if (latestMessage != null) {9 chat.getChannel("incident-management").async { incidentResult ->10 incidentResult.onSuccess { incidentChannel ->11 // handle success12 incidentChannel?.forwardMessage(latestMessage)?.async { forwardResult ->13 forwardResult.onSuccess {14 // handle success15 }.onFailure {16 // handle failure17 }18 }19 }.onFailure {20 // handle failure21 }22 }23 }24 }.onFailure {25 // handle failure26 }27}