Skip to main content
Glossary terms represent individual translations or variants within a glossary entry. Each entry can have multiple terms in different languages. On this page, we’ll dive into the different glossary term endpoints you can use to manage glossary terms programmatically. We’ll look at how to create, update, and delete glossary terms.

The glossary term model

A glossary term represents a single translation or variant within a glossary entry. Each entry can have multiple terms in different languages.

Properties

id
integer
Unique identifier for the glossary term.
entry_id
integer
The ID of the glossary entry the term belongs to.
term
string
The term text.
lang
string
The language code for the term (e.g., ‘en’, ‘de’, ‘fr’).
description
string
An optional description or definition of the term.
term_type
string
The type of term. Possible values: preferred (the recommended term to use) or forbidden (a term that should not be used).
alternative_term
string
An optional alternative form of the term.

List glossary terms

GET /v1/glossaries/:glossary_id/entries/:entry_id/terms This endpoint allows you to retrieve all terms for a specific glossary entry.

Optional query parameters

lang
string
Filter terms by language code.
term_type
string
Filter terms by type: preferred or forbidden.
limit
integer
Maximum number of terms to return. Default: 50.
offset
integer
Number of terms to skip for pagination. Default: 0.
curl https://api.elanlanguages.ai/v1/glossaries/1/entries/1/terms \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"
Response
{
  "terms": [
    {
      "id": 1,
      "entry_id": 1,
      "term": "API",
      "lang": "en",
      "description": "Application Programming Interface",
      "term_type": "preferred",
      "alternative_term": null
    },
    {
      "id": 2,
      "entry_id": 1,
      "term": "Schnittstelle",
      "lang": "de",
      "description": "Programmierschnittstelle",
      "term_type": "preferred",
      "alternative_term": null
    }
  ],
  "total": 2,
  "limit": 50,
  "offset": 0
}

Create a glossary term

POST /v1/glossaries/:glossary_id/entries/:entry_id/terms This endpoint allows you to add a new term to a glossary entry.

Required attributes

term
string
required
The term text.
lang
string
required
The language code for the term.
term_type
string
required
The type of term: preferred or forbidden.

Optional attributes

description
string
A description or definition of the term.
alternative_term
string
An alternative form of the term.
curl https://api.elanlanguages.ai/v1/glossaries/1/entries/1/terms \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -H "Content-Type: application/json" \
  -d '{
    "term": "Interface",
    "lang": "en",
    "description": "An alternative term",
    "term_type": "forbidden",
    "alternative_term": "API"
  }'
Response
{
  "id": 3,
  "entry_id": 1,
  "term": "Interface",
  "lang": "en",
  "description": "An alternative term",
  "term_type": "forbidden",
  "alternative_term": "API"
}

Retrieve a glossary term

GET /v1/glossaries/:glossary_id/entries/:entry_id/terms/:term_id This endpoint allows you to retrieve a specific glossary term by its id.
curl https://api.elanlanguages.ai/v1/glossaries/1/entries/1/terms/1 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"
Response
{
  "id": 1,
  "entry_id": 1,
  "term": "API",
  "lang": "en",
  "description": "Application Programming Interface",
  "term_type": "preferred",
  "alternative_term": null
}

Update a glossary term

PUT /v1/glossaries/:glossary_id/entries/:entry_id/terms/:term_id This endpoint allows you to update a glossary term. All attributes are optional - only include the fields you want to update.

Optional attributes

term
string
The term text.
lang
string
The language code for the term.
description
string
A description or definition of the term.
term_type
string
The type of term: preferred or forbidden.
alternative_term
string
An alternative form of the term.
curl -X PUT https://api.elanlanguages.ai/v1/glossaries/1/entries/1/terms/1 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated description for API"
  }'
Response
{
  "id": 1,
  "entry_id": 1,
  "term": "API",
  "lang": "en",
  "description": "Updated description for API",
  "term_type": "preferred",
  "alternative_term": null
}

Delete a glossary term

DELETE /v1/glossaries/:glossary_id/entries/:entry_id/terms/:term_id This endpoint allows you to delete a glossary term.
curl -X DELETE https://api.elanlanguages.ai/v1/glossaries/1/entries/1/terms/1 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"