Glossaries
A glossary is a set of terms with per-language definitions that can be linked to a translation request (via glossaryId) to enforce consistent terminology. See Glossary Terms for managing the terms inside a glossary.
List Glossaries
Section titled “List Glossaries”Retrieves a paginated list of all glossaries for the organization.
Endpoint: GET /translation/glossaries
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
page |
integer | no | Page number (default 1) |
limit |
integer | no | Items per page, 1-100 (default 50) |
Response
Section titled “Response”Success Response (200)
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": [ { "id": "cmglossary123", "name": "Technical Terms", "organizationId": "cmorg123", "status": "OK", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z", "languages": [ { "language": "en", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z" }, { "language": "de", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z" } ], "terms": [] } ], "pagination": { "page": 1, "limit": 50, "total": 1, "totalPages": 1 }}Example Request
Section titled “Example Request”curl -X GET "https://platform.algebras.ai/api/v1/translation/glossaries?page=1&limit=50" \ -H "X-Api-Key: your_api_key_here"import requests
url = "https://platform.algebras.ai/api/v1/translation/glossaries"headers = {"X-Api-Key": "your_api_key_here"}params = {"page": 1, "limit": 50}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200: result = response.json() for glossary in result["data"]: print(glossary["id"], glossary["name"], glossary["status"])else: print(f"Error: {response.status_code}") print(response.json())const url = "https://platform.algebras.ai/api/v1/translation/glossaries?page=1&limit=50";
const response = await fetch(url, { method: "GET", headers: { "X-Api-Key": "your_api_key_here" },});
if (response.ok) { const result = await response.json(); result.data.forEach((g) => console.log(g.id, g.name, g.status));} else { const error = await response.json(); console.error("Error:", response.status, error);}package main
import ( "encoding/json" "fmt" "io" "net/http")
func main() { url := "https://platform.algebras.ai/api/v1/translation/glossaries?page=1&limit=50"
req, _ := http.NewRequest("GET", url, nil) req.Header.Set("X-Api-Key", "your_api_key_here")
client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode == 200 { var result map[string]interface{} json.Unmarshal(body, &result) glossaries := result["data"].([]interface{}) for _, g := range glossaries { item := g.(map[string]interface{}) fmt.Println(item["id"], item["name"], item["status"]) } } else { fmt.Printf("Error: %d\n", resp.StatusCode) fmt.Println(string(body)) }}Create Glossary
Section titled “Create Glossary”Creates a new glossary with the specified name and languages.
Endpoint: POST /translation/glossaries
Request Body
Section titled “Request Body”Sent as JSON.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Name of the glossary |
languages |
array of strings | yes | Language codes the glossary covers |
Response
Section titled “Response”Success Response (200)
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": { "id": "cmglossary123", "name": "Technical Terms", "organizationId": "cmorg123", "status": "OK", "createdAt": "2025-01-12T22:31:48.856Z", "updatedAt": "2025-01-12T22:31:48.856Z", "languages": [ { "language": "en", "createdAt": "2025-01-12T22:31:48.856Z", "updatedAt": "2025-01-12T22:31:48.856Z" }, { "language": "es", "createdAt": "2025-01-12T22:31:48.856Z", "updatedAt": "2025-01-12T22:31:48.856Z" }, { "language": "fr", "createdAt": "2025-01-12T22:31:48.856Z", "updatedAt": "2025-01-12T22:31:48.856Z" } ], "terms": [] }}Example Request
Section titled “Example Request”curl -X POST "https://platform.algebras.ai/api/v1/translation/glossaries" \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Technical Terms", "languages": ["en", "es", "fr"] }'import requests
url = "https://platform.algebras.ai/api/v1/translation/glossaries"headers = { "X-Api-Key": "your_api_key_here", "Content-Type": "application/json"}data = { "name": "Technical Terms", "languages": ["en", "es", "fr"]}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200: glossary = response.json()["data"] print("Created glossary:", glossary["id"])else: print(f"Error: {response.status_code}") print(response.json())const url = "https://platform.algebras.ai/api/v1/translation/glossaries";
const response = await fetch(url, { method: "POST", headers: { "X-Api-Key": "your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ name: "Technical Terms", languages: ["en", "es", "fr"], }),});
if (response.ok) { const result = await response.json(); console.log("Created glossary:", result.data.id);} else { const error = await response.json(); console.error("Error:", response.status, error);}package main
import ( "bytes" "encoding/json" "fmt" "io" "net/http")
func main() { url := "https://platform.algebras.ai/api/v1/translation/glossaries"
payload := map[string]interface{}{ "name": "Technical Terms", "languages": []string{"en", "es", "fr"}, }
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("X-Api-Key", "your_api_key_here") req.Header.Set("Content-Type", "application/json")
client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode == 200 { var result map[string]interface{} json.Unmarshal(body, &result) data := result["data"].(map[string]interface{}) fmt.Println("Created glossary:", data["id"]) } else { fmt.Printf("Error: %d\n", resp.StatusCode) fmt.Println(string(body)) }}Get Glossary
Section titled “Get Glossary”Retrieves a specific glossary with all its terms and definitions.
Endpoint: GET /translation/glossaries/{id}
Path Parameters
Section titled “Path Parameters”id: The glossary ID
Response
Section titled “Response”Success Response (200)
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": { "id": "cmglossary123", "name": "Technical Terms", "organizationId": "cmorg123", "status": "OK", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z", "languages": [ { "language": "en", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z" }, { "language": "de", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z" } ], "terms": [ { "id": "cmterm123", "glossaryId": "cmglossary123", "translationFlag": true, "createdAt": "2025-01-10T09:05:00.000Z", "updatedAt": "2025-01-10T09:05:00.000Z", "definitions": [ { "language": "en", "term": "API", "definition": "Application Programming Interface", "caseSensitivity": "auto", "createdAt": "2025-01-10T09:05:00.000Z", "updatedAt": "2025-01-10T09:05:00.000Z" }, { "language": "de", "term": "API", "definition": "Programmierschnittstelle", "caseSensitivity": "auto", "createdAt": "2025-01-10T09:05:00.000Z", "updatedAt": "2025-01-10T09:05:00.000Z" } ] } ] }}Example Request
Section titled “Example Request”curl -X GET "https://platform.algebras.ai/api/v1/translation/glossaries/cmglossary123" \ -H "X-Api-Key: your_api_key_here"import requests
glossary_id = "cmglossary123"url = f"https://platform.algebras.ai/api/v1/translation/glossaries/{glossary_id}"headers = {"X-Api-Key": "your_api_key_here"}
response = requests.get(url, headers=headers)
if response.status_code == 200: glossary = response.json()["data"] print(glossary["name"], "-", len(glossary["terms"]), "terms")else: print(f"Error: {response.status_code}") print(response.json())const glossaryId = "cmglossary123";const url = `https://platform.algebras.ai/api/v1/translation/glossaries/${glossaryId}`;
const response = await fetch(url, { method: "GET", headers: { "X-Api-Key": "your_api_key_here" },});
if (response.ok) { const result = await response.json(); console.log(result.data.name, "-", result.data.terms.length, "terms");} else { const error = await response.json(); console.error("Error:", response.status, error);}package main
import ( "encoding/json" "fmt" "io" "net/http")
func main() { glossaryID := "cmglossary123" url := fmt.Sprintf("https://platform.algebras.ai/api/v1/translation/glossaries/%s", glossaryID)
req, _ := http.NewRequest("GET", url, nil) req.Header.Set("X-Api-Key", "your_api_key_here")
client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode == 200 { var result map[string]interface{} json.Unmarshal(body, &result) data := result["data"].(map[string]interface{}) fmt.Println(data["name"], "-", data["status"]) } else { fmt.Printf("Error: %d\n", resp.StatusCode) fmt.Println(string(body)) }}Update Glossary
Section titled “Update Glossary”Updates a glossary’s name and/or languages.
Endpoint: PUT /translation/glossaries/{id}
Path Parameters
Section titled “Path Parameters”id: The glossary ID
Request Body
Section titled “Request Body”Sent as JSON. Both fields are optional — send only what you want to change.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | no | New name for the glossary |
languages |
array of strings | no | New array of language codes |
Response
Section titled “Response”Success Response (200)
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": { "id": "cmglossary123", "name": "Updated Technical Terms", "organizationId": "cmorg123", "status": "UPDATING", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-12T22:31:48.856Z", "languages": [ { "language": "en", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z" }, { "language": "de", "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-01-10T09:00:00.000Z" }, { "language": "fr", "createdAt": "2025-01-12T22:31:48.856Z", "updatedAt": "2025-01-12T22:31:48.856Z" } ], "terms": [] }}Example Request
Section titled “Example Request”curl -X PUT "https://platform.algebras.ai/api/v1/translation/glossaries/cmglossary123" \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated Technical Terms", "languages": ["en", "de", "fr"] }'import requests
glossary_id = "cmglossary123"url = f"https://platform.algebras.ai/api/v1/translation/glossaries/{glossary_id}"headers = { "X-Api-Key": "your_api_key_here", "Content-Type": "application/json"}data = { "name": "Updated Technical Terms", "languages": ["en", "de", "fr"]}
response = requests.put(url, headers=headers, json=data)
if response.status_code == 200: print("Updated:", response.json()["data"]["name"])else: print(f"Error: {response.status_code}") print(response.json())const glossaryId = "cmglossary123";const url = `https://platform.algebras.ai/api/v1/translation/glossaries/${glossaryId}`;
const response = await fetch(url, { method: "PUT", headers: { "X-Api-Key": "your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ name: "Updated Technical Terms", languages: ["en", "de", "fr"], }),});
if (response.ok) { const result = await response.json(); console.log("Updated:", result.data.name);} else { const error = await response.json(); console.error("Error:", response.status, error);}package main
import ( "bytes" "encoding/json" "fmt" "io" "net/http")
func main() { glossaryID := "cmglossary123" url := fmt.Sprintf("https://platform.algebras.ai/api/v1/translation/glossaries/%s", glossaryID)
payload := map[string]interface{}{ "name": "Updated Technical Terms", "languages": []string{"en", "de", "fr"}, }
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData)) req.Header.Set("X-Api-Key", "your_api_key_here") req.Header.Set("Content-Type", "application/json")
client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode == 200 { var result map[string]interface{} json.Unmarshal(body, &result) data := result["data"].(map[string]interface{}) fmt.Println("Updated:", data["name"]) } else { fmt.Printf("Error: %d\n", resp.StatusCode) fmt.Println(string(body)) }}Delete Glossary
Section titled “Delete Glossary”Deletes a glossary and all its terms and definitions.
Endpoint: DELETE /translation/glossaries/{id}
Path Parameters
Section titled “Path Parameters”id: The glossary ID
Response
Section titled “Response”Success Response (200)
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": { "id": "cmglossary123" }}Example Request
Section titled “Example Request”curl -X DELETE "https://platform.algebras.ai/api/v1/translation/glossaries/cmglossary123" \ -H "X-Api-Key: your_api_key_here"import requests
glossary_id = "cmglossary123"url = f"https://platform.algebras.ai/api/v1/translation/glossaries/{glossary_id}"headers = {"X-Api-Key": "your_api_key_here"}
response = requests.delete(url, headers=headers)
if response.status_code == 200: print("Deleted:", response.json()["data"]["id"])else: print(f"Error: {response.status_code}") print(response.json())const glossaryId = "cmglossary123";const url = `https://platform.algebras.ai/api/v1/translation/glossaries/${glossaryId}`;
const response = await fetch(url, { method: "DELETE", headers: { "X-Api-Key": "your_api_key_here" },});
if (response.ok) { const result = await response.json(); console.log("Deleted:", result.data.id);} else { const error = await response.json(); console.error("Error:", response.status, error);}package main
import ( "encoding/json" "fmt" "io" "net/http")
func main() { glossaryID := "cmglossary123" url := fmt.Sprintf("https://platform.algebras.ai/api/v1/translation/glossaries/%s", glossaryID)
req, _ := http.NewRequest("DELETE", url, nil) req.Header.Set("X-Api-Key", "your_api_key_here")
client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode == 200 { var result map[string]interface{} json.Unmarshal(body, &result) data := result["data"].(map[string]interface{}) fmt.Println("Deleted:", data["id"]) } else { fmt.Printf("Error: %d\n", resp.StatusCode) fmt.Println(string(body)) }}