---
title: "Rename a file or directory."
method: POST
path: "/api/media/rename"
tags: ["Media"]
---

# Rename a file or directory.

`POST /api/media/rename`

## Request body

- RenameMediaRequest — Request to rename a file or directory.
  - `new_name` string, required — New name (just the filename, not full path)
  - `old_path` string, required — Current path (relative to media root)

## Response `200`

Rename successful

- MediaOperationResponse — Response for media operations.
  - `message` string, required — Human-readable message
  - `success` boolean, required — Whether the operation succeeded

## Other responses

- `400` — Invalid path or name
- `404` — File or directory not found

---

[API](https://skmtc.net/eyevinn/apis/strom-api.md) · [All operations](https://skmtc.net/eyevinn/apis/strom-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eyevinn/strom-api/versions/c96558b86012/schema)
