---
title: "Move or rename. Refuses to replace an existing path unless overwrite."
method: POST
path: "/v1/sandboxes/{id}/files:rename"
tags: ["files"]
---

# Move or rename. Refuses to replace an existing path unless overwrite.

`POST /v1/sandboxes/{id}/files:rename`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/sandboxes/{id}/files:rename`
- Auth: HTTP bearer

## Path parameters

- `id` string, required: Resource identifier (UUID).

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `from` string, required: Absolute path in the sandbox, e.g. /workspace/app/main.py. Any path the sandbox user may use.
  - `to` string, required: Absolute path in the sandbox, e.g. /workspace/app/main.py. Any path the sandbox user may use.
  - `overwrite` boolean

## Response `200`

Success

- object
  - `from` string, required
  - `to` string, required
  - `replayed` boolean

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/6f4012286988?raw)
