Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Beta Libraries Endpoints

(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.

List all libraries you have access to.

GET /v1/libraries

List all libraries that you have created or have been shared with you.

200

Successful Response

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.libraries.list();

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.libraries.list()

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/libraries \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "data": [
    {
      "chunk_size": null,
      "created_at": "2025-10-07T20:56:01.974Z",
      "id": "ipsum eiusmod",
      "name": "consequat do",
      "nb_documents": 87,
      "owner_id": "reprehenderit ut dolore",
      "owner_type": "occaecat dolor sit",
      "total_size": 14,
      "updated_at": "2025-10-07T20:56:01.974Z"
    }
  ]
}

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.

201

Successful Response

chunk_size
*integer|null
created_at
*date-time
description
string|null
emoji
string|null
explicit_user_members_count
integer|null
explicit_workspace_members_count
integer|null
generated_description
string|null
generated_name
string|null
id
*string
name
*string
nb_documents
*integer
org_sharing_role
string|null
owner_id
*string
owner_type
*string
total_size
*integer
updated_at
*date-time

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.libraries.create({
    name: "<value>",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.libraries.create(name="<value>")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/libraries \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -d '{
  "name": "ipsum eiusmod"
}'

201

{
  "chunk_size": null,
  "created_at": "2025-10-07T20:56:01.974Z",
  "id": "ipsum eiusmod",
  "name": "consequat do",
  "nb_documents": 87,
  "owner_id": "reprehenderit ut dolore",
  "owner_type": "occaecat dolor sit",
  "total_size": 14,
  "updated_at": "2025-10-07T20:56:01.974Z"
}

Detailed information about a specific Library.

GET /v1/libraries/{library_id}

Given a library id, details information about that Library.

200

Successful Response

chunk_size
*integer|null
created_at
*date-time
description
string|null
emoji
string|null
explicit_user_members_count
integer|null
explicit_workspace_members_count
integer|null
generated_description
string|null
generated_name
string|null
id
*string
name
*string
nb_documents
*integer
org_sharing_role
string|null
owner_id
*string
owner_type
*string
total_size
*integer
updated_at
*date-time

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.libraries.get({
    libraryId: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.libraries.get(library_id="d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/libraries/{library_id} \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "chunk_size": null,
  "created_at": "2025-10-07T20:56:01.974Z",
  "id": "ipsum eiusmod",
  "name": "consequat do",
  "nb_documents": 87,
  "owner_id": "reprehenderit ut dolore",
  "owner_type": "occaecat dolor sit",
  "total_size": 14,
  "updated_at": "2025-10-07T20:56:01.974Z"
}

Update a library.

PUT /v1/libraries/{library_id}

Given a library id, you can update the name and description.

200

Successful Response

chunk_size
*integer|null
created_at
*date-time
description
string|null
emoji
string|null
explicit_user_members_count
integer|null
explicit_workspace_members_count
integer|null
generated_description
string|null
generated_name
string|null
id
*string
name
*string
nb_documents
*integer
org_sharing_role
string|null
owner_id
*string
owner_type
*string
total_size
*integer
updated_at
*date-time

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.libraries.update({
    libraryId: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4",
    libraryInUpdate: {},
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.libraries.update(library_id="e01880c3-d0b5-4a29-8b1b-abdb8ce917e4")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/libraries/{library_id} \
 -X PUT \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -d '{}'

200

{
  "chunk_size": null,
  "created_at": "2025-10-07T20:56:01.974Z",
  "id": "ipsum eiusmod",
  "name": "consequat do",
  "nb_documents": 87,
  "owner_id": "reprehenderit ut dolore",
  "owner_type": "occaecat dolor sit",
  "total_size": 14,
  "updated_at": "2025-10-07T20:56:01.974Z"
}

Delete a library and all of it's document.

DELETE /v1/libraries/{library_id}

Given a library id, deletes it together with all documents that have been uploaded to that library.

200

Successful Response

chunk_size
*integer|null
created_at
*date-time
description
string|null
emoji
string|null
explicit_user_members_count
integer|null
explicit_workspace_members_count
integer|null
generated_description
string|null
generated_name
string|null
id
*string
name
*string
nb_documents
*integer
org_sharing_role
string|null
owner_id
*string
owner_type
*string
total_size
*integer
updated_at
*date-time

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.beta.libraries.delete({
    libraryId: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.libraries.delete(library_id="6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/libraries/{library_id} \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "chunk_size": null,
  "created_at": "2025-10-07T20:56:01.974Z",
  "id": "ipsum eiusmod",
  "name": "consequat do",
  "nb_documents": 87,
  "owner_id": "reprehenderit ut dolore",
  "owner_type": "occaecat dolor sit",
  "total_size": 14,
  "updated_at": "2025-10-07T20:56:01.974Z"
}