> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wappfy.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Encaminhar Mensagem

> Encaminhar uma mensagem existente para outro contato ou grupo

## Descrição

**⚠️ Este endpoint ainda não está implementado.**

Este endpoint permitirá encaminhar mensagens existentes para outros contatos ou grupos no WhatsApp, mantendo o formato e conteúdo original da mensagem.

## Body

```json theme={null}
{
  "sessionId": "my-session",
  "jid": "5511999999999@s.whatsapp.net",
  "messageId": "3EB0XXXXXX",
  "fromJid": "5511999999999@s.whatsapp.net"
}
```

### Parâmetros do Body

| Propriedade | Tipo     | Obrigatório | Descrição                                                                                                                                |
| ----------- | -------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionId` | `string` | ✅ Sim       | ID da sessão autenticada que encaminhará a mensagem                                                                                      |
| `jid`       | `string` | ✅ Sim       | Identificador do destinatário (JID do WhatsApp). Formato: `5511999999999@s.whatsapp.net` para contatos ou `120363XXXXX@g.us` para grupos |
| `messageId` | `string` | ✅ Sim       | ID da mensagem a ser encaminhada                                                                                                         |
| `fromJid`   | `string` | ✅ Sim       | JID do chat de origem da mensagem                                                                                                        |

<ResponseExample>
  ```json Resposta de Sucesso theme={null}
  {
    "success": true,
    "messageId": "3EB0XXXXXX"
  }
  ```
</ResponseExample>

## Códigos de Status

* `200` - Mensagem encaminhada com sucesso
* `400` - Parâmetros inválidos
* `401` - Sessão não autorizada
* `404` - Sessão não encontrada
* `501` - Não implementado

## Exemplo de Uso

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.com.br/api/forwardMessage \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "my-session",
      "jid": "5511999999999@s.whatsapp.net",
      "messageId": "3EB0XXXXXX",
      "fromJid": "5511888888888@s.whatsapp.net"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.wappfy.com.br/api/forwardMessage', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      sessionId: 'my-session',
      jid: '5511999999999@s.whatsapp.net',
      messageId: '3EB0XXXXXX',
      fromJid: '5511888888888@s.whatsapp.net'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.wappfy.com.br/api/forwardMessage',
      json={
          'sessionId': 'my-session',
          'jid': '5511999999999@s.whatsapp.net',
          'messageId': '3EB0XXXXXX',
          'fromJid': '5511888888888@s.whatsapp.net'
      }
  )
  data = response.json()
  print(data)
  ```
</CodeGroup>


## OpenAPI

