๐ 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
๐ 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 |
1๏ธโฃ 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 -X GET \
"https://public-api.mx.clara.com/api/v2/attachments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
๐ฅ Sample JSON Response
[
{
"uuid": "attachment-001",
"fileName": "receipt_q2.jpg",
"entityUuid": "txn-123",
"entityType": "TRANSACTION",
"mimeType": "image/jpeg",
"createdAt": "2025-06-10T18:22:00Z"
}
]
2๏ธโฃ 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 -X GET \
"https://public-api.mx.clara.com/api/v2/attachments/attachment-001" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
3๏ธโฃ 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 -X GET \
"https://public-api.mx.clara.com/api/v2/attachments/attachment-001/base64" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
๐ฅ Sample JSON Response
{
"fileName": "receipt_q2.jpg",
"mimeType": "image/jpeg",
"base64": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
๐ก 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.