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

# Forward message

> Forwards the message to another recipient

## Overview

Forwards the message to another recipient.

> [!NOTE]
>
> The response carries the new message's `messageId`, the same one that arrives in the webhook.


## OpenAPI

````yaml en/message-actions/openapi.json POST /v1/channels/{channelId}/messages/{messageId}/forward
openapi: 3.1.0
info:
  title: Omni Z-API - Message actions
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/messages/{messageId}/forward:
    post:
      tags:
        - Ações em mensagem
      summary: Forward message
      description: Forwards the message to another recipient.
      operationId: forwardMessage
      parameters:
        - name: channelId
          in: path
          required: true
          description: Channel id
          schema:
            type: string
            example: 58907809F0964E998D36C87F10EBA60C
        - name: messageId
          in: path
          required: true
          description: >-
            The Omni message id (the same one returned on send and in the
            webhook).
          schema:
            type: string
            example: 01A1EA9883087E9EB1E0D7432E185E2B
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipient
              properties:
                recipient:
                  type: object
                  required:
                    - identifier
                  properties:
                    identifier:
                      type: string
            example:
              recipient:
                identifier: '5544936181389'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  messageId:
                    type: string
              example:
                messageId: 01A1EEE46ACE7CABA47824FD91E490DB
        '400':
          description: recipient.identifier is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: invalid_request
                field: recipient.identifier
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/IpNotAllowed'
        '404':
          description: Channel or message not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                messageNotFound:
                  summary: Message does not exist or belongs to another channel
                  value:
                    code: NOT_FOUND
                    subCode: MESSAGE_NOT_FOUND
                    message: 'Message not found: 01A1EA9883087E9EB1E0D7432E185E2B'
                instanceNotFound:
                  summary: Channel does not exist
                  value:
                    error: instance not found
        '422':
          description: >-
            Action refused. Handle it by `subCode` (or by `error` when there is
            no `subCode`); `message` is for reading and may change.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notSupported:
                  summary: Action not supported by the channel type (e.g. Meta)
                  value:
                    code: BUSINESS_RULE_VIOLATION
                    subCode: FORWARD_NOT_SUPPORTED
                    message: >-
                      Forwarding messages is not supported for META_WHATSAPP
                      channels, because the provider of this channel type cannot
                      forward a message. Only WhatsApp Web (Z_API_WHATSAPP)
                      channels can; on this channel, send the content as a new
                      message instead
                channelDisconnected:
                  summary: Channel disconnected
                  value:
                    code: BUSINESS_RULE_VIOLATION
                    subCode: CHANNEL_DISCONNECTED
                    message: >-
                      Channel is disconnected: the message was not forwarded
                      because the WhatsApp Web channel is not connected right
                      now. Reconnect the channel by reading a new QR code and
                      forward again. See
                      https://developer.omni.z-api.io/en/connect/whatsapp-web
                channelInstanceNotProvisioned:
                  summary: Channel's Z-API instance not provisioned
                  value:
                    code: BUSINESS_RULE_VIOLATION
                    subCode: INSTANCE_NOT_PROVISIONED
                    message: The Z-API instance of this channel is not provisioned
                messageWithoutProviderId:
                  summary: Message has no WhatsApp id yet (e.g. not delivered)
                  value:
                    code: BUSINESS_RULE_VIOLATION
                    subCode: MESSAGE_WITHOUT_PROVIDER_ID
                    message: Message has no provider id
                chatNotSupported:
                  summary: Chat is not a phone, a group or an @lid
                  value:
                    code: BUSINESS_RULE_VIOLATION
                    subCode: CHAT_NOT_SUPPORTED
                    message: >-
                      This action is not supported for the chat of this message.
                      Only messages of individual chats, groups and LID chats
                      can be deleted, forwarded, pinned or answered; this one
                      does not belong to one of these chats. Use a message from
                      an individual chat, a group or a LID chat.
                instanceNotProvisioned:
                  summary: Instance not provisioned
                  value:
                    error: instance is not provisioned
                subscriptionInactive:
                  summary: Subscription inactive
                  value:
                    error: instance subscription is not active
                workspaceBlocked:
                  summary: Workspace blocked
                  value:
                    error: You are blocked, contact support.
                actionUnavailable:
                  summary: >-
                    The service that runs the action does not serve the channel
                    yet
                  value:
                    error: >-
                      Forwarding messages is not available for this channel
                      right now. The service that runs this action does not
                      serve this channel yet. Check GET
                      /v1/channels/{channelId}/messages/capabilities and try
                      again later; if it persists, contact support.
        '502':
          description: Messaging service failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                failed:
                  summary: Messaging service failure
                  value:
                    error: Message forwarding failed
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        field:
          type: string
        code:
          type: string
        subCode:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: Credential refused (Omni API)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Authorization invalid
            message: >-
              Authorization invalid: the Authorization header is missing or
              empty. Send the workspace Secret Key as "Authorization: Bearer
              <secret-key>". See
              https://developer.omni.z-api.io/en/authentication
      headers:
        WWW-Authenticate:
          description: Always `Bearer`.
          schema:
            type: string
          example: Bearer
    IpNotAllowed:
      description: IP not on the allow list (Omni API)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: ip_not_allowed
            message: >-
              203.0.113.10 not allowed: this workspace only accepts API calls
              from the IPs on its allow list. The workspace Owner can add this
              IP under Administration > Security > IP Restriction in the panel
              (changes take up to 10 minutes to apply), or call from an allowed
              IP. See https://developer.omni.z-api.io/en/security/ip-restriction
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.