Remove a file or folder

Remove a file or folder

DELETE/v1/sandboxes/{sandbox_id}/files

A key with the files:write scope.

Request

curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/files?path=/root/hello.py" \
  -H "Authorization: Bearer $POD_API_KEY"

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes
pathquerystringYesAn absolute path inside the sandbox.
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.
recursivequerybooleanNoRemove a folder and everything in it.

Answer

204. Removed.

Errors

The refusals this call is known for: invalid, not_found, 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.remove(path)
Pythonsandbox.files.remove(path)
mpodmpod sandboxes files rm <sandbox> <path>