Engines and guidance API
Create engines, maintain the glossaries and rulesets they apply, and attach them through the API.
An engine is the configuration a translation job runs with: its locales, models, pipeline, and the guidance it applies. Guidance lives in sets that belong to the organization, so several engines can apply the same set and an edit to it reaches all of them.
| Resource | Holds | Reference |
|---|---|---|
| Engine | Locale coverage, model configurations, pipeline settings, and the IDs of the sets attached to it. | Create and manage engines |
| Glossary | Terms. Each term is a source text in a source locale, with a translation per target locale or none. | Glossaries |
| Ruleset | Rules. Each rule is a named instruction for one target locale or for every locale. | Rulesets and rules |
An engine applies every glossary and ruleset attached to it, and at most one brand voice. Attach glossaries and rulesets explains how to change those attachments.
All routes use https://api.lingo.dev and API authentication. Successful requests return HTTP 200. Deletes, attaches, and detaches return an empty body.
Set up an engine #
- Create a glossary and add its terms.
- Create a ruleset and add its rules.
- Create the engine with the locales it translates.
- Attach the glossary and ruleset, then list the terms the engine applies to check the result.
- Pass the engine's
idasengineIdwhen you create a translation job.
Provisioning can generate a glossary, ruleset, and brand voice from website pages or text instead of steps 1 and 2.
Permissions #
Each request needs these permissions in the organization that owns the resource:
| Operation | Permission |
|---|---|
| List or read an engine, and list the terms it applies | engine:read |
| Create an engine | engine:create |
| Update an engine, or attach and detach its glossaries and rulesets | engine:edit |
| Delete an engine | engine:delete |
| List or read a glossary and its terms | org:glossary:read |
| Create a glossary, or change or delete one and its terms | org:glossary:edit |
| List or read a ruleset and its rules | org:ruleset:read |
| Create a ruleset, or change or delete one and its rules | org:ruleset:edit |
A personal key and a user session act with the user's role and with grants to individual resources. The user who creates an engine, glossary, or ruleset receives a grant to it, so they can keep changing it without the organization-wide edit permission. A user who can read an engine can also read the glossaries and rulesets attached to it.
Attaching also requires the caller to be able to read the glossary or ruleset, which must belong to the engine's organization.
Service keys #
A service key holds engine:read and engine:translate at most, whether those come from its role or, without RBAC, from the fixed service-key set. It therefore cannot create engines, glossaries, or rulesets, and cannot update, delete, or change the attachments of an engine. Use a personal key for these operations.
With RBAC, a service key's content scope names glossaries and rulesets it can reach. The key can read and change the sets named in its scope, including their terms and rules, but it still cannot create new sets.
Reading a resource outside the caller's access returns its not-found problem, such as 404 EngineNotFound. Changing one the caller can read but not edit returns 403 MissingPermission, which names the missing permission.
Common errors #
| Problem | Status | Cause |
|---|---|---|
about:blank | 400 | The request failed validation. errors lists each invalid path. |
ServiceKeyDisabled | 402 | The organization's plan no longer includes RBAC, which disables its service keys. |
EngineLimitReached | 402 | The organization has as many engines as its plan allows. |
MissingPermission | 403 | The caller can read the resource but lacks the permission the change needs. |
OrganizationNotFound | 404 | The caller is not a member of the organization in the path. |
EngineNotFound | 404 | The engine does not exist or the caller cannot read it. |
GlossaryNotFound | 404 | The glossary does not exist or the caller cannot read it. |
RulesetNotFound | 404 | The ruleset does not exist or the caller cannot read it. |
GlossaryInUse | 409 | A glossary cannot be deleted while an engine applies it. |
RulesetInUse | 409 | A ruleset cannot be deleted while an engine applies it. |
GlossaryTermsTaken | 409 | The glossary already holds a term with that source locale and text. |
AttachmentsUnreachable | 422 | An attached ID does not exist, belongs to another organization, or is not readable by the caller. |
Each page lists the problems specific to its operations. The error catalogue has the fields and an example of every problem.