# Get an email thread with its messages

Fetches an email thread with its messages.

```http
GET https://api.pozy.ai/v1/email/threads/{threadId}
```

- Area: Email, calendar & files / Email
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `threadId` (string, required)

## Query parameters

- `accountId` (string, required)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/email/threads/60186572e25ff711298bf12e?accountId=696e0b682d0a31188e7a2ba9" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/email/threads/60186572e25ff711298bf12e?accountId=696e0b682d0a31188e7a2ba9", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/email/threads/60186572e25ff711298bf12e",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "accountId": "696e0b682d0a31188e7a2ba9",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `data`, object
  - `id`, string
  - `accountId`, string
  - `provider`, string: One of `google`, `microsoft`
  - `subject`, string
  - `snippet`, string
  - `participants`, array of object
    - `email`, string (email), required
    - `name`, string: Can be null
  - `messageIds`, array of string
  - `draftIds`, array of string
  - `folders`, array of string
  - `hasAttachments`, boolean
  - `hasDrafts`, boolean
  - `unread`, boolean
  - `starred`, boolean
  - `earliestMessageAt`, string (date-time): Can be null
  - `latestMessageReceivedAt`, string (date-time): Can be null
  - `latestMessageSentAt`, string (date-time): Can be null
  - `messages`, array of object
    - `id`, string
    - `threadId`, string
    - `accountId`, string
    - `provider`, string: One of `google`, `microsoft`
    - `folders`, array of string
    - `from`, object
      - one of: Email Address
        - `email`, string (email), required
        - `name`, string: Can be null
    - `to`, array of object
      - `email`, string (email), required
      - `name`, string: Can be null
    - `cc`, array of object
      - `email`, string (email), required
      - `name`, string: Can be null
    - `bcc`, array of object
      - `email`, string (email), required
      - `name`, string: Can be null
    - `replyTo`, array of object
      - `email`, string (email), required
      - `name`, string: Can be null
    - `subject`, string
    - `snippet`, string
    - `text`, string: Can be null
    - `html`, string: Can be null
    - `attachments`, array of object
      - `id`, string
      - `filename`, string
      - `contentType`, string
      - `size`, integer
      - `isInline`, boolean
      - `contentId`, string: Can be null
    - `headers`, map of string
    - `raw`, string
    - `date`, string (date-time)
    - `unread`, boolean
    - `starred`, boolean
    - `metadata`, map of string

```json
{
  "data": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "accountId": "696e0b682d0a31188e7a2ba9",
    "provider": "google",
    "subject": "string",
    "snippet": "string",
    "participants": [
      {
        "email": "alex@example.com",
        "name": "Acme"
      }
    ],
    "messageIds": [
      "Hello from Pozy"
    ],
    "draftIds": [
      "string"
    ],
    "folders": [
      "string"
    ],
    "hasAttachments": true,
    "hasDrafts": true,
    "unread": true,
    "starred": true,
    "earliestMessageAt": "2026-10-02T09:00:00.000Z",
    "latestMessageReceivedAt": "2026-10-02T09:00:00.000Z",
    "latestMessageSentAt": "2026-10-02T09:00:00.000Z",
    "messages": [
      {
        "id": "6bfebd43ddc270f6d2c56fc5",
        "threadId": "60186572e25ff711298bf12e",
        "accountId": "696e0b682d0a31188e7a2ba9",
        "provider": "google",
        "folders": [
          "string"
        ],
        "from": {
          "email": "alex@example.com",
          "name": "Acme"
        },
        "to": [
          {
            "email": "alex@example.com",
            "name": "Acme"
          }
        ],
        "cc": [
          {
            "email": "alex@example.com",
            "name": "Acme"
          }
        ],
        "bcc": [
          {
            "email": "alex@example.com",
            "name": "Acme"
          }
        ],
        "replyTo": [
          {
            "email": "alex@example.com",
            "name": "Acme"
          }
        ],
        "subject": "string",
        "snippet": "string",
        "text": "Hello from Pozy",
        "html": "string",
        "attachments": [
          {
            "id": "6bfebd43ddc270f6d2c56fc5",
            "filename": "photo.jpg",
            "contentType": "image/jpeg",
            "size": 482133,
            "isInline": true,
            "contentId": "6e56e1ad0e43e2da5ef935a5"
          }
        ],
        "headers": {
          "key": "string"
        },
        "raw": "string",
        "date": "2026-10-02T09:00:00.000Z",
        "unread": true,
        "starred": true,
        "metadata": {
          "key": "string"
        }
      }
    ]
  }
}
```
