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

# Finalizar atendimento



## OpenAPI

````yaml https://api.datacrazy.io/v1/api/openapi/v1/json post /api/v1/conversations/{id}/finish
openapi: 3.0.0
info:
  title: API CRM Datacrazy
  description: Versão 1.0 da API do CRM Datacrazy
  version: '1.0'
  contact: {}
servers:
  - url: https://api.g1.datacrazy.io
security: []
tags: []
paths:
  /api/v1/conversations/{id}/finish:
    post:
      tags:
        - Conversas
      summary: Finalizar atendimento
      operationId: ConversationsV1Controller_finish
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageDto'
      security:
        - access-token: []
components:
  schemas:
    MessageDto:
      type: object
      properties:
        id:
          type: string
          description: ID da mensagem
          example: 68597f2a95fb0298e5c128b5
        conversationId:
          type: string
          description: ID da conversa
          example: 34523f427033710f15389a18c
        createdAt:
          format: date-time
          type: string
          description: Data de envio da da mensagem
          example: '2025-06-25T18:03:37.292Z'
        updatedAt:
          format: date-time
          type: string
          description: Data em que a mensagem foi editada
          example: '2025-11-07T22:05:15.754Z'
        deletedAt:
          format: date-time
          type: string
          description: Data em que a mensagm foi excluída
          example: '2025-08-12T22:10:09.541Z'
        body:
          type: string
          description: Texto da mensagem
          example: Bom dia!
        received:
          type: boolean
          description: >-
            Valor booleano que indica se a mensagem foi recebida pelo
            destinatário
          example: true
        attachments:
          description: Anexos da mensagem, como imagem, documento, áudio.
          example:
            - id: 685c39fcc2523944ecd171f7
              createdAt: '2025-06-25T18:03:40.172Z'
              updatedAt: '2025-06-25T18:03:40.172Z'
              deletedAt: '2025-06-25T18:03:40.172Z'
              fileName: my-product-175087
              mimeType: image/jpeg
              url: >-
                https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/f514f655-4897-416e-b5c1-bbc19aac0805
              type: IMAGE
              size: '7642'
          type: array
          items:
            $ref: '#/components/schemas/AttachmentDto'
        vcard:
          description: Cartão de contato enviado pelo Whatsapp
          type: array
          items:
            $ref: '#/components/schemas/VCardDto'
        location:
          description: Informações da mensagem de localização
          allOf:
            - $ref: '#/components/schemas/LocationDto'
        status:
          type: string
          description: Status da mensagem
          example: RECEIVED
        contact:
          description: Informações do contato
          allOf:
            - $ref: '#/components/schemas/ContactDto'
        attendants:
          description: ID do atendente
          example:
            - userId: t9kn9mqPakdGG535GQK3hod8wzM2
              id: 6807e48c25ece34f9f1ba7dd
              name: Joao Silva
              email: joaosilva@gmail.com
              phone: 55 47 991331190
              imageURL: >-
                https://dc-qqqq1111pb.s3.amazonaws.com/profiles/koQGLa8p68fNZiiSmE1tec2LHtc2_2025-05-24T00%3A27%3A23.486Z
          type: array
          items:
            $ref: '#/components/schemas/AttendantDto'
        erroCode:
          type: string
          description: Código de erro da mensagem
          example: '402'
        errorMessage:
          type: string
          description: Mensagem retornada no erro
          example: O token utilizado está expirado
        header:
          type: string
          description: Presente somente em mensagems enviadas pelo Cloud api
          example: Boa tarde!
        footer:
          type: string
          description: Presente somente em mensagems enviadas pelo Cloud api
          example: Obrigado
        buttons:
          description: Botões presente na mensagem
          example:
            - id: '3d99cda4-62dc-4b9f-9c6c-124f1966b26a '
              name: Opção um
              description: Opcao para contatar o suporte
              url: www.google.com.br
          type: array
          items:
            $ref: '#/components/schemas/ButtonMessageDto'
        repliedMessage:
          description: Mensagem que foi respondida
          allOf:
            - $ref: '#/components/schemas/MessageDto'
        repliedMessageAttachment:
          description: Mensagem de anexo que foi respondido
          allOf:
            - $ref: '#/components/schemas/AttachmentDto'
        edited:
          type: boolean
          description: Valor boleano que indica se a mensagem foi editada ou não
          example: true
        deleted:
          type: boolean
          description: Valor boleano que indica se a mensagem foi deletada ou não
          example: true
        forwarded:
          type: boolean
          description: Valor boleano que indica se a mensagem é encaminhada ou não
          example: false
        forward:
          type: object
          description: Dados da mensagem encaminhada
        isScheduled:
          type: boolean
          description: >-
            Valor boleano que indica se a mensagem é uma mensagem agendada ou
            não
          example: true
        scheduledDate:
          format: date-time
          type: string
          description: Data e hora agendadas para o envio da mensagem
          example: '2025-11-07T22:05:15.754Z'
        signature:
          type: string
          description: Assinatura do atendente na mensagem
          example: Joao da Silva
        isInternal:
          type: boolean
          description: >-
            Valor boleano que indica se a mensagem é uma mensagem interna, sendo
            uma anotação
          example: true
        interpretedContentPending:
          type: boolean
        interpretedContent:
          type: string
    AttachmentDto:
      type: object
      properties:
        id:
          type: string
          description: ID do anexo
          example: 685c39fcc2523944ecd171f7
        createdAt:
          format: date-time
          type: string
          description: Data de envio do anexo
          example: '2025-06-25T18:03:40.172Z'
        updatedAt:
          format: date-time
          type: string
          description: Data de atualizacao do anexo
          example: '2025-06-25T18:03:40.172Z'
        deletedAt:
          format: date-time
          type: string
          description: Data de exclusão do anexo
          example: '2025-06-25T18:03:40.172Z'
        fileName:
          type: string
          description: Nome do anexo
          example: my-product-175087
        mimeType:
          type: string
          description: Formato do anexo
          example: image/jpeg
        url:
          type: string
          description: URL do anexo
          example: >-
            https://dc-qqqq2222pb.s3.amazonaws.com/d129a692-e5ab-42b3-b0e4-90ad9a12b068/f514f655-4897-416e-b5c1-bbc19aac0805
        type:
          type: string
          description: Tipo do anexo
          example: IMAGE
        size:
          type: number
          description: Tamanho do anexo
          example: '7642'
    VCardDto:
      type: object
      properties:
        id:
          type: string
          description: ID do card de contato
          example: 685c4fb6f3dbb11ae1d1b641
        createdAt:
          format: date-time
          type: string
          description: Data de criação do card de contato
          example: '2025-01-27T17:13:32.206Z'
        updatedAt:
          format: date-time
          type: string
          description: Data de atualização do card de contato
          example: '2025-01-27T17:33:49.092Z'
        deletedAt:
          format: date-time
          type: string
          description: Data de criação do card de contato
          example: '2025-01-27T17:13:32.266Z'
        name:
          type: string
          description: Nome do contato
          example: Guilherme Gavazzoni
        organization:
          type: string
          description: Empresa vinculada ao contato
          example: CRM Datacrazy
        phones:
          description: Telefones vinculados ao contato
          example:
            - '5541991331190'
            - '554733672094'
          type: array
          items:
            type: string
        emails:
          description: Emails vinculados ao contato
          example:
            - lead@gmail.com
            - suporte@gmail.com
          type: array
          items:
            type: string
        addresses:
          description: Endereços vinculados ao contato
          example:
            - Av. Paulista, 1578 - Bela Vista, São Paulo - SP, 01310-200
          type: array
          items:
            type: string
        url:
          type: string
          description: Url vinculada ao contato
          example: www.google.com.br
        birthday:
          format: date-time
          type: string
          description: Data de nascimento vinculada ao contato
          example: 12//07/1984
        note:
          type: string
          description: Mensagem enviada junto ao contato
          example: Esse é o contato dele!
    LocationDto:
      type: object
      properties:
        latitude:
          type: number
          example: -23.55052
        longitude:
          type: number
          example: -46.633308
        address:
          type: string
          example: Av. Paulista, 1578 - Bela Vista, São Paulo - SP, 01310-200
        name:
          type: string
          example: Escritório Central
        caption:
          type: string
          example: Localização do negócio
      required:
        - latitude
        - longitude
    ContactDto:
      type: object
      properties:
        id:
          type: string
          description: ID do contato
          example: 6808cd89c9968a7b8a41b9f7
        createdAt:
          format: date-time
          type: string
          example: '2024-12-19T14:21:42.164Z'
          description: Data de criação do contato
        updatedAt:
          format: date-time
          type: string
          example: '2025-06-24T16:28:23.703Z'
          description: Data de atualização do contato
        name:
          type: string
          example: Angelica Schramm
          description: Nome do contato salvo no Data Crazy
        imageURL:
          type: string
          example: >-
            https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/df4db2b8-7f0f-44d4-88e1-dd3e838f275e
          description: URL da imagem de perfil do contato
        contactId:
          type: string
          example: '5547988367066'
          description: ID do contato
        platform:
          type: string
          example: WHATSAPP
          description: Plataforma utilizada no contato
        externalId:
          type: string
          example: 1c3627f8-d6b9-42a9-b355-6977c04c969e
          description: ID exterdo do contato
        accountName:
          type: string
          example: '@AngelicaSchramm'
          description: >-
            Nome do usuário na plataforma de contato, por exemplo nome no
            Instagram
        pending:
          type: boolean
          example: true
          description: Valor boleano que indica se a mensagem ainda está pendente de envio
        externalInfo:
          description: Informações externas de alguma fonte de dados
          allOf:
            - $ref: '#/components/schemas/ContactExternalInfoDto'
    AttendantDto:
      type: object
      properties:
        userId:
          type: string
          description: ID do usuário
          example: t9kn9mqPakdGG535GQK3hod8wzM2
        id:
          type: string
          description: ID do usuário como atendente (ID do atendente)
          example: 6807e48c25ece34f9f1ba7dd
        name:
          type: string
          description: Nome do atendente
          example: Joao Silva
        email:
          type: string
          description: Email do atendente
          example: joaosilva@gmail.com
        phone:
          type: string
          description: Telefone do atendente
          example: '5547991331190'
        imageURL:
          type: string
          description: Url da imagem do atendente
          example: >-
            https://dc-qqqq1111pb.s3.amazonaws.com/profiles/koQGLa8p68fNZiiSmE1tec2LHtc2_2025-05-24T00%3A27%3A23.486Z
    ButtonMessageDto:
      type: object
      properties:
        id:
          type: string
          description: ID do botão
          example: '8c2c1a45-4d8e-4420-a4d6-70906c4c3f3f  '
        name:
          type: string
          description: Opção um
          example: Opção um
        description:
          type: string
          description: Descricao do botao, quando o formato é em lista
          example: Opcao para contatar o suporte
        url:
          type: string
          description: URL para onde o botão direciona
          example: www.google.com.br
    ContactExternalInfoDto:
      type: object
      properties:
        tagIds:
          example:
            - 849fefab-e697-4720-9303-e788c23790cc
            - 9e008d34-86d2-49fd-90af-34a9f9b29896
          description: Lista de ID de tags recebida da fonte de dados
          type: array
          items:
            type: string
        stageIds:
          example:
            - 6fda2a0d-5e7c-4c51-bf47-2c60f7d34283
            - 2bc3d979-93a4-4e64-8903-5d9379d3de91
          description: Lista de ID de stages recebida da fonte de dados
          type: array
          items:
            type: string
        pipelineIds:
          example:
            - 3e409b29-0462-40b0-aef4-5eb6f0f2f89a
            - 74c8e833-f681-4ed0-9ce6-e474e2d4b1a0
          description: Lista de ID de stages recebida da fonte de dados
          type: array
          items:
            type: string
  securitySchemes:
    access-token:
      scheme: bearer
      bearerFormat: JWT
      type: http

````