Skip to main content
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

id
integer
Unique identifier for the context store.
key
string
A URL-friendly unique key for the context store (lowercase letters, numbers, hyphens, underscores).
name
string
The display name of the context store.
description
string
An optional description of the context store’s purpose.
is_active
boolean
Whether or not the context store is active and can be used.
document_count
integer
The number of documents in this context store.
created_at
timestamp
Timestamp of when the context store was created.
updated_at
timestamp
Timestamp of when the context store was last updated.

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

limit
integer
Maximum number of context stores to return (default: 50).
offset
integer
Number of context stores to skip (default: 0).
is_active
boolean
Filter by active status.
order_by
string
Field to order by (default: “created_at”).
order_desc
boolean
Order in descending order (default: true).
curl -G https://api.elanlanguages.ai/v1/context \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"
Response
{
  "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

key
string
required
A unique, URL-friendly key for the context store.
name
string
required
The display name for the context store.

Optional attributes

description
string
A description of the context store’s purpose.
content_kind
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.
retrieval_backend
string
The retrieval backend to use (one of none, qdrant; default: none).
embedding_model
string
Embedding model identifier. Required when retrieval_backend is qdrant.
index_ref
string
External index ID (Qdrant collection or OpenAI vector_store_id).
chunking_config
object
Optional chunking overrides. Object with chunk_size and chunk_overlap.
prompt_template_id
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.
prompt_template_params
object
Parameters merged into template rendering (e.g. {"instruments": "CRPD, Belgian Anti-Discrimination Act"}).
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"
  }'
Response
{
  "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 at the top of this page to see which properties are included with context store objects.
curl https://api.elanlanguages.ai/v1/context/1 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"
Response
{
  "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

name
string
The display name for the context store.
description
string
A description of the context store.
is_active
boolean
Whether or not the context store is active.
content_kind
string
The kind of content the store holds (one of documents, translation_memory). Can only be changed while the store has no documents.
retrieval_backend
string
The retrieval backend to use (one of none, qdrant).
embedding_model
string
Embedding model identifier. Required when retrieval_backend is qdrant.
index_ref
string
External index ID (Qdrant collection or OpenAI vector_store_id).
chunking_config
object
Optional chunking overrides. Object with chunk_size and chunk_overlap.
prompt_template_id
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.
prompt_template_params
object
Parameters merged into template rendering (e.g. {"instruments": "CRPD, Belgian Anti-Discrimination Act"}).
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
  }'
Response
{
  "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

delete_documents
boolean
Whether to delete all documents in the store (default: true).
delete_s3_files
boolean
Whether to delete associated S3 files (default: true).
curl -X DELETE https://api.elanlanguages.ai/v1/context/1 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"

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 for progress.
curl -X POST https://api.elanlanguages.ai/v1/context/1/reindex \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"