Read a file from an application
Changed onReturns the file at the given path (at most 10 MB). Send ?encoding=base64 to get { encoding: "base64", data }, the file as a base64 string.
Deprecated since 2026-09-27: without encoding, the file comes as a JSON byte array ({ type: "Buffer", data: number[] }, about 3.5x the file size) and the response carries Deprecation and Sunset headers. That shape will be removed on 2027-03-27, when base64 becomes the default; send ?encoding=base64 now.
Requires the workspace Maintainer or Administrator role (or ownership) when called against a workspace-shared application.
Request
- Base URLhttps://api.squarecloud.app
- AuthAPI key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Application identifier. Optionally suffixed with -<workspaceId> to act on a workspace-shared application.
Query parameters
Absolute path to the file inside the application.
base64 returns the file as a base64 string. Omitting it returns the deprecated byte array (removed on 2027-03-27, when base64 becomes the default).
Response
The file. With ?encoding=base64: { encoding: "base64", data }. Without it (deprecated): { type: "Buffer", data: number[] }.
Changes
- warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status
- warning
- warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status
- warning