---
title: "Update File"
method: PUT
path: "/studio/v1/library/files/{file_id}"
tags: ["Library management"]
---

# Update File

`PUT /studio/v1/library/files/{file_id}`

Update the specified parameters of a specific document in the user's library.
This operation currently supports updating the publicUrl and labels parameters.

> **This operation overwrites the specified items with the new data you provide.**
> If you wish to add new labels to the labels list without removing the existing ones,
> you must submit a labels list that includes both the current and new labels.**
>
> For instance, if the current labels are "Label A" and "Label B", and you wish to
> add "New Label C" and "New Label D" to the list, you must specify `"labels": ["Label A", "Label B", "New Label C", "New Label D"]`.

## Path parameters

- `file_id` string, uuid, required

## Request body

- FilesUpdateRequest
  - `publicUrl` string — The public URL of the file, if any. This URL is not validated by AI21 or used in any way. It is strictly a piece of metadata that you can optionally attach to a file.
  - `labels` string[] — Any labels to associate with this file. Separate multiple labels with commas. If provided, will overwrite all existing labels.

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

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