API ReferenceBuckets
Files
List and manage files within a bucket
List Files
GET
/api/v1/buckets/{bucketId}/filesReturns all files in a bucket with optional label filtering.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
bucketId | string | path | Yes | The bucket ID |
labels | string | query | No | Comma-separated list of labels to filter by |
Request
const res = await fetch(
"https://app.limai.io/api/v1/buckets/bkt_abc123/files?labels=invoice,receipt",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const files = await res.json();Response
Response200
[
{
"id": "file_001",
"name": "invoice_2025.pdf",
"labels": [
"invoice"
],
"sizeBytes": 245000,
"status": "UPLOADED",
"createdAt": "2025-01-15T10:30:00.000Z"
}
]Get File
GET
/api/v1/buckets/{bucketId}/files/{fileId}Returns detailed information about a specific file in a bucket.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
bucketId | string | path | Yes | The bucket ID |
fileId | string | path | Yes | The file ID |
Request
const res = await fetch(
"https://app.limai.io/api/v1/buckets/bkt_abc123/files/file_001",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const file = await res.json();Response
Response200
{
"id": "file_001",
"name": "invoice_2025.pdf",
"labels": [
"invoice"
],
"sizeBytes": 245000,
"status": "UPLOADED",
"contentHash": "sha256_abc123",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}Update File Labels
PATCH
/api/v1/buckets/{bucketId}/files/{fileId}Update the labels on a file. Replaces all existing labels.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
bucketId | string | path | Yes | The bucket ID |
fileId | string | path | Yes | The file ID |
labels | string[] | body | Yes | Array of label strings |
Request
const res = await fetch(
"https://app.limai.io/api/v1/buckets/bkt_abc123/files/file_001",
{
method: "PATCH",
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({ labels: ["invoice", "urgent"] }),
}
);Response
Response200
{
"id": "file_001",
"name": "invoice_2025.pdf",
"labels": [
"invoice",
"urgent"
],
"sizeBytes": 245000,
"status": "UPLOADED",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T12:00:00.000Z"
}Delete File
DELETE
/api/v1/buckets/{bucketId}/files/{fileId}Permanently deletes a file from a bucket.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
bucketId | string | path | Yes | The bucket ID |
fileId | string | path | Yes | The file ID |
Request
const res = await fetch(
"https://app.limai.io/api/v1/buckets/bkt_abc123/files/file_001",
{
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);Response
Response200
{
"success": true
}