---
title: "Rename a file"
method: PATCH
path: "/resources/files/{id}"
tags: ["Files"]
---

# Rename a file

`PATCH /resources/files/{id}`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/resources/files/{id}`
- Auth: HTTP bearer

Sets the file's title and/or subtitle. Fields you omit keep their current value.

## Path parameters

- `id` string, required

## Request body

- ResourceFileUpdateRequest: At least one of `title` or `subtitle` is required.
  - `title` string: Trimmed and truncated to 200 characters.
  - `subtitle` string: Trimmed and truncated to 300 characters.

## Response `200`

Updated title and subtitle

- ResourceFileUpdated
  - `id` string
  - `title` string, nullable
  - `subtitle` string, nullable

## Other responses

- `400`: Body is not valid JSON (`invalid_json`) or has neither `title` nor `subtitle` (`missing_fields`)
- `401`: Missing or invalid API key / JWT
- `404`: Unknown file (or not owned by the caller)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/resources/files/:id/patch.md)

---

[API](https://skmtc.dev/varg/apis/varg-api.md) · [All operations](https://skmtc.dev/varg/apis/varg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/varg/apis/varg-api/revisions/09d49a6d852f?raw)
