> ## 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 Approved Outputs

> Retrieve a paginated list of approved clinical outputs (letters) as an HL7 FHIR Bundle

Retrieve a paginated list of approved clinical outputs (letters) for the authenticated organisation. The response is an HL7 FHIR Bundle of Composition resources, each containing the letter content and an embedded PDF.

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

## Request

```
GET {{baseUrl}}/api/v1/third-parites/letters/
```

## Headers

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

## Query parameters

| Parameter       | Type    | Required | Default | Description                              |
| --------------- | ------- | -------- | ------- | ---------------------------------------- |
| Speciality ID   | string  | No       | —       | Filter outputs by speciality identifier. |
| Speciality Name | string  | No       | —       | Filter outputs by speciality name.       |
| Page Size       | integer | No       | `1`     | Number of outputs per page.              |
| Page Number     | integer | No       | `1`     | Page number for pagination.              |
| Sort Order      | string  | No       | `desc`  | Sort by creation date. `asc` or `desc`.  |

## Response

**Status:** `200 OK`

```json theme={null}
{
  "data": {
    "resourceType": "Bundle",
    "type": "collection",
    "entry": [
      {
        "resource": {
          "resourceType": "Composition",
          "id": "...",
          "status": "final",
          "subject": { "reference": "Patient/..." },
          "date": "2025-01-15T10:30:00Z",
          "section": [
            {
              "title": "...",
              "id": "<Output ID>/<Bundle ID>",
              "text": { "status": "generated", "div": "<div>...</div>" },
              "extension": [{ "...": "base64 PDF attachment" }]
            }
          ]
        }
      }
    ]
  },
  "status": "success",
  "meta": {
    "pagination": { "batch_size": 10, "page": 1 },
    "letters_count": 42
  }
}
```

## Error responses

| Status | Condition                                |
| ------ | ---------------------------------------- |
| `400`  | Invalid sort order (must be asc or desc) |
| `400`  | Speciality not found                     |
| `401`  | Invalid or missing authentication        |

## Next steps

<Columns cols={2}>
  <Card title="Mark Output Completed" icon="circle-check" href="/mark-output-completed">
    Acknowledge a letter so it no longer appears in the unread feed.
  </Card>

  <Card title="Get Attachments" icon="paperclip" href="/get-attachments">
    Retrieve attachments for an output.
  </Card>
</Columns>
