Skip to content
On this page

API keys and tokens

Locize has two kinds of keys: an API key belongs to one project, a personal access token acts as you, in every project you belong to. The API and locize-cli take both; the MCP server takes a personal access token.

Which one

API keyPersonal access token
Reachesone projectevery project you belong to
Narrowed bya role and versionsscopes, combined with your role in each project
Created inthe project's Settings › Integration, card API Keysyour profile, Access tokens
Fora server job or CI for one projectyou: locize login, the MCP server, several projects or tenants

Both go on a server, in CI or on your machine, never into code your users load: anyone could read the key there. More: Best practices.

API keys

You create API keys in the project's Settings › Integration, where the Project ID stands too; Locize may ask for your password first. Copy a key when you create it: it is shown only this once. Each key has a role:

  • read only reads translations, also of private versions;
  • user also writes: adds missing keys, updates translations, creates, renames and deletes namespaces, copies languages and versions, publishes versions;
  • admin also changes the structure: languages, versions, workspaces, tenants and members.

Limit a read only or user key to the versions it needs.

How many keys a project can have depends on its plan. A key's name, role, versions and restrictions can be changed later; deleting it ends it at once. To replace a key, add a new one, switch your job to it, then delete the old one. The list of keys shows when each was last used.

Personal access tokens

You create personal access tokens in your profile, under Access tokens; Locize may ask for your password first. Copy a token when you create it: it is shown only this once. Its scopes say what it may do; read, write and manage are on by default:

  • read downloads translations and lists projects, versions, languages and workspaces;
  • write changes translations, adds missing keys and changes namespaces;
  • manage publishes, copies, adds and deletes versions, and manages languages, workspaces and tenants;
  • admin invites members and lists them and their statistics.

A scope only opens a door your role already has: a token with manage cannot publish where your role is user, and an accountant's token only reads. Signing in through the browser, with locize login or an MCP client, creates a token for you; it shows in the same list.

Revoking a token ends it at once. A token can get an expiration date; it then stops working on that date.

Restricting where a key works

Both kinds of key can be limited to Allowed IP addresses, for example your CI server's, and to Allowed origins. You set them on a key that exists, not while creating it.

Allowed origins checks the Origin or Referer header a browser sends: a request without one is refused, and a script can send any value. For a server or CI key, use Allowed IP addresses.

With a token limited either way, an MCP client cannot use the tools that go through the API, such as update_translations and report_missing_keys: those calls come from Locize's servers, without your IP address or an origin.

Using a key

Send it in the Authorization header; Locize tells the two kinds apart by their prefix, lz_api_ or lz_pat_:

bash
curl -X POST \
  -H "Authorization: Bearer lz_api_..." \
  -H "Content-Type: application/json" \
  -d '{"button.save": "Save"}' \
  https://api.locize.app/missing/<project-id>/latest/en/common

Reading published translations needs no key.