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

# Enviar Mensagem

> Envia uma mensagem através de uma integração específica, suporte a texto e mídia.



## OpenAPI

````yaml POST /message/send-message
openapi: 3.1.0
info:
  title: OpenAPI Multchats
  description: Multchats API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.multchats.com/v2
security:
  - bearerAuth: []
paths:
  /message/send-message:
    post:
      tags:
        - Messages
      summary: Enviar mensagem
      description: >-
        Envia uma mensagem através de uma integração específica, suporte a texto
        e mídia.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
      responses:
        '200':
          description: Mensagem enviada com sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
        '400':
          description: Erro na requisição
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SendMessageRequest:
      type: object
      required:
        - integrationId
        - message
      properties:
        integrationId:
          description: ID da integração para enviar a mensagem
          type: string
          pattern: ^c[a-z0-9]{24}$
        phoneNumber:
          description: >-
            Número de telefone do destinatário (obrigatório se chatId não
            fornecido)
          type: string
          minLength: 1
          maxLength: 255
        chatId:
          description: >-
            ID do chat do destinatário (obrigatório se phoneNumber não
            fornecido)
          type: string
          minLength: 1
          maxLength: 255
        message:
          $ref: '#/components/schemas/Message'
    SendMessageResponse:
      type: object
      properties:
        success:
          description: Indica se a operação foi bem-sucedida
          type: boolean
          default: true
        response:
          description: Resposta da operação de envio
          type: object
    Error:
      required:
        - success
        - message
      type: object
      properties:
        success:
          description: Indica se a operação foi bem-sucedida
          type: boolean
          default: false
        message:
          description: Mensagem de erro (quando success é false)
          type: string
          default: Erro ao enviar mensagem
    Message:
      type: object
      required:
        - type
      properties:
        type:
          description: Tipo da mensagem
          type: string
          enum:
            - text
            - reaction
            - audio
            - image
            - video
            - document
            - template
            - interactive
        text:
          $ref: '#/components/schemas/TextMessage'
        context:
          $ref: '#/components/schemas/MessageContext'
        media:
          $ref: '#/components/schemas/MediaMessage'
        reaction:
          $ref: '#/components/schemas/ReactionMessage'
        template:
          $ref: '#/components/schemas/TemplateMessage'
        interactive:
          description: Objeto interativo
          type: object
    TextMessage:
      type: object
      required:
        - body
      properties:
        body:
          description: Conteúdo da mensagem de texto
          type: string
          minLength: 1
          maxLength: 65536
    MessageContext:
      type: object
      required:
        - message_id
      properties:
        message_id:
          description: ID da mensagem de contexto
          type: string
          minLength: 1
          maxLength: 255
    MediaMessage:
      type: object
      required:
        - link
      properties:
        link:
          description: URL ou base64 da mídia
          type: string
          minLength: 1
        caption:
          description: Legenda da mídia
          type: string
          minLength: 1
          maxLength: 65536
        fileName:
          description: Nome do arquivo
          type: string
          minLength: 1
          maxLength: 255
    ReactionMessage:
      type: object
      required:
        - message_id
        - emoji
      properties:
        message_id:
          description: ID da mensagem para reagir
          type: string
          minLength: 1
          maxLength: 255
        emoji:
          description: Emoji da reação
          type: string
          minLength: 1
          maxLength: 255
    TemplateMessage:
      type: object
      description: >-
        Template de mensagem, em integrações -> ações -> Modelos, gere o json
        com os parâmetros e o templateId
      required:
        - templateId
      properties:
        templateId:
          description: ID do template
          type: string
        params:
          description: Parâmetros do template
          type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````