Automate translations with the Sleekdocs API

16 October 2026

Developers add keys in code; translators fill them in; someone has to move texts between the two. The Sleekdocs Translate API lets your pipeline do that part.

Create a key for the job

On the API keys page in Sleekdocs Translate, create a key for your pipeline. Limit it to the one project it works on, choose only the permissions it needs, and give it a lifetime: 8 hours for an experiment, 90 days or a year for a pipeline. A key can never do more than you can, and it stops working if you leave the team. Store it as a secret in your CI system, for example SLEEKDOCS_KEY.

Push new keys from the code

When a developer adds checkout.title to the English file, the pipeline can add it to Sleekdocs with its English text. create-only adds new keys and leaves existing ones alone, so translators' and copywriters' edits are never overwritten. Run it with "dryRun": true first to see what would change.

API=https://translate.sleekdocs.com/api/v1/api/translate

curl -X PATCH -H "Authorization: Bearer $SLEEKDOCS_KEY" -H "Content-Type: application/json" \
  "$API/projects/$PROJECT/keys" \
  -d '{"mode": "create-only",
       "items": [{"key": "checkout.title", "values": {"en": "Checkout"}}]}'

A key with the write permission may change texts; adding keys also needs keys. Up to 1,000 keys fit in one call.

See what's left to translate

List the keys a language still lacks, for a report in the pull request or a message to your translators:

curl -H "Authorization: Bearer $SLEEKDOCS_KEY" \
  "$API/projects/$PROJECT/keys?lang=sv&status=untranslated"

Publish and deploy to test after a merge

A key with publish and deploy:test can release translated texts to your test environment on every merge, while production stays a decision for a person:

curl -X POST -H "Authorization: Bearer $SLEEKDOCS_KEY" -H "Content-Type: application/json" \
  "$API/projects/$PROJECT/publish" -d '{"languages": "changed"}'

curl -X POST -H "Authorization: Bearer $SLEEKDOCS_KEY" -H "Content-Type: application/json" \
  "$API/projects/$PROJECT/deploy" -d '{"env": "test", "languages": "all", "revision": "latest"}'

Languages without changes are skipped, and the answer says what was published and deployed.

AI agents

The same keys work for an AI coding agent that adds texts while it writes code. Give it read and write on one project and a short lifetime; the API keys page shows when it was last used, and you can revoke it at any time. The API reference lists every call, and its machine-readable OpenAPI description tells the agent the same.

More in the docs.