Skip to main content
PUT
Create/Modify File
string
required
The API key for your account. You can find this in your account settings.
Create/Modify File writes content to path inside a running application, creating the file if it does not exist or overwriting it if it does. content accepts either a UTF-8 string for text files or a { type: "Buffer", data: number[] } byte array for binary content. Use it for small, targeted edits, such as tweaking a config value or dropping in a generated file, without re-uploading the whole application; for bulk changes or a .zip, use Commit Application instead. Writing to squarecloud.app or squarecloud.config is treated specially: the platform parses it as the application’s config (display name, description, memory, autorestart, subdomain) and validates each field, an invalid value returns a specific error code (for example INVALID_MEMORY or INVALID_SUBDOMAIN) instead of writing the file. These config rewrites are rate limited to 1 request every 15 seconds per user. On workspace-shared applications the caller needs the Maintainer or Administrator role, and members without the restricted-files permission are blocked from writing to excluded paths like .env. Like other file manager routes, this does not restart the application, call Restart Application to apply changes that need a fresh process.

Parameters

string
required
The ID of the application. You can find this in the URL of your application’s dashboard.
string
required
The path where the file should be created. Example: /test.txt
string
required
The content of the file to be created.

Response

string
Indicates whether the call was successful.. success if successful, error if not.

Common errors