api.apps.files. Every method takes the app id first, then a path inside the app. Paths are at most 256 characters.
Examples use the api client from Creating the client. appId is the id of one of your apps: api.account.me() lists them.
Listing a directory
files.list(appId, path?) lists a directory (the app root when path is omitted).
A directory that does not exist is 404
FILE_NOT_FOUND. A path the file manager does not expose is 403 BLOCKED_PATH.
Reading a file
files.read(appId, path) returns the file’s bytes as a Uint8Array. Files are limited to 10 MB: a larger one is 413 FILE_TOO_LARGE.
Writing a file
files.write(appId, path, content, { signal }) creates or overwrites a file.
- A
stringis sent as plain text. - A
Uint8Arrayis sent as base64, so any binary content round-trips. - Empty content (
""or empty bytes) creates an empty file.
FILE_TOO_LARGE (status 0) before anything is sent. Content over 1 MiB is sent without a timeout, like an upload: pass { signal } to cancel it. For larger files, use apps.commit().
Writing does not restart the app. Call
apps.restart() to apply the change.Moving or renaming a file
Deleting a file
Errors
See Errors for the codes every call can return.
Next steps
Environment variables
Read and change the variables of an app.
File manager API reference
The REST endpoints behind these methods.
Manage files from the CLI
The same actions from the terminal.

