Files
Uploaded documents and images. A file id is what the expenses, products, purchase-scan and signature endpoints ask for.
Use cases: Upload a receipt before recording an expense, attach a product image, or pull a document's generated PDF back down.
POST
/files/uploadUpload a file.
`file.id` is the number every other endpoint's `fileId` refers to. `POST /files/upload-stream` is the same thing for large files, streamed rather than buffered.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
file | file | required | The file itself. This endpoint takes `multipart/form-data`, not JSON — missing, it answers FILE_NOT_PROVIDED. |
path | string | Folder path to file it under. | |
description | string | Free-text description. | |
visibility | string | "PRIVATE" (only the uploader), "COMPANY_WIDE" or "EVERYONE_WITH_LINK". |
Request
curl -X POST "https://api.glance.co.il/files/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": "example_file",
"path": "example_path",
"description": "example_description",
"visibility": "example_visibility"
}'Response
Response
{
"success": true,
"file": {
"id": 90101,
"visibleId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4a5b",
"name": "receipt.pdf",
"remoteUrl": "https://files.glance.co.il/90101.pdf",
"path": "/receipts",
"type": "pdf",
"size": 184322,
"description": null,
"preview": "https://files.glance.co.il/90101-preview.png",
"visibility": "COMPANY_WIDE"
}
}GET
/filesList files.
**Not paginated** — every matching file comes back, and there is no filtering by what the file is attached to. You see your own private files plus everything shared company-wide.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
search | string | Free-text search across name and description. | |
visibility | string | "PRIVATE", "COMPANY_WIDE" or "EVERYONE_WITH_LINK". | |
isArchived | boolean | "true" to list archived files instead of live ones. |
Request
curl -X GET "https://api.glance.co.il/files" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true,
"files": [
{
"id": 90101,
"visibleId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4a5b",
"name": "receipt.pdf",
"remoteUrl": "https://files.glance.co.il/90101.pdf",
"path": "/receipts",
"type": "pdf",
"size": 184322,
"description": null,
"preview": null,
"visibility": "COMPANY_WIDE",
"creationDate": "2026-03-15T11:00:00.000Z",
"isArchived": false,
"archivedDate": null,
"userId": 12
}
]
}GET
/files/file/:visibleIdDownload a file's contents.
This returns the bytes, not JSON: the response carries the file's own `Content-Type` and a `Content-Disposition` naming it. A PRIVATE file belonging to someone else answers ACCESS_DENIED; an unknown id answers FILE_NOT_FOUND. To get the metadata instead, read the row from `GET /files`.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | string | required | The file's `visibleId` — not its numeric id. |
Request
curl -X GET "https://api.glance.co.il/files/file/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
(binary — the file itself, with its own Content-Type)DELETE
/files/:idDelete a file.
A file an expense still points at cannot be deleted — that answers FILE_REFERENCED_BY_EXPENSES. Archive it instead with `PATCH /files/archive/:id`.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The file's numeric id. |
Request
curl -X DELETE "https://api.glance.co.il/files/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true,
"message": "File deleted successfully"
}PATCH
/files/metadata/:idEdit a file's name or description.
Three siblings do the rest: `PATCH /files/archive/:id` archives or restores, `PATCH /files/move/:id` moves it to another folder, and `PATCH /files/share/:id` changes its visibility.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The file's numeric id. |
Request
curl -X PATCH "https://api.glance.co.il/files/metadata/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true
}GET
/files/usage/:idWhat a file is attached to, before you delete it.
`GET /files/storage-info` reports how much space is used, as `{ userUploadedBytes, totalBytes }`.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The file's numeric id. |
Request
curl -X GET "https://api.glance.co.il/files/usage/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true,
"usage": {
"entities": [],
"products": [
{
"id": 4102,
"name": "Widget Pro"
}
],
"documents": [],
"totalAttachments": 1
}
}