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

# Consultar conversa

> Consulta o status e os detalhes de uma conversa específica

<Note>
  Este endpoint não emite nenhum evento ao webhook. É uma consulta somente leitura para obter o status atual de uma conversa.
</Note>

## Descrição

Consulta os detalhes e o status atual de uma conversa específica. Retorna informações do usuário, o bot associado, as datas de início e encerramento, e o motivo do encerramento se aplicável.

## Endpoint

```
GET https://gateway.jelou.ai/platform/v1/external-support/{projectId}/conversations/{conversationId}
```

## Parâmetros de rota

<ParamField path="projectId" type="string" required>
  Identificador único do projeto Jelou ao qual a conversa pertence.
</ParamField>

<ParamField path="conversationId" type="string" required>
  Identificador único da conversa que se deseja consultar.
</ParamField>

## Autenticação

Todas as requisições devem incluir o cabeçalho `x-api-key` com a API key do projeto Jelou.

```
x-api-key: API_KEY
```

## Exemplo de requisição

O exemplo a seguir consulta os detalhes da conversa `CONVERSATION_ID` dentro do projeto `PROJECT_ID`:

```bash cURL theme={null}
curl --request GET \
  --url https://gateway.jelou.ai/platform/v1/external-support/PROJECT_ID/conversations/CONVERSATION_ID \
  --header 'x-api-key: API_KEY'
```

## Respostas

| Código | Status                | Descrição                                                  |
| ------ | --------------------- | ---------------------------------------------------------- |
| 200    | OK                    | Conversa encontrada. Retorna os detalhes da conversa.      |
| 401    | Unauthorized          | Credenciais de autenticação inválidas ou ausentes.         |
| 404    | Not Found             | Conversa não encontrada para os identificadores indicados. |
| 500    | Internal Server Error | Erro interno do servidor.                                  |

## Exemplo de resposta

```json theme={null}
{
  "message": [
    "Conversation retrieved successfully"
  ],
  "statusMessage": "success",
  "status": 1,
  "data": {
    "_id": "CONVERSATION_ID",
    "roomId": "ROOM_ID",
    "state": "closed",
    "startAt": "2026-01-15T10:30:00.000Z",
    "endAt": "2026-01-15T10:45:00.000Z",
    "endedReason": "closed_by_operator",
    "User": {
      "id": "USER_ID",
      "names": "USER_NAME",
      "referenceId": "USER_REFERENCE_ID",
      "createdAt": "2025-01-28T20:54:25.572Z"
    },
    "Bot": {
      "id": "BOT_ID",
      "name": "BOT_NAME",
      "type": "Whatsapp"
    }
  }
}
```

## Estrutura da resposta

| Campo                   | Tipo   | Descrição                                                                     |
| ----------------------- | ------ | ----------------------------------------------------------------------------- |
| `data._id`              | string | Identificador único da conversa.                                              |
| `data.roomId`           | string | Identificador da sala de conversa.                                            |
| `data.state`            | string | Status da conversa: `active` ou `closed`.                                     |
| `data.startAt`          | date   | Data e hora de início da conversa.                                            |
| `data.endAt`            | date   | Data e hora de encerramento. Presente apenas se a conversa estiver encerrada. |
| `data.endedReason`      | string | Motivo do encerramento: `closed_by_operator`.                                 |
| `data.User.id`          | string | Identificador do usuário final.                                               |
| `data.User.names`       | string | Nome do usuário final.                                                        |
| `data.User.referenceId` | string | Identificador de referência externo do usuário.                               |
| `data.Bot.id`           | string | Identificador do bot que atendeu a conversa.                                  |
| `data.Bot.name`         | string | Nome do bot.                                                                  |
| `data.Bot.type`         | string | Canal do bot (por exemplo: `Whatsapp`).                                       |


## OpenAPI

````yaml GET /v1/external-support/{projectId}/conversations/{conversationId}
openapi: 3.1.0
info:
  title: Jelou API
  description: >-
    API for the Jelou platform. Send messages, manage campaigns, handle
    conversations, users, databases, and widgets.
  version: 1.0.0
servers:
  - url: https://api.jelou.ai
    description: Production server
security:
  - basicAuth: []
tags:
  - name: Messages
    description: Send messages to users
  - name: Campaigns
    description: HSM campaigns and templates
  - name: Conversations
    description: Chat history and metrics
  - name: Users
    description: User state and cache management
  - name: Resources
    description: Media resource management
  - name: Datum
    description: Database CRUD operations
  - name: Widget
    description: Widget and room management
  - name: PMA Custom
    description: External support panel integration
paths:
  /v1/external-support/{projectId}/conversations/{conversationId}:
    servers:
      - url: https://gateway.jelou.ai/platform
        description: External Support Panel API
    get:
      tags:
        - External Support Panel
      summary: Get Conversation
      description: >-
        Retrieve the details of a specific conversation in the external support
        panel.
      operationId: getExternalConversation
      parameters:
        - name: projectId
          in: path
          required: true
          description: Unique identifier of the Jelou project
          schema:
            type: string
        - name: conversationId
          in: path
          required: true
          description: Unique identifier of the conversation
          schema:
            type: string
      responses:
        '200':
          description: Conversation retrieved successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - apiKey: []
components:
  responses:
    Unauthorized:
      description: Unauthorized - Invalid authentication credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found - Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusMessage:
          type: string
        status:
          type: integer
        error:
          type: object
          properties:
            code:
              type: string
            key:
              type: string
            description:
              type: string
            developerMessages:
              type: object
            clientMessages:
              type: object
        validationError:
          type: object
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Basic authentication using Base64 encoded clientId:clientSecret
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key del proyecto de Jelou

````