# Get conversation

> GET /v1/conversations/{conversationId}

`GET https://api.zavu.dev/v1/conversations/{conversationId}`

## Parameters

- `conversationId` (path, string, required)

## Responses

### 200

Conversation details.

- `conversation` (object, required): An inbox thread with one contact. A conversation groups every message exchanged with that contact across channels, so a contact who writes on WhatsApp and later by email stays in one thread.
  - `id` (string, required)
  - `contactId` (string): ID of the contact this thread belongs to. Absent on group threads and on threads whose contact has not been resolved yet.
  - `contactIdentifier` (string, required): The key this thread is filed under: a phone number in E.164, a WhatsApp business-scoped user ID (BSUID), or a numeric chat ID (Telegram/Instagram/Messenger). It is not always a phone number, so do not parse it as one.
  - `email` (string): Email address of the thread, when the contact was reached by email.
  - `channels` (string[], required): Every channel this thread has carried messages on.
  - `lastMessage` (object, required): Denormalized preview of the most recent message, so a thread list needs no extra fetch.
    - `id` (string, required)
    - `text` (string, required): Text or caption. Empty when the last message carried no text (e.g. media).
    - `channel` (string, required): Delivery channel. Use 'auto' for intelligent routing. One of: `auto`, `sms`, `sms_oneway`, `whatsapp`, `telegram`, `email`, `instagram`, `messenger`, `voice`.
    - `direction` (string, required) One of: `inbound`, `outbound`.
    - `at` (string<date-time>, required)
  - `senderId` (string): Sender that last handled this thread. Use it as the `Zavu-Sender` header when replying so the answer leaves from the same number the contact knows.
  - `messageCount` (integer, required)
  - `unreadCount` (integer, required): Inbound messages not yet marked read. Reset with POST /v1/conversations/{conversationId}/read.
  - `whatsapp` (object): WhatsApp identity, present when the contact adopted a username.
    - `bsuid` (string): Business-scoped user ID. Can be used as `to` when sending.
    - `username` (string)
  - `createdAt` (string<date-time>, required)
  - `updatedAt` (string<date-time>, required)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Conversation not found.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/conversations/conversation_abc123" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.conversations.retrieve("conversation_abc123");

console.log(result);
```
