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

# Update conversation

> Updates the data of an existing conversation



## OpenAPI

````yaml /en/openapi.json put /v1/conversations/{id}
openapi: 3.0.0
info:
  title: Nuvia API - Company
  description: API documentation for companies
  version: '1.0'
  contact: {}
servers:
  - url: https://api.nuvia.ai
security: []
tags:
  - name: messages
    x-group: Mensagens
  - name: contacts
    x-group: Contatos
  - name: campaigns
    x-group: Campanhas
  - name: tables
    x-group: Tabelas e Listas
  - name: agents
    x-group: Agentes
  - name: conversations
    x-group: Conversas
  - name: inboxes
    x-group: Caixas de Entrada
  - name: knowledge
    x-group: Base de Conhecimento
  - name: Webhooks
    x-group: Webhooks
  - name: campaign-enrollments
    x-group: Inscrições em Campanha
  - name: custom-fields
    x-group: Campos Customizados
paths:
  /v1/conversations/{id}:
    put:
      tags:
        - conversations
      summary: Update conversation
      description: Updates the data of an existing conversation
      operationId: ConversationController_updateConversation
      parameters:
        - name: x-company-id
          in: header
          description: >-
            Target company identifier. Required only for global API keys
            (type=global). Ignored for company API keys and human users.
          required: false
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Conversation ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConversationDto'
      responses:
        '200':
          description: Conversation updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationResponseDto'
        '400':
          description: Invalid data
        '401':
          description: Invalid or expired token
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
      security:
        - JWT-auth: []
