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

# Attachments

> Retrieve transaction attachments (receipts, supporting documents) and download links.

<Warning>This service is not yet available in v3. Available in **v2** only.</Warning>

## What is the Attachments API?

The **Attachments API v2** allows you to retrieve files that have been uploaded and associated with Clara entities, such as transactions, invoices, or reimbursement requests.

Attachments may include receipts, invoices, approval files, or any supporting documentation. With this API, you can:

* List all uploaded files
* Retrieve metadata for a specific attachment
* Download the attachment as a base64-encoded file

<br />

## Available Endpoints

| Operation                       | Endpoint                        | Method |
| ------------------------------- | ------------------------------- | ------ |
| Get a list of attachments       | `/v2/attachments`               | GET    |
| Get attachment metadata by UUID | `/v2/attachments/{uuid}`        | GET    |
| Get attachment file as base64   | `/v2/attachments/{uuid}/base64` | GET    |

<br />

## Get a list of attachments

**Use this endpoint to list all attachments** available to your company. You can optionally filter by entity type or related ID.

### Endpoint

`GET /v2/attachments`

### cURL Request

```curl cURL theme={null}
curl -X GET \
"https://public-api.mx.clara.com/api/v2/attachments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

### Sample JSON Response

```json JSON theme={null}
[
  {
    "uuid": "attachment-001",
    "fileName": "receipt_q2.jpg",
    "entityUuid": "txn-123",
    "entityType": "TRANSACTION",
    "mimeType": "image/jpeg",
    "createdAt": "2025-06-10T18:22:00Z"
  }
]

```

<br />

## Get Single Attachment information with the pre signed URL

Use this to retrieve detailed metadata for a specific attachment by its UUID. This includes file name, type, entity association, and creation date.

### Endpoint

`GET /v2/attachments/{uuid}`

### cURL Request

```curl cURL theme={null}
curl -X GET \
"https://public-api.mx.clara.com/api/v2/attachments/attachment-001" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

<br />

## Get Attachment File as Base64

Use this endpoint to download the file in base64 format, allowing you to render or store the file securely in your system

### Endpoint

`GET /v2/attachments/{uuid}/base64`

### cURL Request

```curl cURL theme={null}
curl -X GET \
"https://public-api.mx.clara.com/api/v2/attachments/attachment-001/base64" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

### Sample JSON Response

```json JSON theme={null}
{
  "fileName": "receipt_q2.jpg",
  "mimeType": "image/jpeg",
  "base64": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
```

<br />

**💡 Tip:** You can use the base64 content to display the file inline in web or mobile apps, or decode and store it in your system.

\*\*⚠️ Note: \*\*Attachments can be large. Avoid retrieving large batches unless necessary. Use pagination and lazy-loading in UIs where possible.

***

## Endpoint Reference

### `GET /api/v2/attachments`

Get a list of attachments and it's respective transactions

### `GET /api/v2/attachments/{uuid}`

Get a single attachment information with the pre signed URL

**Parameters:**

| Parameter | In   | Type   | Required | Description            |
| --------- | ---- | ------ | -------- | ---------------------- |
| `uuid`    | path | string | ✅        | UUID of the attachment |

### `GET /api/v2/attachments/{uuid}/base64`

Get a single attachment in base 64

**Parameters:**

| Parameter | In   | Type   | Required | Description            |
| --------- | ---- | ------ | -------- | ---------------------- |
| `uuid`    | path | string | ✅        | UUID of the attachment |
