---
title: "Move or rename a file"
method: POST
path: "/api/storage/{project_id}/move"
tags: ["Storage"]
---

# Move or rename a file

`POST /api/storage/{project_id}/move`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/storage/{project_id}/move`
- Auth: HTTP bearer

Moves a file from `fromPath` to `toPath` within the same project bucket.
The operation is implemented as a copy followed by a delete of the original.
Can also be used to rename a file by specifying a new name in the same folder.

Compatible with the Supabase Storage `move` API.

**Server only**: requires the project's secret key (or service token). End-user
tokens and publishable keys get 403 — moving deletes the original.

## Path parameters

- `project_id` string, required

## Request body

- object
  - `fromPath` string, required: Current file path relative to the project bucket root
  - `toPath` string, required: New file path relative to the project bucket root

## Response `200`

File moved successfully

- object
  - `data` object
    - `message` string
  - `error` unknown

## Other responses

- `400`: Missing fromPath or toPath
- `401`: Authentication required or invalid API key
- `403`: Caller is not the project's server (code STORAGE_SERVER_ONLY)
- `404`: Source file not found
- `409`: A file already exists at the destination path
- `500`: Storage error

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
