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

# Get PDF Document

> Retrieve the PDF for a specific output and bundle (file or base64)

Retrieve the generated PDF document for a specific output and bundle. The PDF can be returned as a raw file download or as a base64-encoded string in JSON.

<Note>
  All endpoints require authentication. For credentials and access, contact the **medWrite team**.
</Note>

## Request

```
GET {{baseUrl}}/api/v1/third-parites/letters/{Output ID}/{Bundle ID}/pdf/
```

## Headers

| Header       | Type   | Required | Description                                  |
| ------------ | ------ | -------- | -------------------------------------------- |
| Bearer Token | string | Yes      | Authentication token. Contact medWrite team. |
| API Key      | string | Yes      | Service API key. Contact medWrite team.      |

## Path parameters

| Parameter | Type   | Required | Description                          |
| --------- | ------ | -------- | ------------------------------------ |
| Output ID | string | Yes      | The unique identifier of the output. |
| Bundle ID | string | Yes      | The unique identifier of the bundle. |

## Query parameters

| Parameter      | Type   | Required | Default | Description                                                       |
| -------------- | ------ | -------- | ------- | ----------------------------------------------------------------- |
| Return as File | string | No       | —       | Set to `true` to download the raw PDF file. Omit for base64 JSON. |

## Response (file download)

**Status:** `200 OK` — Returns a binary PDF file.

```
Content-Type: application/pdf
Content-Disposition: attachment; filename="<filename>.pdf"
```

## Response (base64)

**Status:** `200 OK`

```json theme={null}
{
  "data": "<base64_encoded_pdf>",
  "status": "success"
}
```

## Error responses

| Status | Condition                         |
| ------ | --------------------------------- |
| `400`  | Missing Output ID or Bundle ID    |
| `401`  | Invalid or missing authentication |
| `404`  | Output not found                  |

## Next steps

<Columns cols={2}>
  <Card title="Get Approved Outputs" icon="file-check" href="/get-approved-outputs">
    Retrieve approved letters (includes bundle IDs).
  </Card>

  <Card title="Mark Output Completed" icon="circle-check" href="/mark-output-completed">
    Acknowledge a letter after processing.
  </Card>
</Columns>
