find_files. Fourteen methods here. API detail: Files.
upload
POST /v1/files, multipart/form-data — the one method in the client that does not send JSON. The file part carries the bytes; other parts are metadata:
title, description, tags (comma-separated) and folder are optional; the body is capped at 25 MiB. The stored file carries kind (derived from the content type), source: { type: "upload" } and, for an image, its width/height.
createUpload
POST /v1/files/uploads. A one-shot link for up to 60 MiB: PUT the bytes to upload_url within 15 minutes, with the same Content-Type and a Content-Length of exactly size_bytes. The PUT needs no key, so a browser can send the bytes straight to it. Its answer is the published file, with the id file_id already named.
import
POST /v1/files/imports. The API fetches a public http(s) URL server-side and stores it as a published file with source.type: "url_import". The client sends the Idempotency-Key for you, so a retried call replays the same file.
list
GET /v1/files. FileFilter extends the page query with:
get
GET /v1/files/{id} — the metadata object.
update
PATCH /v1/files/{id}. Library metadata only — title, description (each a string, or null to clear), tags (replaces the list) and folder (a name, or null to take the file out of its folder). The bytes, name, scope and provenance never change.
move
POST /v1/files/move. Puts up to 100 files (ids) in a folder, or moves every file in the folder from: a rename, or a merge when folder is already in use. folder: null takes the files out of any folder. Name ids or from, not both. The answer is { object: "file_move", folder, file_ids }, where folder is the spelling that won: a name that matches an existing folder in another case takes that folder’s spelling. No file is ever deleted.
folders
GET /v1/files/folders. Every folder, newest first, in one page. Each has name, file_count, newest_at, cover_file_ids (up to four of its newest pictures and clips) and agent_id (the one agent that made every file in it, else null). Read a folder’s files with list({ folder }). See Folders.
order
GET /v1/files/order. A folder’s chosen order, first to last: { object: "file_order", folder, entries }. A file is its id; a folder inside it is / and its name. null is the top of Files. entries is [] when no one has chosen one. See A folder’s order.
setOrder
PUT /v1/files/order. Replaces a folder’s order, up to 500 places. A file or folder it does not name comes after, in the default order.
download
GET /v1/files/{id}?download=true — the file decoded as UTF-8 text, through the API. A download is authorized by the same key as every other read; for an address that needs no key, mint one with url. For text only: an image, audio or video file comes back mangled, so use downloadBytes.
downloadBytes
url
POST /v1/files/{id}/url. An address for the file that needs no key, good for seven days: what an <img> or <video> tag can open. Any file can have one, scratch or published, and a key with files:read can mint it. Anyone holding the link can read the file until expires_at, so share it like a password.
publish
POST /v1/files/{id}/publish. The promotion boundary: session scratch becomes a durable org artifact. Idempotent — publishing twice is fine.
plan
POST /v1/files/{id}/plan. Puts a doc’s day-by-day plan to work: each day’s step becomes a card on the CEO’s board, and each weekly or weekday step becomes a timer on its day. Idempotent.
delete
DELETE /v1/files/{id}.
deleteMany
POST /v1/files/delete. Deletes up to 100 files in one request. An id the organization does not hold is skipped. The answer is { object: "file_delete", file_ids }, the ids that were deleted.