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

# Send Chat Message

> Envia uma mensagem para o cliente no chat do pedido, em nome da loja.



## OpenAPI

````yaml /openapi/chat.yaml post /app/order/{order-id}/chat/messages
openapi: 3.1.0
info:
  title: CentralCart API
  version: 1.0.0
servers:
  - url: https://api.centralcart.io/v1
    description: Produção
security:
  - bearerAuth: []
paths:
  /app/order/{order-id}/chat/messages:
    post:
      tags:
        - Chat
      summary: Send Chat Message
      description: Envia uma mensagem para o cliente no chat do pedido, em nome da loja.
      operationId: sendChatMessage
      parameters:
        - name: order-id
          in: path
          required: true
          description: O ID interno do pedido (`internal_id`)
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  maxLength: 5000
                  description: Texto da mensagem
                attachments:
                  type: array
                  description: URLs de imagens já hospedadas
                  items:
                    type: string
            example:
              message: Seu item já foi entregue, qualquer coisa é só chamar aqui.
      responses:
        '200':
          description: Mensagem enviada.
          content:
            application/json:
              schema:
                type: object
                properties:
                  chat:
                    $ref: '#/components/schemas/Chat'
                  message:
                    $ref: '#/components/schemas/ChatMessage'
        '404':
          description: Pedido não encontrado, ou pedido ainda sem chat.
        '422':
          description: Mensagem vazia, acima de 5000 caracteres, ou anexo inválido.
components:
  schemas:
    Chat:
      type: object
      properties:
        channel_id:
          type: string
          description: Identificador do canal
        order_id:
          type: string
          nullable: true
          description: O ID interno do pedido
        type:
          type: string
          description: '`order` para o chat do pedido'
        status:
          type: string
          description: '`active` ou `archived`'
        last_message:
          type: string
          nullable: true
        is_buyer_online:
          type: boolean
          description: Se o cliente está com o chat aberto neste momento
        created_at:
          type: string
        updated_at:
          type: string
    ChatMessage:
      type: object
      properties:
        id:
          type: string
        message:
          type: string
        attachments:
          type: array
          items:
            type: string
        user_type:
          type: string
          description: >-
            `buyer` (cliente), `seller` (atendente no painel) ou `store`
            (mensagem automática do produto ou enviada pela API)
        sender_name:
          type: string
          nullable: true
          description: Nome exibido acima da mensagem
        source:
          type: string
          nullable: true
          description: '`api` quando a mensagem foi enviada por uma integração'
        read_by:
          type: array
          items:
            type: string
        timestamp:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Token de API gerado no painel da CentralCart.

````