---
title: "Move skill file"
method: POST
path: "/skills/{skill_id}/files/move"
tags: ["Skill Files"]
---

# Move skill file

`POST /skills/{skill_id}/files/move`

## Request

- Base URL: `https://api.metorial.com`
- URL: `https://api.metorial.com/skills/{skill_id}/files/move`
- Auth: HTTP bearer

Moves or renames a file. The root SKILL.md cannot be moved.

## Path parameters

- `skill_id` string, required

## Headers

- `Metorial-Version` string

## Request body

- BodyRequest74
  - `path` string, required: Path of the file inside the skill. A leading "/" is optional. Paths may contain letters, numbers, spaces and the characters . _ - ( ) $.
  - `to_path` string, required: The new path of the file.
  - `if_match` string: Only apply the change if the file still has this etag. Omit to skip the check.

## Response `200`

Successful response

- SkillFileChange
  - `object` 'skill.file_change', required: String representing the object's type
  - `type` 'put' | 'delete' | 'move', required: The kind of change that was applied.
  - `path` string, required: The resulting path of the file. For moves, this is the new path.
  - `previous_path` string, nullable, required: The path the file was moved from. Only set for moves.
  - `file` object, nullable, required
    - `object` 'skill.file', required: String representing the object's type
    - `path` string, required: Path of the file inside the skill, always starting with "/".
    - `kind` 'document' | 'file', required: Markdown written with `content` is stored as a collaboratively editable document; everything else, including attached files, is stored as a file.
    - `size` number, required: Size of the file content in bytes.
    - `etag` string, required: Opaque version identifier of the file content. Pass it as `if_match` when writing to avoid overwriting changes made by others. The check is best-effort: a live collaborative edit landing between the check and the write is not detected. Listings do not flush pending live edits, so a listed etag can lag behind the one returned when fetching the file.
    - `skill_id` string, required: The ID of the skill the file belongs to.
    - `store_item_id` string, required: The ID of the store item backing this file.
    - `document_id` string, nullable, required: The ID of the backing document, for files of kind `document`.
    - `file_id` string, nullable, required: The ID of the backing file, for files of kind `file`.
    - `updated_at` string, date-time, required: When the file was last changed.

## Other responses

- `400`: Invalid parameters or action
- `401`: Missing or invalid API key
- `403`: The key lacks permission for this resource
- `404`: No such resource
- `422`: Validation failed
- `429`: Rate limit exceeded
- `500`: Unexpected server error

---

[API](https://skmtc.dev/metorial/apis/metorial-api.md) - [All operations](https://skmtc.dev/metorial/apis/metorial-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metorial/apis/metorial-api/revisions/10ccc89f3eac?raw)
