Deprecated: offset pagination metadata. Only populated for callers using the deprecated page parameter; omitted when page_token is used. While RBAC filtering is being rolled out total_items is a rough estimate (candidate count before per-library checks). Use next_page_token instead — this field will be removed once offset paging is retired.













Beta Libraries Documents Endpoints
(beta) Libraries API - manage documents in a library.












Examples
Real world code examples
List documents in a given library.
GET /v1/libraries/{library_id}/documents#
Given a library, lists the document that have been uploaded to that library.
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.documents.list({
libraryId: "5c3ca4cd-62bc-4c71-ad8a-1531ae80d078",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.list({
libraryId: "5c3ca4cd-62bc-4c71-ad8a-1531ae80d078",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.list(library_id="5c3ca4cd-62bc-4c71-ad8a-1531ae80d078", page_size=100, page=0, sort_by="created_at", sort_order="desc")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.list(library_id="5c3ca4cd-62bc-4c71-ad8a-1531ae80d078", page_size=100, page=0, sort_by="created_at", sort_order="desc")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id}/documents \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"data": [
{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}
],
"pagination": null
}{
"data": [
{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}
],
"pagination": null
}Upload a new document.
POST /v1/libraries/{library_id}/documents#
Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search
The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such:
file=@path/to/your/file.jsonl;filename=custom_name.jsonlfile=@path/to/your/file.jsonl;filename=custom_name.jsonlOtherwise, you can just keep the original file name:
file=@path/to/your/file.jsonlfile=@path/to/your/file.jsonl200
A document with the same hash was found in this library. Returns the existing document.
attributes#
expires_at#
If set, the document will be automatically deleted after this date.
last_processed_at#
number_of_pages#
process_status#
summary#
tokens_processing_main_content#
tokens_processing_summary#
url#
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
import { openAsBlob } from "node:fs";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.upload({
libraryId: "a02150d9-5ee0-4877-b62c-28b1fcdf3b76",
requestBody: {
file: await openAsBlob("example.file"),
},
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
import { openAsBlob } from "node:fs";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.upload({
libraryId: "a02150d9-5ee0-4877-b62c-28b1fcdf3b76",
requestBody: {
file: await openAsBlob("example.file"),
},
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.upload(library_id="a02150d9-5ee0-4877-b62c-28b1fcdf3b76", file={
"file_name": "example.file",
"content": open("example.file", "rb"),
})
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.upload(library_id="a02150d9-5ee0-4877-b62c-28b1fcdf3b76", file={
"file_name": "example.file",
"content": open("example.file", "rb"),
})
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"file": {
"content": "ipsum eiusmod",
"fileName": "consequat do"
}
}'curl https://api.mistral.ai/v1/libraries/{library_id}/documents \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"file": {
"content": "ipsum eiusmod",
"fileName": "consequat do"
}
}'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}Retrieve the metadata of a specific document.
GET /v1/libraries/{library_id}/documents/{document_id}#
Given a library and a document in this library, you can retrieve the metadata of that document.
200
Successful Response
attributes#
expires_at#
If set, the document will be automatically deleted after this date.
last_processed_at#
number_of_pages#
process_status#
summary#
tokens_processing_main_content#
tokens_processing_summary#
url#
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.documents.get({
libraryId: "03d908c8-90a1-44fd-bf3a-8490fb7c9a03",
documentId: "90973aec-0508-4375-8b00-91d732414745",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.get({
libraryId: "03d908c8-90a1-44fd-bf3a-8490fb7c9a03",
documentId: "90973aec-0508-4375-8b00-91d732414745",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.get(library_id="03d908c8-90a1-44fd-bf3a-8490fb7c9a03", document_id="90973aec-0508-4375-8b00-91d732414745")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.get(library_id="03d908c8-90a1-44fd-bf3a-8490fb7c9a03", document_id="90973aec-0508-4375-8b00-91d732414745")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}Update the metadata of a specific document.
PUT /v1/libraries/{library_id}/documents/{document_id}#
Given a library and a document in that library, update the name of that document.
200
Successful Response
attributes#
expires_at#
If set, the document will be automatically deleted after this date.
last_processed_at#
number_of_pages#
process_status#
summary#
tokens_processing_main_content#
tokens_processing_summary#
url#
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.documents.librariesDocumentsUpdateV1({
libraryId: "3ddd8d93-dca5-4a6d-980d-173226c35742",
documentId: "2a25e44c-b160-40ca-b5c2-b65fb2fcae34",
updateDocumentRequest: {},
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.librariesDocumentsUpdateV1({
libraryId: "3ddd8d93-dca5-4a6d-980d-173226c35742",
documentId: "2a25e44c-b160-40ca-b5c2-b65fb2fcae34",
updateDocumentRequest: {},
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.libraries_documents_update_v1(library_id="3ddd8d93-dca5-4a6d-980d-173226c35742", document_id="2a25e44c-b160-40ca-b5c2-b65fb2fcae34")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.libraries_documents_update_v1(library_id="3ddd8d93-dca5-4a6d-980d-173226c35742", document_id="2a25e44c-b160-40ca-b5c2-b65fb2fcae34")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X PUT \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X PUT \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}Delete a document.
DELETE /v1/libraries/{library_id}/documents/{document_id}#
Given a library and a document in that library, delete that document. The document will be deleted from the library and the search index.
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.beta.libraries.documents.delete({
libraryId: "005daae9-d42e-407d-82d7-2261c6a1496c",
documentId: "edc236b0-baff-49a9-884b-4ca36a258da4",
});
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.beta.libraries.documents.delete({
libraryId: "005daae9-d42e-407d-82d7-2261c6a1496c",
documentId: "edc236b0-baff-49a9-884b-4ca36a258da4",
});
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
mistral.beta.libraries.documents.delete(library_id="005daae9-d42e-407d-82d7-2261c6a1496c", document_id="edc236b0-baff-49a9-884b-4ca36a258da4")
# Use the SDK ...
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
mistral.beta.libraries.documents.delete(library_id="005daae9-d42e-407d-82d7-2261c6a1496c", document_id="edc236b0-baff-49a9-884b-4ca36a258da4")
# Use the SDK ...
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'Update the metadata of a specific document.
PATCH /v1/libraries/{library_id}/documents/{document_id}#
Given a library and a document in that library, update the name and/or attributes of that document.
200
Successful Response
attributes#
expires_at#
If set, the document will be automatically deleted after this date.
last_processed_at#
number_of_pages#
process_status#
summary#
tokens_processing_main_content#
tokens_processing_summary#
url#
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.documents.update({
libraryId: "2a41249e-52ca-4436-b755-25ce3a9bfb53",
documentId: "bc26fa54-e5d9-4269-bedf-86bed5471c7d",
updateDocumentRequest: {},
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.update({
libraryId: "2a41249e-52ca-4436-b755-25ce3a9bfb53",
documentId: "bc26fa54-e5d9-4269-bedf-86bed5471c7d",
updateDocumentRequest: {},
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.update(library_id="2a41249e-52ca-4436-b755-25ce3a9bfb53", document_id="bc26fa54-e5d9-4269-bedf-86bed5471c7d")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.update(library_id="2a41249e-52ca-4436-b755-25ce3a9bfb53", document_id="bc26fa54-e5d9-4269-bedf-86bed5471c7d")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"extension": null,
"hash": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"library_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"mime_type": null,
"name": "My resource",
"process_status": "self_managed",
"processing_status": "completed",
"size": null,
"tokens_processing_total": 87,
"uploaded_by_id": null,
"uploaded_by_type": "User"
}Retrieve the text content of a specific document.
GET /v1/libraries/{library_id}/documents/{document_id}/text_content#
Given a library and a document in that library, you can retrieve the text content of that document if it exists. For documents like pdf, docx and pptx the text content results from our processing using Mistral OCR.
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.documents.textContent({
libraryId: "1d177215-3b6b-45ba-9fa9-baf773223bec",
documentId: "60214c91-2aba-4692-a4e6-a53365de8caf",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.textContent({
libraryId: "1d177215-3b6b-45ba-9fa9-baf773223bec",
documentId: "60214c91-2aba-4692-a4e6-a53365de8caf",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.text_content(library_id="1d177215-3b6b-45ba-9fa9-baf773223bec", document_id="60214c91-2aba-4692-a4e6-a53365de8caf")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.text_content(library_id="1d177215-3b6b-45ba-9fa9-baf773223bec", document_id="60214c91-2aba-4692-a4e6-a53365de8caf")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/text_content \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/text_content \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"text": "Example text."
}{
"text": "Example text."
}Retrieve the processing status of a specific document.
GET /v1/libraries/{library_id}/documents/{document_id}/status#
Given a library and a document in that library, retrieve the processing status of that document.
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.documents.status({
libraryId: "e6906f70-368f-4155-80da-c1718f01bc43",
documentId: "2c904915-d831-4e9d-a345-8ce405bcef66",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.status({
libraryId: "e6906f70-368f-4155-80da-c1718f01bc43",
documentId: "2c904915-d831-4e9d-a345-8ce405bcef66",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.status(library_id="e6906f70-368f-4155-80da-c1718f01bc43", document_id="2c904915-d831-4e9d-a345-8ce405bcef66")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.status(library_id="e6906f70-368f-4155-80da-c1718f01bc43", document_id="2c904915-d831-4e9d-a345-8ce405bcef66")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/status \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/status \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"document_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"process_status": "self_managed",
"processing_status": "completed"
}{
"document_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"process_status": "self_managed",
"processing_status": "completed"
}Retrieve the signed URL of a specific document.
GET /v1/libraries/{library_id}/documents/{document_id}/signed-url#
Given a library and a document in that library, retrieve the signed URL of a specific document.The url will expire after 30 minutes and can be accessed by anyone with the link.
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.documents.getSignedUrl({
libraryId: "23cf6904-a602-4ee8-9f5b-8efc557c336d",
documentId: "48598486-df71-4994-acbb-1133c72efa8c",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.getSignedUrl({
libraryId: "23cf6904-a602-4ee8-9f5b-8efc557c336d",
documentId: "48598486-df71-4994-acbb-1133c72efa8c",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.get_signed_url(library_id="23cf6904-a602-4ee8-9f5b-8efc557c336d", document_id="48598486-df71-4994-acbb-1133c72efa8c")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.get_signed_url(library_id="23cf6904-a602-4ee8-9f5b-8efc557c336d", document_id="48598486-df71-4994-acbb-1133c72efa8c")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/signed-url \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/signed-url \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
"https://example.com/signed-url""https://example.com/signed-url"Retrieve the signed URL of text extracted from a given document.
GET /v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url#
Given a library and a document in that library, retrieve the signed URL of text extracted. For documents that are sent to the OCR this returns the result of the OCR queries.
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.documents.extractedTextSignedUrl({
libraryId: "a6f15de3-1e82-4f95-af82-851499042ef8",
documentId: "9749d4f9-24e5-4ca2-99a3-a406863f805d",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.documents.extractedTextSignedUrl({
libraryId: "a6f15de3-1e82-4f95-af82-851499042ef8",
documentId: "9749d4f9-24e5-4ca2-99a3-a406863f805d",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.extracted_text_signed_url(library_id="a6f15de3-1e82-4f95-af82-851499042ef8", document_id="9749d4f9-24e5-4ca2-99a3-a406863f805d")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.documents.extracted_text_signed_url(library_id="a6f15de3-1e82-4f95-af82-851499042ef8", document_id="9749d4f9-24e5-4ca2-99a3-a406863f805d")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
"https://example.com/signed-url""https://example.com/signed-url"Reprocess a document.
POST /v1/libraries/{library_id}/documents/{document_id}/reprocess#
Given a library and a document in that library, reprocess that document, it will be billed again.
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.beta.libraries.documents.reprocess({
libraryId: "51b29371-de8f-4ba4-932b-a0bafb3a7f64",
documentId: "3052422c-49ca-45ac-a918-cadb35d61fd8",
});
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.beta.libraries.documents.reprocess({
libraryId: "51b29371-de8f-4ba4-932b-a0bafb3a7f64",
documentId: "3052422c-49ca-45ac-a918-cadb35d61fd8",
});
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
mistral.beta.libraries.documents.reprocess(library_id="51b29371-de8f-4ba4-932b-a0bafb3a7f64", document_id="3052422c-49ca-45ac-a918-cadb35d61fd8")
# Use the SDK ...
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
mistral.beta.libraries.documents.reprocess(library_id="51b29371-de8f-4ba4-932b-a0bafb3a7f64", document_id="3052422c-49ca-45ac-a918-cadb35d61fd8")
# Use the SDK ...
curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/reprocess \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'curl https://api.mistral.ai/v1/libraries/{library_id}/documents/{document_id}/reprocess \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'