components:
  schemas:
    UpdateConversationDto:
      type: object
      properties:
        additional_attributes:
          description: Additional conversation attributes (key-value)
          type: object
          additionalProperties: {}
        custom_attributes:
          description: System attributes (linked deal, etc.)
          type: object
          properties:
            deal:
              description: Referência ao deal de CRM externo
              type: object
              properties:
                crm_type:
                  type: string
                  description: Tipo de CRM (hubspot, salesforce, etc.)
                crm_external_id:
                  type: string
                  description: ID do deal no CRM externo
                name:
                  description: Nome do deal
                  type: string
                amount:
                  description: Valor do deal
                  type: string
                stage:
                  description: Estágio do deal
                  type: string
                pipeline:
                  description: Pipeline do deal
                  type: string
                crm_last_synced_at:
                  description: Data da última sincronização
                  type: string
              required:
                - crm_type
                - crm_external_id
                - crm_last_synced_at
          additionalProperties: {}
        who_answering:
          type: string
          enum:
            - AGENT
            - HUMAN
            - UNASSIGNED
          description: Who is responding (AGENT/HUMAN)
        agent:
          description: Agent ID
          type: string
        current_step_slug:
          description: Slug of the current step
          type: string
        current_step:
          description: ID of the flow's current step
          type: string
        requires_attention:
          description: Attention required
          type: object
          properties:
            type:
              type: string
              enum:
                - HUMAN_HANDOFF
                - AI_SUPPORT_REQUEST
                - IDLE_CONVERSATION
                - CONTACT_MESSAGE
              description: Tipo de atenção necessária
            requested_at:
              description: Data da solicitação de atenção
              type: string
          required:
            - type
            - requested_at
          nullable: true
        contact_last_activity_at:
          description: Date of the contact's last activity
          type: string
        last_activity_at:
          description: Date of the last activity
          type: string
        allow_send_messages_at:
          description: Date until which messages can be sent (WhatsApp 24h window)
          type: string
        referral:
          description: Conversation referral data (ads, posts)
          type: object
          properties:
            source_url:
              type: string
            source_id:
              type: string
            source_type:
              type: string
            source_app:
              type: string
            title:
              type: string
            body:
              type: string
            media_type:
              anyOf:
                - type: string
                - type: number
            media_url:
              type: string
            thumbnail_url:
              type: string
            ctwa_clid:
              type: string
            welcome_message:
              type: object
              properties:
                text:
                  type: string
            greeting_message:
              type: string
            conversion_source:
              type: string
            entry_point_app:
              type: string
            conversion_delay_seconds:
              type: number
            raw_data:
              type: object
              additionalProperties: {}
        status:
          description: Conversation status
          type: string
        custom_fields:
          description: >-
            Updates custom field values on the conversation, by slug. Covers
            `select`/`multi_select` (value = `option_id`, or a list of them) and
            `text` (value = the string). For `number`/`date`, use
            `additional_attributes`, which preserves the native type. Atomic
            validation: an invalid value writes no field and returns 422. The
            `option_id` values come from `GET /v1/custom-fields/{id}/options`.
          type: object
          additionalProperties:
            anyOf:
              - type: string
                nullable: true
              - type: array
                items:
                  type: string
                nullable: true
        resume:
          description: Conversation summary generated by the specialist
          type: string
        temperature:
          description: Sales temperature classified by the specialist
          type: string
          enum:
            - HOT
            - WARM
            - COLD
            - CLOSED
        sentiment:
          description: Sentiment classified by the specialist
          type: string
          enum:
            - POSITIVE
            - NEUTRAL
            - NEGATIVE
        qualification:
          description: BANT/GPCT/MEDDIC qualification (specialist)
          type: object
          properties:
            methodology:
              type: string
              description: Metodologia (BANT/GPCT/MEDDIC/NONE)
            dimensions:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  label:
                    type: string
                  score:
                    type: number
                  summary:
                    type: string
                required:
                  - key
                additionalProperties: {}
              description: Dimensões da metodologia com score/summary
          required:
            - methodology
            - dimensions
          additionalProperties: {}
        lead_score:
          description: Lead score 0-100 based on qualification + ICP
          type: number
          minimum: 0
          maximum: 100
        safety_scores:
          description: Safety scores (prompt injection, hallucination, etc.)
          type: object
          properties:
            prompt_injection:
              type: number
            harmful_content:
              type: number
            assertiveness:
              type: number
            hallucination:
              type: number
          additionalProperties: {}
    ConversationResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Conversation ID
        additional_attributes:
          description: Additional conversation attributes
        agent_last_activity_at:
          description: Date of the agent's last activity
        contact_last_activity_at:
          description: Date of the contact's last activity
        allow_send_messages_at:
          description: Date allowed to send messages
        last_activity_at:
          description: Date of the last activity
        priority:
          description: Conversation priority
          type: number
          enum:
            - 4
            - 3
            - 2
            - 1
        status:
          type: string
          enum:
            - OPEN
            - RESOLVED
          description: Conversation status
        who_answering:
          type: string
          enum:
            - AGENT
            - HUMAN
            - UNASSIGNED
          description: Who is responding (AGENT/HUMAN)
        contact:
          description: Conversation's contact
        inbox:
          description: Conversation's inbox
        agent:
          description: Agent assigned to the conversation
        current_step:
          description: Current step of the agent's flow
        company:
          description: Conversation's company
        user:
          description: User assigned to the conversation
        requires_attention:
          description: Attention required
          type: object
          properties:
            type:
              type: string
              enum:
                - HUMAN_HANDOFF
                - AI_SUPPORT_REQUEST
                - IDLE_CONVERSATION
                - CONTACT_MESSAGE
              description: Tipo de atenção necessária
            requested_at:
              description: Data da solicitação de atenção
          required:
            - type
            - requested_at
        referral:
          description: Conversation referral data
        createdAt:
          description: Conversation creation date
        updatedAt:
          description: Conversation update date
        resolved_count:
          description: Number of resolved conversations for the contact (only when grouped)
          type: number
      required:
        - last_activity_at
        - status
        - who_answering
        - contact
        - inbox
        - company
  securitySchemes:
    JWT-auth:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Token JWT de autenticação

````