Let an agent translate
Give an AI agent a translator token and let it fill the missing translations through MCP or the JSON API.
- Enable the language in Languages, for example Spanish.
- In Agent tokens, create a token with the translator role, for the projects to translate, with an expiry.
- Connect the agent to
/mcp/with the token. It getsTranslations_list(what is missing or outdated),Translations_read(the original and its translation) andTranslations_save. Agents without MCP use these two calls of the JSON API:
# What is missing or outdated
curl -X POST https://docs.example.com/api/ -H "Authorization: Bearer docs_…" -H "Content-Type: application/json" \
-d '{"schema":"translations?language=es"}'
# Save one translation
curl -X POST https://docs.example.com/api/ -H "Authorization: Bearer docs_…" -H "Content-Type: application/json" \
-d '{"schema":"translations_save","data":{"reftype":"pages","refid":"…","language":"es","fields":{"title":"…","body":"…"}}}'- The agent reads each original with
Translations_read(translations_readin the JSON API).
Every translation is in the history with the name of the token. Review them in Translations, and revoke the token when you are done.