> ## 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.

# Glossary Terms

> On this page, we'll dive into the different glossary term endpoints you can use to manage terms within glossary entries.

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

<ResponseField name="id" type="integer">
  Unique identifier for the glossary term.
</ResponseField>

<ResponseField name="entry_id" type="integer">
  The ID of the glossary entry the term belongs to.
</ResponseField>

<ResponseField name="term" type="string">
  The term text.
</ResponseField>

<ResponseField name="lang" type="string">
  The language code for the term (e.g., 'en', 'de', 'fr').
</ResponseField>

<ResponseField name="description" type="string">
  An optional description or definition of the term.
</ResponseField>

<ResponseField name="term_type" type="string">
  The type of term. Possible values: `preferred` (the recommended term to use) or `forbidden` (a term that should not be used).
</ResponseField>

<ResponseField name="alternative_term" type="string">
  An optional alternative form of the term.
</ResponseField>

***

## 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

<ParamField query="lang" type="string">
  Filter terms by language code.
</ParamField>

<ParamField query="term_type" type="string">
  Filter terms by type: `preferred` or `forbidden`.
</ParamField>

<ParamField query="limit" type="integer">
  Maximum number of terms to return. Default: 50.
</ParamField>

<ParamField query="offset" type="integer">
  Number of terms to skip for pagination. Default: 0.
</ParamField>

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

```json Response theme={null}
{
  "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

<ParamField body="term" type="string" required>
  The term text.
</ParamField>

<ParamField body="lang" type="string" required>
  The language code for the term.
</ParamField>

<ParamField body="term_type" type="string" required>
  The type of term: `preferred` or `forbidden`.
</ParamField>

### Optional attributes

<ParamField body="description" type="string">
  A description or definition of the term.
</ParamField>

<ParamField body="alternative_term" type="string">
  An alternative form of the term.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  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"
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "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.

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

```json Response theme={null}
{
  "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

<ParamField body="term" type="string">
  The term text.
</ParamField>

<ParamField body="lang" type="string">
  The language code for the term.
</ParamField>

<ParamField body="description" type="string">
  A description or definition of the term.
</ParamField>

<ParamField body="term_type" type="string">
  The type of term: `preferred` or `forbidden`.
</ParamField>

<ParamField body="alternative_term" type="string">
  An alternative form of the term.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  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"
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "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.

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