> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ada.cx/_mcp/server.

# Create a glossary term

POST https://example.ada.support/api/v2/glossary/
Content-Type: application/json

Create a glossary term for the AI Agent. `external_id` is your own identifier for the term and must be unique within the AI Agent.

Reference: https://docs.ada.cx/reference/glossary/create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects a GlossaryTermCreate.

- `external_id` (string, required) — Your own identifier for the term, unique within the AI Agent
- `translation_mode` (enum, optional, default: default) — `custom` restates detected `user_terms` using `ai_agent_terms`; `default` only surfaces the definition. Defaults to `default`.
  - Allowed values: `default`, `custom`
- `user_terms` (list of GlossaryTermConfig, optional, nullable) — The wordings a customer might use, per language
- `ai_agent_terms` (list of GlossaryTermConfig, optional, nullable) — The wordings the AI Agent should use, per language
- `voice_detection_enabled` (boolean, optional, default: false) — Improve how reliably the term is recognized in speech. Requires a voice platform on the AI Agent. Defaults to false.
- `definition` (string, optional, nullable) — A business definition of the term, shown to the AI Agent
- `voice_pronunciations` (list of GlossaryPronunciationInput, optional, nullable) — Phonetic respellings the AI Agent speaks in place of the written form on voice calls; omit or send null for none
- `availability_rules` (AvailabilityRule, optional, nullable) — The structured rule gating when this term applies; omit or send null for no rule, and an unknown variable id or a malformed rule is rejected with a 400

## Response

### 201

Created

- `id` (string, required) — The unique identifier for the glossary term
- `external_id` (string, required) — Your own identifier for the term, unique within the AI Agent
- `translation_mode` (enum, required) — `custom` tells the AI Agent to answer using the matching `ai_agent_terms` wording whenever it detects one of the `user_terms`. `default` only surfaces the term's `definition` to the agent (and, with `voice_detection_enabled`, biases speech recognition) without changing its wording.
  - Allowed values: `default`, `custom`
- `user_terms` (list of GlossaryTermConfig, required, nullable) — The wordings a customer might use, per language. `null` when none are configured.
- `ai_agent_terms` (list of GlossaryTermConfig, required, nullable) — The wordings the AI Agent should use, per language. Only meaningful in `custom` mode; `null` when none are configured.
- `voice_detection_enabled` (boolean, required) — Whether the term is passed to the voice agent to improve how reliably it is recognized in speech. Requires a voice platform on the AI Agent.
- `definition` (string, required, nullable) — A business definition of the term, shown to the AI Agent when the term is detected. `null` when unset.
- `voice_pronunciations` (list of GlossaryPronunciationConfig, required, nullable) — Phonetic respellings applied to the AI Agent's outgoing speech on voice calls, or `null` when none are configured
- `availability_rules` (AvailabilityRule, required, nullable) — The structured rule that gates when this term applies, with variables referenced by id, or null when no rule is attached

## Errors

### 400 Bad Request Error

Bad Request

- `errors` (list of ErrorsErrorsItems, required) — A list of errors

### 401 Unauthorized Error

Unauthorized

- `errors` (list of ErrorsErrorsItems, required) — A list of errors

### 409 Conflict Error

Conflict — the external_id is already used by another term, or the AI Agent is at its glossary or voice-term limit

- `errors` (list of ErrorsErrorsItems, required) — A list of errors

### 429 Too Many Requests Error

Too Many Requests

- `errors` (list of ErrorsErrorsItems, required) — A list of errors

### 500 Internal Server Error

Internal Server Error

- `errors` (list of ErrorsErrorsItems, required) — A list of errors

## Types

### GlossaryTermConfig

A single language-specific term surface within a glossary entry

- `term` (string, required) — The term as written in the given language
- `language` (string, required) — ISO 639-1 language code for the term

### GlossaryPronunciationInput

A voice pronunciation supplied on a create or update, carrying the length limits the write path enforces

- `language` (string, required) — The language this spelling applies to
- `term` (string, required) — The written form to respell, matched whole-word and case-insensitively
- `pronunciation` (string, required) — The spelling sent to text-to-speech in place of `term`

### AvailabilityRule

A two-level tree of conditions that determines availability based on variable values during a conversation. The root group has a `match` combinator and a list of conditions or condition groups. A rule may contain at most 1000 conditions in total, counting every condition across the root and all nested condition groups.

- `match` (enum, required) — Whether all conditions must pass (`all`) or any one condition must pass (`any`).
  - Allowed values: `all`, `any`
- `conditions` (list of AvailabilityRuleConditionsItems, required) — List of conditions or condition groups. Must contain at least one entry. Each entry is either a `Condition` object (with `variable`, `operator`, and optional `value`) or a `ConditionGroup` object (with its own `match` and nested `conditions` list).

### GlossaryPronunciationConfig

One written form and the spelling the AI Agent speaks in its place, for one language

- `language` (string, required) — The language this spelling applies to
- `term` (string, required) — The written form to respell, matched whole-word and case-insensitively
- `pronunciation` (string, required) — The spelling sent to text-to-speech in place of `term`

### ErrorsErrorsItems

- `type` (string, required) — The error type
- `message` (string, required) — The error message
- `details` (string, optional, nullable) — Extra information about the error

### AvailabilityRuleConditionsItems

### AvailabilityRuleCondition

A single condition comparing a variable to a value.

- `variable` (AvailabilityRuleConditionVariable, required) — The variable to test, referenced by `id`. Look up the ids for your Agent through the variables endpoint. Not every variable can be used in a rule; referencing one that can't returns a `400`.
- `operator` (enum, required) — The comparison operator. Unary operators (`is_set`, `is_not_set`) must not include a `value` field.
  - Allowed values: `equals`, `does_not_equal`, `greater_than`, `less_than`, `starts_with`, `ends_with`, `contains`, `does_not_contain`, `is_set`, `is_not_set`
