Glossary Terms
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
- Name
id- Type
- integer
- Description
Unique identifier for the glossary term.
- Name
entry_id- Type
- integer
- Description
The ID of the glossary entry the term belongs to.
- Name
term- Type
- string
- Description
The term text.
- Name
lang- Type
- string
- Description
The language code for the term (e.g., 'en', 'de', 'fr').
- Name
description- Type
- string
- Description
An optional description or definition of the term.
- Name
term_type- Type
- string
- Description
The type of term. Possible values:
preferred(the recommended term to use) orforbidden(a term that should not be used).
- Name
alternative_term- Type
- string
- Description
An optional alternative form of the term.
List glossary terms
This endpoint allows you to retrieve all terms for a specific glossary entry.
Optional query parameters
- Name
lang- Type
- string
- Description
Filter terms by language code.
- Name
term_type- Type
- string
- Description
Filter terms by type:
preferredorforbidden.
- Name
limit- Type
- integer
- Description
Maximum number of terms to return. Default: 50.
- Name
offset- Type
- integer
- Description
Number of terms to skip for pagination. Default: 0.
Request
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
This endpoint allows you to add a new term to a glossary entry.
Required attributes
- Name
term- Type
- string
- Description
The term text.
- Name
lang- Type
- string
- Description
The language code for the term.
- Name
term_type- Type
- string
- Description
The type of term:
preferredorforbidden.
Optional attributes
- Name
description- Type
- string
- Description
A description or definition of the term.
- Name
alternative_term- Type
- string
- Description
An alternative form of the term.
Request
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
This endpoint allows you to retrieve a specific glossary term by its id.
Request
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
This endpoint allows you to update a glossary term. All attributes are optional - only include the fields you want to update.
Optional attributes
- Name
term- Type
- string
- Description
The term text.
- Name
lang- Type
- string
- Description
The language code for the term.
- Name
description- Type
- string
- Description
A description or definition of the term.
- Name
term_type- Type
- string
- Description
The type of term:
preferredorforbidden.
- Name
alternative_term- Type
- string
- Description
An alternative form of the term.
Request
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
This endpoint allows you to delete a glossary term.
Request
curl -X DELETE https://api.elanlanguages.ai/v1/glossaries/1/entries/1/terms/1 \
-H "Authorization: Bearer {token}" \
-H "X-Org-Id: {orgId}"