> ## 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 Attachments

> Retrieve attachments for an output, or a single attachment by ID

Retrieve all attachments for a given output, or a single attachment by its identifier.

<Note>
  This endpoint requires a Bearer token. For credentials and access, contact the **medWrite team**.
</Note>

## Request

```
GET {{baseUrl}}/api/v1/outputs/{Output ID}/attachments/
GET {{baseUrl}}/api/v1/outputs/{Output ID}/attachments/{Attachment ID}/
```

## Headers

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

## Path parameters

| Parameter     | Type   | Required | Description                                                |
| ------------- | ------ | -------- | ---------------------------------------------------------- |
| Output ID     | string | Yes      | The unique identifier of the output.                       |
| Attachment ID | string | No       | The unique identifier of the attachment. Omit to list all. |

## Response

**Status:** `200 OK`

```json theme={null}
{
  "data": [
    {
      "id": "...",
      "file_url": "...",
      "file_name": "report.pdf",
      "file_type": "pdf",
      "size": 204800,
      "created_at": "2025-01-15T10:00:00.000000",
      "status": "active"
    }
  ],
  "status": "success"
}
```

When fetching a single attachment, `data` is an object instead of an array.

## Error responses

| Status | Condition                         |
| ------ | --------------------------------- |
| `401`  | Invalid or missing authentication |
| `404`  | Output or attachment not found    |

## Next steps

<Columns cols={2}>
  <Card title="Get PDF Document" icon="file-arrow-down" href="/get-pdf-document">
    Get the PDF for an output and bundle.
  </Card>

  <Card title="Get Approved Outputs" icon="file-check" href="/get-approved-outputs">
    Retrieve approved letters.
  </Card>
</Columns>