- `value` (AvailabilityRuleConditionValue, optional) — The value to compare against. Omit for unary operators (`is_set`, `is_not_set`).
- `case_sensitive` (boolean, optional) — Whether the comparison is case-sensitive. Defaults to `false`. Only meaningful for the equality (`equals`, `does_not_equal`) and string (`starts_with`, `ends_with`, `contains`, `does_not_contain`) operators. Omitted from responses when `false`.

### AvailabilityRuleConditionGroup

A nested group of conditions inside a rule's top-level `conditions` list. Condition groups may contain only `Condition` objects — further nesting is not supported.

- `match` (enum, required) — Whether all conditions must pass (`all`) or any one condition must pass (`any`).
  - Allowed values: `all`, `any`
- `conditions` (list of AvailabilityRuleCondition, required) — List of conditions inside this condition group. Must contain at least one entry.

### AvailabilityRuleConditionVariable

The variable to test, referenced by `id`. Look up the ids for your Agent through the variables endpoint. Not every variable can be used in a rule; referencing one that can't returns a `400`.

- `id` (string, required) — The id of the variable.

### AvailabilityRuleConditionValue

The value to compare against. Omit for unary operators (`is_set`, `is_not_set`).

## Examples

**Request**

```json
{
  "external_id": "refund-policy",
  "translation_mode": "custom",
  "user_terms": [
    {
      "term": "money back",
      "language": "en"
    }
  ],
  "ai_agent_terms": [
    {
      "term": "refund",
      "language": "en"
    }
  ],
  "definition": "Money returned to a customer after a purchase."
}
```

**Response**

```json
{
  "id": "65a17e3f43bec88e2792d0eb",
  "external_id": "refund-policy",
  "translation_mode": "custom",
  "user_terms": [
    {
      "term": "money back",
      "language": "en"
    }
  ],
  "ai_agent_terms": [
    {
      "term": "refund",
      "language": "en"
    }
  ],
  "voice_detection_enabled": false,
  "definition": "Money returned to a customer after a purchase.",
  "voice_pronunciations": null,
  "availability_rules": null
}
```

**SDK Code**

```python
import requests

url = "https://example.ada.support/api/v2/glossary/"

payload = {
    "external_id": "refund-policy",
    "translation_mode": "custom",
    "user_terms": [
        {
            "term": "money back",
            "language": "en"
        }
    ],
    "ai_agent_terms": [
        {
            "term": "refund",
            "language": "en"
        }
    ],
    "definition": "Money returned to a customer after a purchase."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://example.ada.support/api/v2/glossary/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"external_id":"refund-policy","translation_mode":"custom","user_terms":[{"term":"money back","language":"en"}],"ai_agent_terms":[{"term":"refund","language":"en"}],"definition":"Money returned to a customer after a purchase."}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://example.ada.support/api/v2/glossary/"

	payload := strings.NewReader("{\n  \"external_id\": \"refund-policy\",\n  \"translation_mode\": \"custom\",\n  \"user_terms\": [\n    {\n      \"term\": \"money back\",\n      \"language\": \"en\"\n    }\n  ],\n  \"ai_agent_terms\": [\n    {\n      \"term\": \"refund\",\n      \"language\": \"en\"\n    }\n  ],\n  \"definition\": \"Money returned to a customer after a purchase.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://example.ada.support/api/v2/glossary/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"external_id\": \"refund-policy\",\n  \"translation_mode\": \"custom\",\n  \"user_terms\": [\n    {\n      \"term\": \"money back\",\n      \"language\": \"en\"\n    }\n  ],\n  \"ai_agent_terms\": [\n    {\n      \"term\": \"refund\",\n      \"language\": \"en\"\n    }\n  ],\n  \"definition\": \"Money returned to a customer after a purchase.\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://example.ada.support/api/v2/glossary/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"external_id\": \"refund-policy\",\n  \"translation_mode\": \"custom\",\n  \"user_terms\": [\n    {\n      \"term\": \"money back\",\n      \"language\": \"en\"\n    }\n  ],\n  \"ai_agent_terms\": [\n    {\n      \"term\": \"refund\",\n      \"language\": \"en\"\n    }\n  ],\n  \"definition\": \"Money returned to a customer after a purchase.\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://example.ada.support/api/v2/glossary/', [
  'body' => '{
  "external_id": "refund-policy",
  "translation_mode": "custom",
  "user_terms": [
    {
      "term": "money back",
      "language": "en"
    }
  ],
  "ai_agent_terms": [
    {
      "term": "refund",
      "language": "en"
    }
  ],
  "definition": "Money returned to a customer after a purchase."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://example.ada.support/api/v2/glossary/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"external_id\": \"refund-policy\",\n  \"translation_mode\": \"custom\",\n  \"user_terms\": [\n    {\n      \"term\": \"money back\",\n      \"language\": \"en\"\n    }\n  ],\n  \"ai_agent_terms\": [\n    {\n      \"term\": \"refund\",\n      \"language\": \"en\"\n    }\n  ],\n  \"definition\": \"Money returned to a customer after a purchase.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "external_id": "refund-policy",
  "translation_mode": "custom",
  "user_terms": [
    [
      "term": "money back",
      "language": "en"
    ]
  ],
  "ai_agent_terms": [
    [
      "term": "refund",
      "language": "en"
    ]
  ],
  "definition": "Money returned to a customer after a purchase."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://example.ada.support/api/v2/glossary/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```