Delete an application file
Delete a single file from an application by path with DELETE /v2/apps/:app_id/files. It takes effect at once, without restarting or redeploying the app.
DELETE
Delete an application file
The API key for your account. You can find this in your account settings.
files:write scope.
Delete File removes a single file from a running application by path, without touching the rest of the file tree or restarting the process. Use it for cleaning up generated files, old logs, or stray uploads without redeploying.
The deletion happens directly on the application’s storage on the cluster node, so it takes effect immediately; there is no undo short of restoring from a prior snapshot. To remove a whole application instead of one file, see Delete Application. To rename or move a file instead of deleting it, use Move File.
On workspace-shared applications the caller needs the maintain or admin role. Members without the restricted-files permission cannot delete the restricted files (every .env file, such as .env.local, and the configuration file), the request is rejected with PERMISSION_DENIED first.
Parameters
The ID of the application. You can find this in the URL of your application’s dashboard.
Response
Common errors
Related
- CLI:
squarecloud app file delete - SDKs:
api.apps.files.delete()(JavaScript),client.apps.files.delete()(Python),c.Apps.Files.Delete()(Go)

