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

> On this page, we'll dive into the different glossary entry endpoints you can use to manage your company's glossary entries.

Glossary entries contain multiple translations of a single term and corresponding information.
On this page, we'll dive into the different glossary entry endpoints you can use to manage glossary entries programmatically.
We'll look at how to create, update, and delete glossary entries.

## The glossary entry model

The glossary entry model acts as a container for the terms and definitions for a single entry in a glossary.
It also contains a reference to the glossary it belongs to as well as the terms that make up the entry and information about when the entry was created and last updated.
Think of an entry as a row in a spreadsheet with multiple columns containing the translated terms.

### Properties

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

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

<ResponseField name="notes" type="string">
  An optional note for the glossary entry.
</ResponseField>

<ResponseField name="terms" type="array">
  The terms that make up the glossary entry. See [the glossary term model](#the-glossary-term-model) for details.
</ResponseField>

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

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

***

## 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 all glossary entries

**`GET /v1/glossaries/:glossary_id/entries`**

This endpoint allows you to retrieve a paginated list of all the entries in a glossary. By default, a maximum of 50 entries are shown per page.

### Optional query parameters

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

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

<ParamField query="include_terms" type="boolean">
  Whether to include the terms for each entry in the response. Default: true.
</ParamField>

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

```json Response theme={null}
{
  "entries": [
    {
      "id": 1,
      "glossary_id": 1,
      "notes": "Technical term",
      "created_at": "2025-12-11T15:06:14.512Z",
      "updated_at": "2025-12-11T15:06:14.512Z",
      "terms": [
        {
          "id": 1,
          "entry_id": 1,
          "term": "API",
          "lang": "en",
          "description": "Application Programming Interface",
          "term_type": "preferred",
          "alternative_term": null
        }
      ]
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
```

***

## Create a glossary entry

**`POST /v1/glossaries/:glossary_id/entries`**

This endpoint allows you to add a new empty entry to a glossary.
You might want to use the [Create glossary entry with terms](#create-a-glossary-entry-with-terms) endpoint instead to add a glossary entry with terms in a single request.

### Optional attributes

<ParamField body="notes" type="string">
  A note for the glossary entry.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.elanlanguages.ai/v1/glossaries/1/entries \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{"notes": "Technical term"}'
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 1,
  "glossary_id": 1,
  "notes": "Technical term",
  "created_at": "2025-12-11T15:06:14.512Z",
  "updated_at": "2025-12-11T15:06:14.512Z",
  "terms": []
}
```

***

## Create a glossary entry with terms

**`POST /v1/glossaries/:glossary_id/entries/with-terms`**

This endpoint allows you to add a new entry to a glossary with terms in a single request.

### Optional attributes

<ParamField body="notes" type="string">
  A note for the glossary entry.
</ParamField>

### Required attributes

<ParamField body="terms" type="array" required>
  An array of term objects to create. Each term requires `term`, `lang`, and `term_type`.
</ParamField>

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

<ParamField body="description" type="string">
  An optional description of the term.
</ParamField>

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

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.elanlanguages.ai/v1/glossaries/1/entries/with-terms \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "notes": "Technical term",
      "terms": [
        {
          "term": "API",
          "lang": "en",
          "description": "Application Programming Interface",
          "term_type": "preferred"
        },
        {
          "term": "Schnittstelle",
          "lang": "de",
          "description": "Programmierschnittstelle",
          "term_type": "preferred"
        }
      ]
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 1,
  "glossary_id": 1,
  "notes": "Technical term",
  "created_at": "2025-12-11T15:06:14.512Z",
  "updated_at": "2025-12-11T15:06:14.512Z",
  "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
    }
  ]
}
```

***

## Retrieve a glossary entry

**`GET /v1/glossaries/:glossary_id/entries/:entry_id`**

This endpoint allows you to retrieve a glossary entry by providing its id.

### Optional query parameters

<ParamField query="include_terms" type="boolean">
  Whether to include the terms for the entry in the response. Default: true.
</ParamField>

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

```json Response theme={null}
{
  "id": 1,
  "glossary_id": 1,
  "notes": "Technical term",
  "created_at": "2025-12-11T15:06:14.512Z",
  "updated_at": "2025-12-11T15:06:14.512Z",
  "terms": [
    {
      "id": 1,
      "entry_id": 1,
      "term": "API",
      "lang": "en",
      "description": "Application Programming Interface",
      "term_type": "preferred",
      "alternative_term": null
    }
  ]
}
```

***

## Update a glossary entry

**`PUT /v1/glossaries/:glossary_id/entries/:entry_id`**

This endpoint allows you to update a glossary entry. You can update the notes and/or the terms.

When updating terms, the `lang` field is used as the unique identifier within an entry:

* If a term with the given `lang` exists, it will be updated
* If no term with that `lang` exists, a new term will be created

### Optional attributes

<ParamField body="notes" type="string">
  Updated notes for the glossary entry.
</ParamField>

<ParamField body="terms" type="array">
  Array of term objects to update or create. Each term requires `term`, `lang`, and `term_type`.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://api.elanlanguages.ai/v1/glossaries/1/entries/1 \
    -H "Authorization: Bearer {token}" \
    -H "X-Org-Id: {orgId}" \
    -H "Content-Type: application/json" \
    -d '{
      "notes": "Updated technical term",
      "terms": [
        {
          "term": "API",
          "lang": "en",
          "description": "Application Programming Interface",
          "term_type": "preferred"
        }
      ]
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": 1,
  "glossary_id": 1,
  "notes": "Updated technical term",
  "created_at": "2025-12-11T15:06:14.512Z",
  "updated_at": "2025-12-11T16:30:00.000Z",
  "terms": [
    {
      "id": 1,
      "entry_id": 1,
      "term": "API",
      "lang": "en",
      "description": "Application Programming Interface",
      "term_type": "preferred",
      "alternative_term": null
    }
  ]
}
```

***

## Delete a glossary entry

**`DELETE /v1/glossaries/:glossary_id/entries/:entry_id`**

This endpoint allows you to delete a glossary entry. This will also delete all terms associated with the entry.

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