GuidesWorking with the API
Files (KeepAnything)
KeepAnything stores your company’s files. The API reads and changes Company files: folders, files and their versions, sharing, links and file requests.
Live keys only, and a plan with files
KeepAnything has no test mode: a test key gets 403 test_mode_not_supported. The file endpoints also need a plan that includes them (402 feature_not_included). Keys act for the user who made them, with that user’s access to each folder.
Folders and files
Folder and file ids are UUIDs. company stands for the top of Company files wherever a folder id goes.
GET /v1/folders/company/childrenlists a folder’s folders and files: up to 100 at a time (limitup to 500), withnext_cursorwhilehas_more.POST /v1/folderscreates a folder;PATCH /v1/folders/{id}andPATCH /v1/files/{id}rename or move;DELETEmoves to Trash andPOST /v1/files/{id}/restorebrings a file back.GET /v1/files/{id}/contentredirects to a storage URL that works for 5 minutes (and takesRange). Add?version=for an older version;GET /v1/files/{id}/versionslists them andPOST /v1/files/{id}/versions/{vid}/restoremakes one current again.- New files are virus-checked first: until then content answers
409 scan_pending, and a blocked file451 file_blocked. GET /v1/search?q=finds files by name, and by contents when your plan and company settings allow it.
# Follow the redirect to the file's bytes curl -L -o lease.pdf https://api.skanything.io/v1/files/7d3f1c9a-2b6e-4a8d-9c0f-5e1b3d7a9c2e/content \ -H "Authorization: Bearer $SA_LIVE_KEY"
To add files, see Uploads. To keep a copy in step with Company files, use the change feed.
Sharing, links and file requests
- Grants (
/v1/grants) give a person, a group or the whole companyview,contributeormanageaccess to a folder or file. Sharing outside the company depends on your plan and company settings. - Links (
/v1/links) make a shared link to a file or folder, with an audience, an expiry and, on plans that have it, a password. The link’surlis returned only when you create it. - File requests (
/v1/file_requests) ask people to upload into a folder; theurlis returned only when you create it.
Reading them needs files:read; creating, changing and removing them needs sharing:write. File, folder and sharing changes also arrive as webhooks.