---
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.

---

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