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

# Obter conversa usuario

## Obter Conversa do Usuário

Este endpoint permite obter os detalhes de uma conversa específica do usuário, incluindo seu histórico completo.

### Casos de uso

* Visualizar detalhes completos de uma conversa específica
* Acessar histórico de mensagens de uma conversa
* Obter informações de contato e contexto da conversa
* Analisar interações entre usuário e agente

### Parâmetros

| Parâmetro  | Tipo    | Descrição                                                                  |
| ---------- | ------- | -------------------------------------------------------------------------- |
| id         | string  | ID da conversa (obrigatório)                                               |
| simplified | boolean | Retornar dados simplificados da conversa com apenas informações essenciais |

<Card>
  <CardContent>
    Teste este endpoint diretamente do seu navegador.
  </CardContent>
</Card>

### Exemplos de código

<CodeGroup>
  ```javascript JavaScript theme={null}
  const fetchUserConversation = async (conversationId) => {
    const response = await fetch(`https://dash.superagentes.ai/api/user-conversations/${conversationId}`, {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${seu_token_jwt}`,
        'Content-Type': 'application/json'
      }
    });
    
    const data = await response.json();
    return data;
  };
  ```

  ```python Python theme={null}
  import requests

  def fetch_user_conversation(conversation_id):
      headers = {
          'Authorization': f'Bearer {seu_token_jwt}',
          'Content-Type': 'application/json'
      }
      
      response = requests.get(f'https://dash.superagentes.ai/api/user-conversations/{conversation_id}', headers=headers)
      
      return response.json()
  ```

  ```curl cURL theme={null}
  curl --request GET \
    --url 'https://dash.superagentes.ai/api/user-conversations/conversation-id-1' \
    --header 'Authorization: Bearer seu_token_jwt' \
    --header 'Content-Type: application/json'
  ```
</CodeGroup>

### Exemplo de resposta

<ResponseExample>
  ```json theme={null}
  {
    "id": "conversation-id-1",
    "title": "Conversa com Cliente",
    "status": "UNRESOLVED",
    "channel": "whatsapp",
    "channelExternalId": "+5511999999999",
    "agent": {
      "id": "agent-id",
      "name": "Nome do Agente",
      "iconUrl": "https://exemplo.com/icon.png",
      "handle": "@agent_handle"
    },
    "contactInfo": {
      "phoneNumber": "+5511999999999",
      "name": "Nome do Cliente",
      "email": "cliente@exemplo.com"
    },
    "messages": [
      {
        "id": "message-id-1",
        "text": "Olá, como posso ajudar?",
        "html": "<p>Olá, como posso ajudar?</p>",
        "from": "agent",
        "conversationId": "conversation-id-1",
        "createdAt": "2024-01-01T00:00:00.000Z",
        "updatedAt": "2024-01-01T00:00:00.000Z",
        "read": true,
        "attachments": [],
        "user": {
          "id": "user-id",
          "name": "Nome do Usuário",
          "picture": "https://exemplo.com/picture.jpg",
          "customPicture": "https://exemplo.com/custom-picture.jpg"
        },
        "contact": {
          "id": "contact-id",
          "firstName": "Nome",
          "lastName": "Sobrenome",
          "phoneNumber": "+5511999999999",
          "email": "cliente@exemplo.com"
        },
        "agent": {
          "id": "agent-id",
          "name": "Nome do Agente",
          "iconUrl": "https://exemplo.com/icon.png"
        }
      }
    ],
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z"
  }
  ```
</ResponseExample>
