---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/build/features/messages/forward
title: Forward messages
updated_at: 2026-05-29T11:07:53.139Z
---

> 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).
:::

##### Under the hood

`forward()` and `forwardMessage()` call PubNub Pub/Sub API and the JavaScript SDK [publish()](https://www.pubnub.com/docs/sdks/javascript/api-reference/publish-and-subscribe#publish) method.

### Method signature

These methods take the following parameters:

* forward() 1message.forward(2 channelId: string3): Promise<PublishResponse>
* forwardMessage() 1channel.forwardMessage(2 message: Message3): Promise<PublishResponse>

#### 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/chat-sdk/learn/chat-entities/message) that you want to forward to the selected channel. |

#### Output

| Type | Description |
| --- | --- |
| `Promise<PublishResponse>` | Result of the PubNub Publish call. |

#### Errors

Whenever the channel ID or the message is required as a parameter, and you try to forward the message without providing it, you will receive the `Channel ID is required` or the `Message is required` error.

### Sample code

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

* forward() 1// reference the channel with the message you want to forward2const channel = await chat.getChannel("support")3 4// reference the "message" object you want to forward5const { messages } = await channel.getHistory({count: 1})6const message = messages[0]7 8// use the "forward()" method to send the message to the "incident-management" channel9await message.forward("incident-management")
* forwardMessage() 1// reference the "support" channel with the message you want to forward2const originalChannel = await chat.getChannel("support")3 4// reference the last message on that "support" channel5const { messages: originalMessages } = await originalChannel.getHistory({count: 1})6const lastMessage = originalMessages[0]7 8// reference the "incident-management" channel to which you want to forward the message9const newChannel = await chat.getChannel("incident-management")10 11// use the "forwardMessage()" method to send the message to the "incident-management" channel12await newChannel.forwardMessage(lastMessage)