> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elanlanguages.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Context Stores

> On this page, we'll dive into the different context store endpoints you can use to manage context store containers for your translation workflows.

Context stores are containers for organizing reference documents that support your translation workflows. They allow you to manage glossaries, style guides, and other contextual materials that help ensure consistent and accurate translations. On this page, we'll dive into the different context store endpoints you can use to manage context stores programmatically.

## The context store model

The context store model contains metadata about your context stores, such as their key, name, and description. It also tracks when the store was created and last updated, and whether it's currently active.

### Properties

<ResponseField name="id" type="integer">
  Unique identifier for the context store.
</ResponseField>

<ResponseField name="key" type="string">
  A URL-friendly unique key for the context store (lowercase letters, numbers, hyphens, underscores).
</ResponseField>

<ResponseField name="name" type="string">
  The display name of the context store.
</ResponseField>

<ResponseField name="description" type="string">
  An optional description of the context store's purpose.
</ResponseField>

<ResponseField name="is_active" type="boolean">
  Whether or not the context store is active and can be used.
</ResponseField>

<ResponseField name="document_count" type="integer">
  The number of documents in this context store.
</ResponseField>

<ResponseField name="created_at" type="timestamp">
  Timestamp of when the context store was created.
</ResponseField>

<ResponseField name="updated_at" type="timestamp">
  Timestamp of when the context store was last updated.
</ResponseField>

***

## List all context stores

**`GET /v1/context`**

This endpoint allows you to retrieve a paginated list of all your context stores. By default, a maximum of 50 context stores are shown per page.

### Optional parameters

<ParamField query="limit" type="integer">
  Maximum number of context stores to return (default: 50).
</ParamField>

<ParamField query="offset" type="integer">
  Number of context stores to skip (default: 0).
</ParamField>

<ParamField query="is_active" type="boolean">
  Filter by active status.
</ParamField>

<ParamField query="order_by" type="string">
  Field to order by (default: "created\_at").
</ParamField>

<ParamField query="order_desc" type="boolean">
  Order in descending order (default: true).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -G https://api.elanlanguages.ai/v1/context \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>

```json Response theme={null}
{
  "stores": [
    {
      "id": 1,
      "key": "product-glossary",
      "name": "Product Glossary",
      "description": "Technical terms for product documentation",
      "is_active": true,
      "document_count": 0,
      "created_at": "2025-12-21T10:30:29.114Z",
      "updated_at": "2025-12-21T10:30:29.114Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
```

***

## Create a context store

**`POST /v1/context`**

This endpoint allows you to create a new context store. A context store acts as a container for context documents. The key must be URL-friendly (lowercase letters, numbers, hyphens, underscores).

### Required attributes

<ParamField body="key" type="string" required>
  A unique, URL-friendly key for the context store.
</ParamField>

<ParamField body="name" type="string" required>
  The display name for the context store.
</ParamField>

### Optional attributes

<ParamField body="description" type="string">
  A description of the context store's purpose.
</ParamField>

<ParamField body="content_kind" type="string">
  The kind of content the store holds (one of `documents`, `translation_memory`; default: `documents`). A `translation_memory` store holds bilingual TM segments (TMX) and requires `retrieval_backend` set to `qdrant` and an `embedding_model`.
</ParamField>

<ParamField body="retrieval_backend" type="string">
  The retrieval backend to use (one of `none`, `qdrant`; default: `none`).
</ParamField>

<ParamField body="embedding_model" type="string">
  Embedding model identifier. Required when `retrieval_backend` is `qdrant`.
</ParamField>

<ParamField body="index_ref" type="string">
  External index ID (Qdrant collection or OpenAI vector\_store\_id).
</ParamField>

<ParamField body="chunking_config" type="object">
  Optional chunking overrides. Object with `chunk_size` and `chunk_overlap`.
</ParamField>

<ParamField body="prompt_template_id" type="integer">
  ID of a prompt template that is automatically applied as the system prompt whenever a retriever is built from this store. The template must belong to the same organization or be a system default.
</ParamField>

