Storage
Move an existing file
Move (rename) an object inside the same bucket.
Rename or move an object from from_path to to_path inside the same bucket. Cross-bucket moves are not supported by this endpoint — copy then remove if you need that.
Signature
supabase.storage.from(bucket_id).move(from_path, to_path)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from_path | String | Required | Current object path within the bucket. Sent as sourceKey. |
to_path | String | Required | New object path within the same bucket. Sent as destinationKey. |
Returns
Returns
Hash
Raw response body from storage-api, typically { "message" => "Successfully moved" }. Not wrapped in a Struct.
Example — rename within a folder
supabase.storage.from("avatars").move(
"people/ada.png",
"people/ada-lovelace.png"
)Example — move into a subfolder
supabase.storage.from("invoices").move(
"INV-0001.pdf",
"2026/Q2/INV-0001.pdf"
)Sends { bucketId, sourceKey, destinationKey } to POST /object/move. Same-bucket-only — does NOT silently fall back to copy + remove if you pass a path with a different bucket prefix.