Move or rename an application file
Move or rename a file inside an application with PATCH /v2/apps//files, from path to to, without re-uploading it or restarting the app.
PATCH
Move or rename an application file
string
required
The API key for your account. You can find this in your account settings.
files:write scope.
Move File renames or relocates a single file inside an application’s storage, from path to to, without downloading and re-uploading its contents. Use it to reorganize a directory structure or rename a config file in place.
path and to must both pass path validation and must be different, sending the same value for both is rejected with INVALID_PATH. This only moves the file on the running application’s storage; it does not restart the process, so a running process reading the old path will not see the change until it reloads or the app is restarted. To delete a file instead of moving it, see Delete File.
On workspace-shared applications the caller needs the maintain or admin role. The restricted-files check applies to both the source and destination names, so a member without that permission cannot rename an allowed file into a protected name like .env to plant or overwrite it.
Parameters
string
required
The ID of the application. You can find this in the URL of your application’s dashboard.
string
required
The path of the file to move, up to 256 characters.
string
required
The path to move the file to, up to 256 characters.
Response
string
Indicates whether the call was successful:
success if it was, error if not.Common errors
Related
- CLI:
squarecloud app file move - SDKs:
api.apps.files.move()(JavaScript),client.apps.files.move()(Python),c.Apps.Files.Move()(Go)

