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

# Enviar mensagem



## OpenAPI

````yaml /api-reference/openapi.yaml post /chat/conversations/{id}/messages
openapi: 3.0.3
info:
  title: Nupapia API — Integração
  version: '1.0'
  description: >
    Referência da API pública da Nupapia para integração de sistemas terceiros:
    conversas de chat e CRM (clientes). Gere um token de integração em
    **Configurações → Integrações** dentro da Nupapia e use-o como Bearer token
    em todas as chamadas abaixo.
servers:
  - url: https://api.nupapia.com.br/api
    description: Produção
security:
  - integrationToken: []
paths:
  /chat/conversations/{id}/messages:
    post:
      tags:
        - Conversas
      summary: Enviar mensagem
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - content
              properties:
                content:
                  type: string
                content_type:
                  type: string
                  example: text
                file_url:
                  type: string
                file_name:
                  type: string
                subject:
                  type: string
                reply_to_id:
                  type: integer
                client_message_id:
                  type: string
                  description: >
                    ID gerado pelo seu sistema para evitar duplicidade —
                    reenvios com o mesmo valor dentro de 60s são ignorados.
      responses:
        '201':
          description: Mensagem criada
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Message'
components:
  parameters:
    ConversationId:
      name: id
      in: path
      required: true
      schema:
        type: integer
  schemas:
    Message:
      type: object
      properties:
        id:
          type: integer
        body:
          type: string
        contentType:
          type: string
          example: text
        content:
          type: string
        senderType:
          type: string
          enum:
            - user
            - client
            - system
        senderId:
          type: integer
          nullable: true
        file_url:
          type: string
          nullable: true
        file_name:
          type: string
          nullable: true
        read:
          type: boolean
        read_at:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        reply_to_id:
          type: integer
          nullable: true
        edited_at:
          type: string
          format: date-time
          nullable: true
        client_message_id:
          type: string
          nullable: true
        reactions:
          type: array
          items:
            type: object
  securitySchemes:
    integrationToken:
      type: http
      scheme: bearer
      bearerFormat: Token de integração (gerado em Configurações → Integrações)

````