---
title: "Update a file"
method: PATCH
path: "/v2/files/{file_id}"
tags: ["Files"]
---

# Update a file

`PATCH /v2/files/{file_id}`

Updates the metadata of an existing file object.

## Path parameters

- `file_id` string, required

## Request body

- UpdateFileRequest
  - `file_name` string, required — New display file name, including extension when available.

## Response `200`

OK

- UpdateFileResponse
  - `file` File, required
    - `file_id` string, required — Unique file identifier assigned by ORQ.
    - `purpose` 'FILE_PURPOSE_UNSPECIFIED' | 'FILE_PURPOSE_RETRIEVAL' | 'FILE_PURPOSE_KNOWLEDGE_DATASOURCE' | 'FILE_PURPOSE_BATCH' | 'FILE_PURPOSE_CODE_INTERPRETER', required
    - `file_name` string, required — Display file name, including extension when available.
    - `bytes` string, required — Size of the uploaded file in bytes.
    - `created_at` string, date-time, required — Time when the file was created.
    - `project_id` string, required — Identifier of the project the file belongs to. Files are project-scoped; an API key may only access files in projects it is authorized for.

## Changes

> 253 revisions in range; 71 not diffed.

- **2026-07-17** `2f27caf6888c` — 1 warning
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
- **2026-07-16** `bee257c5b248` — 1 info
  - removed the `FILE_PURPOSE_CODE_INTERPRETER` enum value from the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
- **2026-07-16** `801f61a5a056` — 1 warning
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
- **2026-07-16** `42d5d2062527` — 1 info
  - removed the `FILE_PURPOSE_CODE_INTERPRETER` enum value from the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`
- **2026-07-10** `8ecb8a66eb1d` — 1 warning
  - added the new `FILE_PURPOSE_CODE_INTERPRETER` enum value to the `file/allOf[#/components/schemas/File]/purpose` response property for the response status `200`

[Full history](https://skmtc.dev/orq-ai/apis/orq-ai-api/changes/v2/files/:file_id/patch.md)

---

[API](https://skmtc.dev/orq-ai/apis/orq-ai-api.md) · [All operations](https://skmtc.dev/orq-ai/apis/orq-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/orq-ai/orq-ai-api/revisions/94a16765e3fe/schema)
