> ## 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.

# Atualizar uma conversa

> Atualização genérica — envie apenas os campos que quer alterar (status, estágio do pipeline, responsável, etc).




## OpenAPI

````yaml /api-reference/openapi.yaml patch /chat/conversations/{id}
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}:
    patch:
      tags:
        - Conversas
      summary: Atualizar uma conversa
      description: >
        Atualização genérica — envie apenas os campos que quer alterar (status,
        estágio do pipeline, responsável, etc).
      parameters:
        - $ref: '#/components/parameters/ConversationId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                assigned_user_id:
                  type: integer
                topic:
                  type: string
                evaluation:
                  type: string
                pipeline_id:
                  type: integer
                pipeline_stage_id:
                  type: integer
                archive:
                  type: boolean
                pinned:
                  type: boolean
                spam:
                  type: boolean
      responses:
        '200':
          description: Conversa atualizada
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Conversation'
components:
  parameters:
    ConversationId:
      name: id
      in: path
      required: true
      schema:
        type: integer
  schemas:
    Conversation:
      type: object
      description: >
        Não vem como `{client: {...}}` aninhado — os dados do cliente já chegam
        soltos no nível raiz (`name`, `avatarUrl`). `channel` é uma string (nome
        do canal), o tipo mora em `channel_type` separado. Os timestamps de
        conversa são `createdAt`/`updatedAt` (camelCase); já os de cliente/CRM
        (`GET /clients`, etc.) são `created_at`/ `updated_at` (snake_case) — vêm
        de partes diferentes do sistema, e a API reflete isso, sem normalizar.
      properties:
        id:
          type: integer
          example: 4821
        name:
          type: string
          description: Nome do cliente dono da conversa (não vem aninhado em `client`).
        avatarUrl:
          type: string
          nullable: true
        lastMessage:
          type: string
          nullable: true
          description: Texto/preview da última mensagem.
        lastMessageType:
          type: string
          nullable: true
          example: text
        lastMessageTime:
          type: string
          format: date-time
          nullable: true
        channel:
          type: string
          description: Nome do canal (ex. "WhatsApp Vendas"), não um objeto.
        channel_type:
          type: string
          example: wba
          description: |
            Tipo do canal — WhatsApp aparece como `"wba"`, não `"whatsapp"`.
        channel_display_name:
          type: string
          nullable: true
        status:
          type: string
          example: aberto
        acceptance_status:
          type: string
          example: accepted
        pinned:
          type: boolean
        assigned_user_id:
          type: integer
          nullable: true
        unread:
          type: integer
          example: 3
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        firstMessageAt:
          type: string
          format: date-time
          nullable: true
        topic:
          type: string
          nullable: true
        pipeline_id:
          type: integer
          nullable: true
        pipeline_stage_id:
          type: integer
          nullable: true
        pipeline_stage:
          type: string
          nullable: true
          description: 'Ex: "Vendas • Negociação".'
        participants:
          type: array
          description: >
            Sempre vazio em `GET /chat/conversations` (evita N+1 na listagem).
            Só vem preenchido em `GET /chat/conversations/{id}` — é ali, em
            `participants[].phone_number`, que está o telefone do cliente, não
            em nenhum campo solto da conversa.
          items:
            type: object
  securitySchemes:
    integrationToken:
      type: http
      scheme: bearer
      bearerFormat: Token de integração (gerado em Configurações → Integrações)

````