Glossary

List of endpoints to work with the project glossary.

Learn more about Localazy translation glossary before reading this article.

List all glossary items 🔗

[GET] /projects/{projectId}/glossary
Description Value
Accessible with project token true
Accessible with organization token true
Need write permission false
Available from role translator
API level normal

Returns all glossary items for the given project.

Sample Request 🔗

curl --request GET \
  --url https://api.localazy.com/projects/{projectId}/glossary \
  --header 'Authorization: Bearer {{token}}'

Sample Response 🔗

[
  {
    "id": "_a56467123854641134",
    "description": "Item description",
    "translateTerm": true,
    "caseSensitive": true,
    "term": [
      {
        "lang": "en_US",
        "term": "Hello"
      },
      {
        "lang": "cs",
        "term": "Ahoj"
      }
    ]
  }
]

Response Object

Name Description
id Id of the glossary term.
description Description of the glossary term.
translateTerm Whether the term should be translated or left as is.
caseSensitive Wheter the term is case sensitive or not.
term Contains an array of the term and it’s translations. See “Term Object” below.

Term Object

Name Description
lang Language code in which the term is used. Use source language if not translatable.
term The value of the glossary term.

Get glossary item 🔗

[GET] /projects/{projectId}/glossary/{id}
Description Value
Accessible with project token true
Accessible with organization token true
Need write permission false
Available from role translator
API level normal

Returns a single glossary item for the given project specified by {id}.

Sample Request 🔗

curl --request GET \
  --url https://api.localazy.com/projects/{projectId}/glossary/{id} \
  --header 'Authorization: Bearer {{token}}'

Sample Response 🔗

{
  "id": "_a56467123854641134",
  "description": "Item description",
  "translateTerm": true,
  "caseSensitive": true,
  "term": [
    {
      "lang": "en_US",
      "term": "Hello"
    },
    {
      "lang": "cs",
      "term": "Ahoj"
    }
  ]
}

Response Object

Name Description
id Id of the glossary term.
description Description of the glossary term.
translateTerm Whether the term should be translated or left as is.
caseSensitive Wheter the term is case sensitive or not.
term Contains an array of the term and it’s translations. See “Term Object” below.

Term Object

Name Description
lang Language code in which the term is used. Use source language if not translatable.
term The value of the glossary term.

Delete glossary item 🔗

[DELETE] /projects/{projectId}/glossary/{id}
Description Value
Accessible with project token true
Accessible with organization token true
Need write permission true
Available from role reviewer
API level normal

Deletes a glossary item specified by {id}.

Sample Request 🔗

curl --request DELETE \
  --url https://api.localazy.com/projects/{projectId}/glossary/{id} \
  --header 'Authorization: Bearer {{token}}'

Sample Response 🔗

{
  "result": true
}

Create new glossary item 🔗

[POST] /projects/{projectId}/glossary
Description Value
Accessible with project token true
Accessible with organization token true
Need write permission true
Available from role reviewer
API level normal

Adds a new item to glossary. There is a limit of 1000 glossary items per project.

Sample Request 🔗

curl --request POST \
  --url https://api.localazy.com/projects/{projectId}/glossary \
  --header 'Authorization: Bearer {{token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "Item description",
  "translateTerm": true,
  "caseSensitive": true,
  "term": [
    {
      "lang": "en_US",
      "term": "Hello"
    },
    {
      "lang": "cs",
      "term": "Ahoj"
    }
  ]
}'

Request Object

Name Description
id Id of the glossary term.
description Description of the glossary term.
translateTerm Whether the term should be translated or left as is.
caseSensitive Wheter the term is case sensitive or not.
term Contains an array of the term and it’s translations. See “Term Object” below.

Term Object

Name Description
lang Language code in which the term is used. Use source language if not translatable.
term The value of the glossary term.

Sample Response 🔗

{
  "result": "_a56467123854641134"
}

Response Object

Name Description
result Id of the created item

Update glossary item 🔗

[PUT] /projects/{projectId}/glossary/{id}
Description Value
Accessible with project token true
Accessible with organization token true
Need write permission true
Available from role reviewer
API level normal

Updates the given glossary item specified by {id}.

Sample Request 🔗

curl --request PUT \
  --url https://api.localazy.com/projects/{projectId}/glossary \
  --header 'Authorization: Bearer {{token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "Item description",
  "translateTerm": true,
  "caseSensitive": true,
  "term": [
    {
      "lang": "en_US",
      "term": "Hello"
    },
    {
      "lang": "cs",
      "term": "Ahoj"
    }
  ]
}'

Sample Response 🔗

{
  "result": true
}