Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Beta Rag Managed Indexes Endpoints

(beta) RAG API - managed indexes.

List managed indexes

GET /v1/rag/managed_indexes#

Lists all managed search indexes for the current workspace.

200

Successful Response

next_page_token#
string|null

Playground

Test the endpoints live

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();

200

{
  "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.

202

Index reserved and queued for provisioning

created_at#
date-time|null
id#
*string
modified_at#
date-time|null
name#
*string
status#
*"provisioning"|"ready"|"failed"|"deleting"

Lifecycle of an index. Derived, not stored -- see managed_index_from_row.

status_message#
string|null

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"
}'
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"
}

Get a managed index

GET /v1/rag/managed_indexes/{index_name}#

Returns the managed search index with the given name.

200

Successful Response

created_at#
date-time|null
id#
*string
modified_at#
date-time|null
name#
*string
status#
*"provisioning"|"ready"|"failed"|"deleting"

Lifecycle of an index. Derived, not stored -- see managed_index_from_row.

status_message#
string|null

Playground

Test the endpoints live

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();

200

{
  "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.

202

Schema recorded and queued

created_at#
date-time|null
id#
*string
modified_at#
date-time|null
name#
*string
status#
*"provisioning"|"ready"|"failed"|"deleting"

Lifecycle of an index. Derived, not stored -- see managed_index_from_row.

status_message#
string|null

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": {}
}'
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"
}

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.

202

Index marked for deletion

id#
*string
name#
*string
status#
*"provisioning"|"ready"|"failed"|"deleting"

Lifecycle of an index. Derived, not stored -- see managed_index_from_row.

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'
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"
}

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

accepted#
*integer
rejected#
*integer

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
    ]
  ]
}'
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
    }
  ]
}

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.

200

Successful Response

deleted_document_ids#
*array<string>
missing#
*array<string>

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"
  ]
}'
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"
  ]
}

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"
  }
}'
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
    }
  ]
}

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
}'
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
    }
  ]
}

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"
}'
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
    }
  ]
}

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"
}'
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
    }
  ]
}

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'
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
    }
  ]
}