````yaml viewer.json post /api/forwardMessage
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Servidor Customizável
    variables:
      host:
        default: api.wappfy.com.br
        description: 'URL do servidor (ex: api.wappfy.com.br ou seu-servidor.com)'
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: >-
      Controlar sessões do WhatsApp (contas) (Control WhatsApp sessions
      (accounts))
  - name: 🔑 Auth
    description: Autenticação
  - name: 🆔 Profile
    description: Informações do seu perfil
  - name: 🖼️ Screenshot
    description: Obter captura de tela do WhatsApp e mostrar código QR
  - name: 📤 Chatting
    description: Métodos de conversação
  - name: 📢 Channels
    description: Métodos de canais (newsletters) (Channels (newsletters) methods)
  - name: 🟢 Status
    description: Métodos de status (aka stories) (Status (aka stories) methods)
  - name: 💬 Chats
    description: Métodos de conversas
  - name: 👤 Contacts
    description: >-
      Métodos de contatos. Use número de telefone (sem +) ou número de telefone
      e `@c.us` no final como `contactId`. Ex: `12312312310` OU
      `12312312310@c.us` (Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      'E.g: `12312312310` OR `12312312310@c.us`<br>)
  - name: 👥 Groups
    description: Métodos de grupos (Groups methods).<br>
  - name: ✅ Presence
    description: Informações de presença
  - name: 📅 Events
    description: Mensagem de Evento
  - name: 🏷️ Labels
    description: Etiquetas - disponível apenas para contas WhatsApp Business
  - name: 🔍 Observability
    description: Outros métodos
  - name: 🗄️ Storage
    description: Métodos de armazenamento
externalDocs:
  description: Wappfy - WhatsApp HTTP API
  url: https://wappfy.com.br/
paths:
  /api/forwardMessage:
    post:
      tags:
        - 📤 Chatting
      operationId: ChattingController_forwardMessage
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageForwardRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WAMessage'
      security:
        - api_key: []
components:
  schemas:
    MessageForwardRequest:
      type: object
      properties:
        chatId:
          type: string
          example: 5511999999999@c.us
        messageId:
          type: string
          example: false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA
        session:
          type: string
          example: my-session
          description: Nome da sessão (instanceName)
      required:
        - chatId
        - messageId
        - session
    WAMessage:
      type: object
      properties:
        id:
          type: string
          description: ID da mensagem
          example: false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA
        timestamp:
          type: number
          description: Timestamp Unix de quando a mensagem foi criada
          example: 1666943582
        from:
          type: string
          description: ID do chat para o qual esta mensagem foi enviada
          example: 5511999999999@c.us
        fromMe:
          type: boolean
          description: Indica se a mensagem foi enviada pelo usuário atual
        source:
          enum:
            - api
            - app
          type: string
          description: >-
            The device that sent the message - either API or APP. Available in
            events (webhooks/websockets) only and only "fromMe: true" messages.
          example: api
        to:
          type: string
          description: >-
            * ID for who this message is for.

            * If the message is sent by the current user, it will be the Chat to
            which the message is being sent.

            * If the message is sent by another user, it will be the ID for the
            current user.
          example: 5511999999999@c.us
        participant:
          type: string
          description: Para grupos - participante que enviou a mensagem
        body:
          type: string
          description: Conteúdo da mensagem
        hasMedia:
          type: boolean
          description: Indica se a mensagem possui mídia disponível para download
        media:
          description: Objeto de mídia da mensagem, se houver e foi baixada
          allOf:
            - $ref: '#/components/schemas/WAMedia'
        ack:
          enum:
            - -1
            - 0
            - 1
            - 2
            - 3
            - 4
          type: number
          description: Status de confirmação (ACK) da mensagem
        ackName:
          type: string
          description: Nome do status de confirmação da mensagem
        author:
          type: string
          description: >-
            Se a mensagem foi enviada para um grupo, este campo conterá o
            usuário que enviou a mensagem
        location:
          description: Informações de localização contidas na mensagem
          allOf:
            - $ref: '#/components/schemas/WALocation'
        vCards:
          description: Lista de vCards contidos na mensagem
          type: array
          items:
            type: string
        _data:
          type: object
          description: >-
            Mensagem em formato bruto do WhatsApp. Pode mudar a qualquer
            momento, use com cautela!
        replyTo:
          $ref: '#/components/schemas/ReplyToMessage'
      required:
        - id
        - timestamp
        - from
        - fromMe
        - source
        - to
        - participant
        - body
        - hasMedia
        - mediaUrl
        - ack
        - ackName
    WAMedia:
      type: object
      properties:
        url:
          type: string
          description: URL da mídia na mensagem, se houver
          example: >-
            http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga
        mimetype:
          type: string
          description: Tipo MIME da mídia na mensagem
          example: audio/jpeg
        filename:
          type: string
          description: Nome original do arquivo de mídia
          example: example.pdf
        s3:
          description: Atributos S3 da mídia se você estiver usando armazenamento S3
          allOf:
            - $ref: '#/components/schemas/S3MediaData'
        error:
          type: object
          description: Mensagem de erro ao baixar a mídia
          example: null
    WALocation:
      type: object
      properties:
        description:
          type: string
        latitude:
          type: string
        longitude:
          type: string
      required:
        - latitude
        - longitude
    ReplyToMessage:
      type: object
      properties:
        id:
          type: string
          description: ID da mensagem
          example: AAAAAAAAAAAAAAAAAAAA
        participant:
          type: string
          example: 5511999999999@c.us
        body:
          type: string
          example: Hello!
        _data:
          type: object
          description: Raw data from reply's message
      required:
        - id
    S3MediaData:
      type: object
      properties:
        Bucket:
          type: string
          description: Nome do bucket S3
          example: my-bucket
        Key:
          type: string
          description: Chave do objeto no bucket S3
          example: default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga
      required:
        - Bucket
        - Key
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)

````