---
title: "Create or update an access level."
method: PUT
path: "/v1/libraries/{library_id}/share"
tags: ["beta.libraries.accesses"]
---

# Create or update an access level.

`PUT /v1/libraries/{library_id}/share`

Given a library id, you can create or update the access level of an entity. You have to be owner of the library to share a library. An owner cannot change their own role. A library cannot be shared outside of the organization.

## Path parameters

- `library_id` string, uuid, required

## Request body

- SharingRequest
  - `org_id` string, uuid, nullable
  - `level` 'Viewer' | 'Editor', required
  - `share_with_uuid` string, uuid, required — The id of the entity (user, workspace or organization) to share with
  - `share_with_type` 'User' | 'Workspace' | 'Org', required — The type of entity, used to share a library.

## Response `200`

Successful Response

- Sharing
  - `library_id` string, uuid, required
  - `user_id` string, uuid, nullable
  - `org_id` string, uuid, required
  - `role` string, required
  - `share_with_type` string, required
  - `share_with_uuid` string, uuid, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mistral/apis/mistral-ai-api.md) · [All operations](https://skmtc.net/mistral/apis/mistral-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mistral/mistral-ai-api/revisions/933c4ebdcd72/schema)
