Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Search Index API

Search Index API.

List search indexes

GET /v1/context/search-indexes#

Lists all 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/context/search-indexes \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "data": [
    {
      "config": {
        "embedding": {
          "dimensions": 87,
          "name": "My resource"
        }
      },
      "creator_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
      "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
      "name": "My resource",
      "schema": {},
      "status": "provisioning"
    }
  ]
}

Create a search index

POST /v1/context/search-indexes#

Reserves a 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
creator_id#
*string
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/context/search-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"
}'

202

{
  "config": {
    "embedding": {
      "dimensions": 87,
      "name": "My resource"
    }
  },
  "creator_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "name": "My resource",
  "schema": {},
  "status": "provisioning"
}

Get a search index

GET /v1/context/search-indexes/{index_name}#

Returns the search index with the given name.

200

Successful Response

created_at#
date-time|null
creator_id#
*string
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/context/search-indexes/{index_name} \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "config": {
    "embedding": {
      "dimensions": 87,
      "name": "My resource"
    }
  },
  "creator_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "name": "My resource",
  "schema": {},
  "status": "provisioning"
}

Update a search index schema

PUT /v1/context/search-indexes/{index_name}#

Records a new schema for the 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
creator_id#
*string
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/context/search-indexes/{index_name} \
 -X PUT \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "schema": {}
}'

202

{
  "config": {
    "embedding": {
      "dimensions": 87,
      "name": "My resource"
    }
  },
  "creator_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "name": "My resource",
  "schema": {},
  "status": "provisioning"
}

Delete a search index

DELETE /v1/context/search-indexes/{index_name}#

Marks the 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/context/search-indexes/{index_name} \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json'

202

{
  "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "name": "My resource",
  "status": "provisioning"
}

Ingest documents into a search index

POST /v1/context/search-indexes/{index_name}/documents#

Validates and persists documents. Returns 200 with each document reported as accepted or rejected in the response body, or 403 once the index holds its limit of chunks.

200

Successful Response

accepted#
*integer
rejected#
*integer

Playground

Test the endpoints live

curl https://api.mistral.ai/v1/context/search-indexes/{index_name}/documents \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "documents": [
    [
      null
    ]
  ]
}'

200

{
  "accepted": 87,
  "rejected": 14,
  "results": [
    {
      "chunk_count": 56,
      "document_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
      "position": 91
    }
  ]
}

Delete documents from a search index

DELETE /v1/context/search-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/context/search-indexes/{index_name}/documents \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "document_ids": [
    "ipsum eiusmod"
  ]
}'

200

{
  "deleted_document_ids": [
    "ipsum eiusmod"
  ],
  "missing": [
    "consequat do"
  ]
}

Search an index

POST /v1/context/search-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/context/search-indexes/{index_name}/search \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "retriever": {
    "query": "ipsum eiusmod"
  }
}'

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/context/search-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/context/search-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
}'

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/context/search-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/context/search-indexes/{index_name}/read \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "source_id": "ipsum eiusmod"
}'

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/context/search-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/context/search-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"
}'

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/context/search-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/context/search-indexes/{index_name}/chunks/{chunk_id} \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

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 search index Summary

GET /v1/context/search-indexes/{index_name}/summary_field/{language}#

Retrieve the summary field for a search index if it exists

200

Successful Response

content#
*string
status#
*"handwritten"|"generated"|"generated_confirmed"
translated#
*boolean

Playground

Test the endpoints live

curl https://api.mistral.ai/v1/context/search-indexes/{index_name}/summary_field/{language} \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "content": "Example content.",
  "status": "handwritten",
  "translated": false
}

Set search index Summary

PUT /v1/context/search-indexes/{index_name}/summary_field/{language}#

Update the summary field for a search index

200

Response Type
any

Successful Response

Playground

Test the endpoints live

curl https://api.mistral.ai/v1/context/search-indexes/{index_name}/summary_field/{language} \
 -X PUT \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "content": "Example content.",
  "status": "handwritten",
  "translated": false
}'

200

null

Generate a summary field for a search index

POST /v1/context/search-indexes/{index_name}/summary_field/{language}#

Streams a summary for the search index in chunks of json.

The first chunk contains metadata for the summary, the following contain chunks of 'content' that should be joined together to form a full summary.

If force is true, regenerate the requested language even if a summary already exists.

200

Successful Response

SummaryMetadata#

{object}

SummaryChunk#

{object}

SummaryError#

{object}

Playground

Test the endpoints live

curl https://api.mistral.ai/v1/context/search-indexes/{index_name}/summary_field/{language} \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json'

200

"{}"