---
title: "Update a library item"
method: PATCH
path: "/library-items/{id}"
tags: ["Library"]
---

# Update a library item

`PATCH /library-items/{id}`

Update a library item. Cannot replace an existing file with a url or vice versa. Cannot set both file and url.

## Path parameters

- `id` string, required

## Headers

- `X-Company-ID` string, required

## Request body

- PatchedLibraryItem — Mixin to delegate create, update, and destroy operations to a service class.
  - `id` string, uuid
  - `name` string
  - `url` string, uri, nullable
  - `file` string, uri, nullable
  - `folder_id` integer, nullable
  - `sharing_scheme` string
  - `shared_with` string[]
  - `created_by` integer
  - `company_id` string, uuid
  - `created_at` string, date-time

## Response `200`

- LibraryItem — Mixin to delegate create, update, and destroy operations to a service class.
  - `id` string, uuid, required
  - `name` string, required
  - `url` string, uri, nullable
  - `file` string, uri, nullable
  - `folder_id` integer, nullable
  - `sharing_scheme` string
  - `shared_with` string[]
  - `created_by` integer, required
  - `company_id` string, uuid, required
  - `created_at` string, date-time, required

## Other responses

- `400` — Bad request. Cannot set both file and url, or cannot replace file with url (or vice versa).
- `401` — Unauthorized
- `403` — Forbidden. Request was valid, but you do not have necessary permissions.
- `404` — Library item not found

---

[API](https://skmtc.net/cubesoftware/apis/cube-api.md) · [All operations](https://skmtc.net/cubesoftware/apis/cube-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cubesoftware/cube-api/revisions/67d9f45bb99b/schema)
