Upload and manage files in Documents
Upload, list, rename, move and delete files in Documents (the Folders view).
Before you start
- Needs an API key - see API keys.
- Listing: any role. Uploading, renaming, moving and deleting: Editor or Admin (viewers can't delete through the API).
export BASE="https://api.expiryedge.com/v1"
export TOKEN="ee_live_..."Step 1: Find the folder id
curl -s "$BASE/getAllFolders" -H "Authorization: Bearer $TOKEN"{ "success": true, "folders": [ { "id": "fld_Ins2026", "name": "Insurance 2026", "children": [] } ] }For the top level, use root or leave folderId out.
Step 2: Upload a file
Same 3-step flow as Attach files to an expiry. Max 50 MB; the link works for 15 minutes.
2a. Ask for an upload link (size in bytes):
curl -s -X POST "$BASE/getFolderFileUploadUrl" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"folderId":"fld_Ins2026","file_name":"Liability Certificate 2026.pdf","content_type":"application/pdf","size":184022}'
# -> { "upload_id": "pUp7x1", "upload_url": "https://storage.googleapis.com/...", "headers": {...}, ... }2b. PUT the file with exactly the returned headers:
curl -s -X PUT "<upload_url>" \
-H "Content-Type: application/pdf" -H "x-goog-content-length-range: 0,184022" \
--data-binary @"Liability Certificate 2026.pdf"2c. Confirm:
curl -s -X POST "$BASE/completeFolderFileUpload" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"upload_id":"pUp7x1"}'{ "file": { "id": "ff_7Qm2xKp", "name": "Liability Certificate 2026.pdf", "folder_id": "fld_Ins2026", "uploaded_by_name": "Dana Whitfield", ... } }The app shows your profile name as "Owner". To show something else, add "uploaded_by_name":"Broker inbox" in 2c.
For a script, use the expiry attachment script with getFolderFileUploadUrl (send folderId instead of expiryId) and completeFolderFileUpload.
Step 3: List the files in a folder
curl -s "$BASE/getFolderFiles?folderId=fld_Ins2026" -H "Authorization: Bearer $TOKEN"Newest first. Omit folderId (or use root) for top-level files. Returns 100 by default; limit up to 500.
Step 4: Rename a file
curl -s -X POST "$BASE/renameFolderFile" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"fileId":"ff_7Qm2xKp","name":"Northwind - Liability Certificate 2026.pdf"}'Names are 1-255 characters. The download link doesn't change.
Step 5: Move a file to another folder
curl -s -X POST "$BASE/moveFolderFile" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"fileId":"ff_7Qm2xKp","folderId":"fld_Archive2025"}'Use "folderId": null or "root" for the top level.
Step 6: Delete a file
curl -s -X POST "$BASE/deleteFolderFile" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"fileId":"ff_7Qm2xKp"}'Permanent. Frees the storage.
Common problems
| Symptom | Fix |
|---|---|
403 FORBIDDEN | You're a viewer. Use an Editor key. |
404 Folder not found / File not found | Wrong or deleted ID, or another organization. List again. |
409 CONFLICT | Upload already completed - the file is in the folder. |
Upload errors (413, 410, 422, storage 403) | See upload problems. |
Reference
Full details: openapi.yaml.
GET getFolderFiles- list files, newest first.POST getFolderFileUploadUrl- start an upload.POST completeFolderFileUpload- finish an upload.POST renameFolderFile- rename.POST moveFolderFile- move.POSTorDELETE deleteFolderFile- delete and free storage.
