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.

ResourceHoldsReference
EngineLocale coverage, model configurations, pipeline settings, and the IDs of the sets attached to it.Create and manage engines
GlossaryTerms. Each term is a source text in a source locale, with a translation per target locale or none.Glossaries
RulesetRules. 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 #

  1. Create a glossary and add its terms.
  2. Create a ruleset and add its rules.
  3. Create the engine with the locales it translates.
  4. Attach the glossary and ruleset, then list the terms the engine applies to check the result.
  5. Pass the engine's id as engineId when 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:

OperationPermission
List or read an engine, and list the terms it appliesengine:read
Create an engineengine:create
Update an engine, or attach and detach its glossaries and rulesetsengine:edit
Delete an engineengine:delete
List or read a glossary and its termsorg:glossary:read
Create a glossary, or change or delete one and its termsorg:glossary:edit
List or read a ruleset and its rulesorg:ruleset:read
Create a ruleset, or change or delete one and its rulesorg: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 #

ProblemStatusCause
about:blank400The request failed validation. errors lists each invalid path.
ServiceKeyDisabled402The organization's plan no longer includes RBAC, which disables its service keys.
EngineLimitReached402The organization has as many engines as its plan allows.
MissingPermission403The caller can read the resource but lacks the permission the change needs.
OrganizationNotFound404The caller is not a member of the organization in the path.
EngineNotFound404The engine does not exist or the caller cannot read it.
GlossaryNotFound404The glossary does not exist or the caller cannot read it.
RulesetNotFound404The ruleset does not exist or the caller cannot read it.
GlossaryInUse409A glossary cannot be deleted while an engine applies it.
RulesetInUse409A ruleset cannot be deleted while an engine applies it.
GlossaryTermsTaken409The glossary already holds a term with that source locale and text.
AttachmentsUnreachable422An 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.