Maximum number of indexes to return













Beta Rag Managed Indexes Endpoints
(beta) RAG API - managed indexes.












Examples
Real world code examples
List managed indexes
GET /v1/rag/managed_indexes#
Lists all managed search indexes for the current workspace.
200
Successful Response
next_page_token#
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/rag/managed_indexes \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.list({});
for await (const page of result) {
console.log(page);
}
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.list({});
for await (const page of result) {
console.log(page);
}
}
run();200
{
"data": [
{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}
]
}{
"data": [
{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}
]
}Create a managed index
POST /v1/rag/managed_indexes#
Reserves a managed search index and starts asynchronous backing-table provisioning. Poll the returned Location until status is ready or failed.
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"name": "My resource"
}'curl https://api.mistral.ai/v1/rag/managed_indexes \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"name": "My resource"
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.create({
name: "<value>",
config: {
embedding: {
type: "custom",
name: "<value>",
dimensions: 543021,
},
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.create({
name: "<value>",
config: {
embedding: {
type: "custom",
name: "<value>",
dimensions: 543021,
},
},
});
console.log(result);
}
run();202
{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}Get a managed index
GET /v1/rag/managed_indexes/{index_name}#
Returns the managed search index with the given name.
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.get({
indexName: "<value>",
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.get({
indexName: "<value>",
});
console.log(result);
}
run();200
{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}Update a managed index schema
PUT /v1/rag/managed_indexes/{index_name}#
Records a new schema for the managed search index and applies it asynchronously. The index keeps serving its current schema until the new one is on disk; poll it until status is ready. Additive only: the new schema must keep every field the current one has.
The schema an index should have. Sent whole, not as a patch.
No config: the embedding configuration is fixed at creation, so there is
nothing for a caller to send back.
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name} \
-X PUT \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"schema": {}
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name} \
-X PUT \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"schema": {}
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.update({
indexName: "<value>",
updateManagedIndexRequest: {
schema: {},
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.update({
indexName: "<value>",
updateManagedIndexRequest: {
schema: {},
},
});
console.log(result);
}
run();202
{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}{
"config": {
"embedding": {
"dimensions": 87,
"name": "My resource"
}
},
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"schema": {},
"status": "provisioning"
}Delete a managed index
DELETE /v1/rag/managed_indexes/{index_name}#
Marks the managed search index for deletion and returns it with status deleting. The backing table is dropped asynchronously; poll the index until it returns 404.
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.delete({
indexName: "<value>",
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.delete({
indexName: "<value>",
});
console.log(result);
}
run();202
{
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"status": "provisioning"
}{
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"status": "provisioning"
}Ingest documents into a managed index
POST /v1/rag/managed_indexes/{index_name}/documents#
Validates and persists documents. Always returns 200; each document is reported as accepted or rejected in the response body.
200
Successful Response
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/documents \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"documents": [
[
null
]
]
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/documents \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"documents": [
[
null
]
]
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.ingestDocuments({
indexName: "<value>",
ingestDocumentsRequest: {
documents: [
{
"key": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
],
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.ingestDocuments({
indexName: "<value>",
ingestDocumentsRequest: {
documents: [
{
"key": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
],
},
});
console.log(result);
}
run();200
{
"accepted": 87,
"rejected": 14,
"results": [
{
"chunk_count": 56,
"document_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"position": 91
}
]
}{
"accepted": 87,
"rejected": 14,
"results": [
{
"chunk_count": 56,
"document_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"position": 91
}
]
}Delete documents from a managed index
DELETE /v1/rag/managed_indexes/{index_name}/documents#
Deletes the given documents by id. Returns the ids actually removed and, in missing, any requested ids that were not present.
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/documents \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"document_ids": [
"ipsum eiusmod"
]
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/documents \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"document_ids": [
"ipsum eiusmod"
]
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.deleteDocuments({
indexName: "<value>",
deleteDocumentsRequest: {
documentIds: [],
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.deleteDocuments({
indexName: "<value>",
deleteDocumentsRequest: {
documentIds: [],
},
});
console.log(result);
}
run();200
{
"deleted_document_ids": [
"ipsum eiusmod"
],
"missing": [
"consequat do"
]
}{
"deleted_document_ids": [
"ipsum eiusmod"
],
"missing": [
"consequat do"
]
}Search a managed index
POST /v1/rag/managed_indexes/{index_name}/search#
Runs an approximate-nearest-neighbor vector search over the index and returns matching chunks, closest-first.
200
Successful Response
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/search \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"retriever": {
"query": "ipsum eiusmod"
}
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/search \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"retriever": {
"query": "ipsum eiusmod"
}
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.search({
indexName: "<value>",
searchRequest: {
retriever: {
topK: 20,
type: "nearest_neighbour",
},
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.search({
indexName: "<value>",
searchRequest: {
retriever: {
topK: 20,
type: "nearest_neighbour",
},
},
});
console.log(result);
}
run();200
{
"hits": [
{
"chunk": {
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
},
"index_name": "aute aliqua aute commodo",
"score": 87
}
]
}{
"hits": [
{
"chunk": {
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
},
"index_name": "aute aliqua aute commodo",
"score": 87
}
]
}Navigate to adjacent chunks
POST /v1/rag/managed_indexes/{index_name}/navigate#
Returns the chunks adjacent to a position within a source, in reading order. NEXT fetches chunks at or after the end offset; PREVIOUS fetches chunks before the start offset. A 200 with an empty list means the source exists but no chunk falls in the requested direction; a 404 means the source has no chunks at all.
200
Successful Response
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/navigate \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"direction": "next",
"end_offset": 87,
"source_id": "ipsum eiusmod",
"start_offset": 14
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/navigate \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"direction": "next",
"end_offset": 87,
"source_id": "ipsum eiusmod",
"start_offset": 14
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.navigate({
indexName: "<value>",
navigateRequest: {
sourceId: "<id>",
startOffset: 506558,
endOffset: 410700,
direction: "previous",
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.navigate({
indexName: "<value>",
navigateRequest: {
sourceId: "<id>",
startOffset: 506558,
endOffset: 410700,
direction: "previous",
},
});
console.log(result);
}
run();200
{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}Read chunks within a span
POST /v1/rag/managed_indexes/{index_name}/read#
Returns the chunks of a source whose span falls within [start_offset, end_offset). Either bound may be omitted to leave that side open. A 200 with an empty list means the source exists but no chunk falls in the range; a 404 means the source has no chunks at all.
200
Successful Response
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/read \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"source_id": "ipsum eiusmod"
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/read \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"source_id": "ipsum eiusmod"
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.read({
indexName: "<value>",
readRequest: {
sourceId: "<id>",
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.read({
indexName: "<value>",
readRequest: {
sourceId: "<id>",
},
});
console.log(result);
}
run();200
{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}Grep for a pattern within a source
POST /v1/rag/managed_indexes/{index_name}/grep#
Lexical substring match within a single source, in reading order. PHRASE mode matches the pattern literally (whitespace-sensitive, case-insensitive); TERM mode requires every whitespace-split token present in any order. A 200 with an empty list means the source exists but no chunk matched; a 404 means the source has no chunks at all.
200
Successful Response
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/grep \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"pattern": "ipsum eiusmod",
"source_id": "consequat do"
}'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/grep \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"pattern": "ipsum eiusmod",
"source_id": "consequat do"
}'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.grep({
indexName: "<value>",
grepRequest: {
sourceId: "<id>",
pattern: "<value>",
},
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.grep({
indexName: "<value>",
grepRequest: {
sourceId: "<id>",
pattern: "<value>",
},
});
console.log(result);
}
run();200
{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}Get a single chunk by id
GET /v1/rag/managed_indexes/{index_name}/chunks/{chunk_id}#
Returns a single chunk by its canonical id. A 404 means no chunk with that id exists in the index.
200
Successful Response
Playground
Test the endpoints live
curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/chunks/{chunk_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/rag/managed_indexes/{index_name}/chunks/{chunk_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.getChunk({
indexName: "<value>",
chunkId: "<id>",
});
console.log(result);
}
run();import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.managedIndexes.getChunk({
indexName: "<value>",
chunkId: "<id>",
});
console.log(result);
}
run();200
{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}{
"chunks": [
{
"chunk_type": "ipsum eiusmod",
"content": "Example content.",
"end_offset": null,
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"locator": "occaecat dolor sit",
"source_id": "nostrud",
"start_offset": null
}
]
}