Move or rename a file or folder

Move or rename a file or folder

POST/v1/sandboxes/{sandbox_id}/files:move

A key with the files:write scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files:move" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"/root/hello.py","to":"/root/hello.py"}'

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes
Pod-End-UserheaderstringNoNarrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering not_found, and a create is labelled with it. An end user of another project, or one that is not there, is not_found; a suspended one refuses creates and wakes (account_restricted).
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
fromstringYes
tostringYes
overwritebooleanNoDefault false.

Answer

200. The file at its new path.

200
{
  "path": "example",
  "type": "file",
  "size_bytes": 0,
  "mode": "example",
  "modified_at": "2026-11-23T12:00:00.000Z"
}
FieldTypeAlwaysWhat it is
pathstringYes
type"file" | "directory" | "symlink" | "other"Yes
size_bytesintegerYesAt least 0.
modestringYes
modified_atstringYesRFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z.

Errors

The refusals this call is known for: invalid, not_found, conflict, not_ready, guest_unavailable, in_other_cell. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.

In the SDKs

ClientCall
TypeScriptsandbox.files.move(from, to)
Pythonsandbox.files.move(source, destination)
mpodmpod sandboxes files mv <sandbox> <from> <to>