Read an application file
Read one file of up to 10 MB from an application with GET /v2/apps//files/content. Send encoding=base64, since the Buffer format is deprecated.
GET
Read an application file
string
required
The API key for your account. You can find this in your account settings.
files:read scope.
Read File returns a single file inside a running application as JSON. Send ?encoding=base64 to get the file as a base64 string. It is meant for inspecting or downloading individual files (configs, logs, small assets) of up to 10 MB through the API, not for bulk transfers: use Create Snapshot to pull a full copy of the application instead.
To see what is available before reading, call List Files first. To write a file back, use Create/Modify File, which takes the same base64 content with encoding: "base64".
On workspace-shared applications the caller needs the maintain or admin role, and members without the restricted-files permission cannot read .env or .env.production, the request is rejected with PERMISSION_DENIED before the file is touched.
Parameters
string
required
The ID of the application. You can find this in the URL of your application’s dashboard.
string
required
The path to the file you want to read, relative to the root of your application. Up to 256 characters.
string
Send
base64 to receive the file as a base64 string. Any other value answers INVALID_ENCODING. Without it, the response uses the deprecated Buffer format.Response
string
Indicates whether the call was successful:
success if it was, error if not.object
The contents of the file.
data to get the file’s bytes:
Common errors
Related
- CLI:
squarecloud app file read - SDKs:
api.apps.files.read()(JavaScript),client.apps.files.read()(Python),c.Apps.Files.Read()(Go)

