Quickstart
Prerequisites
- Authentication set up. See the Authentication guide, and store the API token as a CI secret. The pipeline exchanges it for the short-lived JWT the calls below send as
Bearer <JWT_TOKEN>. - Phrase Strings command-line interface (CLI) installed. It provides
phrase pushandphrase pull. - A project ID, the project code taken from the project in Phrase.
- A
.phrase.ymlconfig file. Runphrase initto scaffold one; it holdspush.sourcesandpull.targets. - A CI platform such as GitHub Actions or GitLab CI. You author the pipeline YAML.
How-to
The pipeline has two halves. Source strings go up when code changes. Finished translations come down before the build ships. Keep the two stages separate, since translation happens between them.-
Push source strings on every change. Run
phrase pushin the job that reacts to a code change; the command-line interface uploads each source file. The direct API call is the multipart upload below. Processing is asynchronous: the response returns 201 with an upload id, so poll the upload status until state reads success. Prefer this file upload over a per-key loop. A 422 means the request has a bad field, usually the file format or an unknown language code; theerrorsarray names it, so correct it and retry. To get translations back sooner, setautotranslateon the upload so machine translation (MT) fills them in as the file imports. -
Pull finished translations before the build. Translation runs inside Phrase, by people or machine translation, and is outside the pipeline. Run
phrase pull, or call the two-step download below: start the download, then poll the status until it reads completed and fetchresult.url, which is valid for 15 minutes. If the status stays processing, keep polling on a short interval rather than firing many parallel requests.
When it breaks: common errors
A 4xx response tells you what to fix. For a 422, theerrors array names the exact field.
422: bad file or language
The file format is wrong, or the language code is not one Phrase recognizes. The
errors array names the field, so correct it and retry.404: wrong ID
The project ID, or a locale or download ID, does not resolve. Check the ID in the path and that the token can access it.
403: forbidden
The token is missing the write scope for uploads and locale creation, or read for downloads, or you lack permission. Use a token with the right scope.
429: rate limited
A 429 means too many requests in a short time: wait for the window to reset, then retry.
Troubleshooting
Status
Check the Phrase status page before assuming your own request is wrong.
Where to get help
If Phrase is healthy and the
errors array does not explain the failure, contact support.Help center
Support articles and answers to common Phrase questions.
Next steps
- Review the reference pages this pipeline calls: Upload a new file, and Initiate a locale download.
- Wire the delivery half: Push translation fixes without a release, and Auto-sync translation keys on code push.