API: Publish translations

Last modified: November 21, 2022Author: Jakub Pomykała

This endpoint allows you to publish currently saved translations in the translation editor to the translation hosting. You can see your project environments in 'Hosting' tab of your project. Please note that this endpoint requires authorization and it's only available for paid plans.

POST Endpoint

https://api.simplelocalize.io/api/v1/translations/publish

Publish translations

By default, translations are published in the latest environment.

curl -X POST \
     -H 'X-SimpleLocalize-Token: <API_KEY>' \
     https://api.simplelocalize.io/api/v1/translations/publish

A request to this endpoint may require some time to complete. Please do not send another request until the previous one is completed, otherwise endpoint will return error response. Please try to avoid sending too many requests in a short period of time, otherwise rate-limiter service may block your next requests a while. Our recommendation is to send a request to this endpoint only when you are ready to publish translations and not more often than once per minute.

Publish translations to the production environment

To publish translations to production environment, you need to specify _production environment in environment query parameter.

curl -G -X POST \
     -d 'environment=_production' \
     -H 'X-SimpleLocalize-Token: <API_KEY>' \
     https://api.simplelocalize.io/api/v1/translations/publish

Responses

Successful response

A successful response is returned with 200 status code after successful publication.

{
  "msg": "OK",
  "status": 200,
  "data": {
    "message": "OK"
  }
}

Error response

The error response is returned when the publication couldn't be started or completed.

{
  "msg": "General error message",
  "status": 400,
  "errors": [
    "More detailed error message 1",
    "More detailed error message 2"
  ]
}