<ParamField body="prompt_template_params" type="object">
  Parameters merged into template rendering (e.g. `{"instruments": "CRPD, Belgian Anti-Discrimination Act"}`).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.elanlanguages.ai/v1/context \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "key": "product-glossary",
      "name": "Product Glossary",
      "description": "Technical terms for product documentation"
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 1,
  "key": "product-glossary",
  "name": "Product Glossary",
  "description": "Technical terms for product documentation",
  "is_active": true,
  "document_count": 0,
  "created_at": "2025-12-21T10:34:41.135Z",
  "updated_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Retrieve a context store

**`GET /v1/context/:store_id`**

This endpoint allows you to retrieve a context store by providing its ID. Refer to [the list](#the-context-store-model) at the top of this page to see which properties are included with context store objects.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.elanlanguages.ai/v1/context/1 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 1,
  "key": "product-glossary",
  "name": "Product Glossary",
  "description": "Technical terms for product documentation",
  "is_active": true,
  "document_count": 0,
  "created_at": "2025-12-21T10:34:41.135Z",
  "updated_at": "2025-12-21T10:34:41.135Z"
}
```

***

## Update a context store

**`PUT /v1/context/:store_id`**

This endpoint allows you to perform an update on a context store. You can update the name, description, active status, and retrieval configuration.

### Optional attributes

<ParamField body="name" type="string">
  The display name for the context store.
</ParamField>

<ParamField body="description" type="string">
  A description of the context store.
</ParamField>

<ParamField body="is_active" type="boolean">
  Whether or not the context store is active.
</ParamField>

<ParamField body="content_kind" type="string">
  The kind of content the store holds (one of `documents`, `translation_memory`). Can only be changed while the store has no documents.
</ParamField>

<ParamField body="retrieval_backend" type="string">
  The retrieval backend to use (one of `none`, `qdrant`).
</ParamField>

<ParamField body="embedding_model" type="string">
  Embedding model identifier. Required when `retrieval_backend` is `qdrant`.
</ParamField>

<ParamField body="index_ref" type="string">
  External index ID (Qdrant collection or OpenAI vector\_store\_id).
</ParamField>

<ParamField body="chunking_config" type="object">
  Optional chunking overrides. Object with `chunk_size` and `chunk_overlap`.
</ParamField>

<ParamField body="prompt_template_id" type="integer">
  ID of a prompt template that is automatically applied as the system prompt whenever a retriever is built from this store. The template must belong to the same organization or be a system default.
</ParamField>

<ParamField body="prompt_template_params" type="object">
  Parameters merged into template rendering (e.g. `{"instruments": "CRPD, Belgian Anti-Discrimination Act"}`).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://api.elanlanguages.ai/v1/context/1 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Updated Product Glossary",
      "description": "Comprehensive product terminology",
      "is_active": true
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 1,
  "key": "product-glossary",
  "name": "Updated Product Glossary",
  "description": "Comprehensive product terminology",
  "is_active": true,
  "document_count": 0,
  "created_at": "2025-12-21T10:34:41.135Z",
  "updated_at": "2025-12-21T10:39:04.329Z"
}
```

***

## Delete a context store

**`DELETE /v1/context/:store_id`**

This endpoint allows you to delete a context store. Note: This is a soft delete operation. By default, this will also delete all documents in the store and their associated S3 files.

### Optional parameters

<ParamField query="delete_documents" type="boolean">
  Whether to delete all documents in the store (default: true).
</ParamField>

<ParamField query="delete_s3_files" type="boolean">
  Whether to delete associated S3 files (default: true).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.elanlanguages.ai/v1/context/1 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>

***

## Reindex a context store

**`POST /v1/context/:store_id/reindex`**

This endpoint allows you to submit a `rag_ingest` job that (re)indexes every active document in the store. This is useful for backfilling after enabling a retrieval backend on an existing store, or for recovering from a worker crash that left documents stuck in processing. The response returns the workflow ID; poll the [job status endpoint](/translation#get-job-status) for progress.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.elanlanguages.ai/v1/context/1/reindex \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}"
  ```
</CodeGroup>
