---
title: "Create a new Library."
method: POST
path: "/v1/libraries"
tags: ["beta.libraries"]
---

# Create a new Library.

`POST /v1/libraries`

Create a new Library, you will be marked as the owner and only you will have the possibility to share it with others. When first created this will only be accessible by you.

## Request body

- CreateLibraryRequest
  - `name` string, required
  - `description` string, nullable
  - `chunk_size` integer, nullable — The size of the chunks (in characters) to split document text into. Must be between 256 and 32768.
  - `owner_type` 'User' | 'Workspace', nullable — Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries.

## Response `201`

Successful Response

- Library
  - `id` string, uuid, required
  - `name` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `owner_id` string, uuid, nullable, required
  - `owner_type` string, required
  - `total_size` integer, required
  - `nb_documents` integer, required
  - `chunk_size` integer, nullable, required
  - `emoji` string, nullable
  - `description` string, nullable
  - `generated_description` string, nullable
  - `explicit_user_members_count` integer, nullable
  - `explicit_workspace_members_count` integer, nullable
  - `org_sharing_role` string, nullable
  - `generated_name` string, nullable — Generated Name

## 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/versions/933c4ebdcd72/schema)
