Skip to content

Powered by Grav + Helios

Rename Site Media

Rename Site Media

POST /media/rename
Rename or move a media file within the site-level media directory.
JSON
{
  "from": "blog/hero.jpg",
  "to": "blog/banner.jpg"
}

Response Codes

200 File renamed
401 Unauthorized
404 Source file not found
422 Validation error or destination already exists

Rename a file or move it to a different folder within user/media. Both from and to are relative paths. The destination directory is created automatically if needed. Any .meta.yaml sidecar file is also moved.