Webhooks

Last modified: June 30, 2022Author: Jakub Pomykała

Webhooks allow external services to be notified when certain events happen. When the specified events happen, we’ll send a POST request to each of the URLs you provide.

translation management system webhooks

Sample webhook payload triggered on translation editor changes.

{
  "trigger": "CHANGE",
  "projectToken": "94a08da1fecbb6e8b46990538c7b50b2",
  "projectName": "My project",
  "accountName": "Jakub",
  "jobId": null,
  "changes": [
    {
        "action": "CREATE_KEY",
        "key": "hello-world"
    },
    {
        "action": "CHANGE_TRANSLATION",
        "key": "hello-world",
        "languageKey": "en",
        "newTranslation": "Hello World!"
    },
    {
        "action": "CHANGE_KEY",
        "oldKey": "hello-world",
        "newKey": "goodbye-world"
    },
    {
        "action": "DELETE_KEY",
        "key": "goodbye-world"
    }
  ]
}

Sample webhook payload triggered on auto-translation success.

{
  "trigger": "AUTO_TRANSLATION_SUCCESS",
  "projectToken": "94a08da1fecbb6e8b46990538c7b50b2",
  "projectName": "My project",
  "accountName": "Jakub",
  "jobId": "69b569c0e04e1b955c1e14c52e02665f",
  "changes": [
    {
        "action": "CHANGE_TRANSLATION",
        "key": "hello-world",
        "languageKey": "en",
        "newTranslation": "Hello World!"
    }
  ]
}

List of fields in webhook payload

field name description
trigger subscribed trigger type
projectToken project token
projectName project name, it can be changed in project settings
accountName name of the user who made a change or started a job. If the request was made via API or CLI, then the field may be absent or contain null. The name is taken from user account settings
jobId job identifier, for example auto-translation job
changes list of translation modifications during the change

Possible trigger field values

trigger value Event description
PUBLICATION Translations publication via API or WEB
CHANGE Every saved translation change via API, WEB or CLI
REVERT On reverted translations via WEB
IMPORT On every file import via WEB, API or CLI
EXPORT On every file export via WEB, API or CLI
EXTRACTION On translations CLI extraction via CLI
AUTO_TRANSLATION_SUCCESS On every succeeded auto-translation job started via WEB, API or CLI. jobId will contain finished job identifier
AUTO_TRANSLATION_FAILED On every failed auto-translation job started via WEB, API or CLI. jobId will contain failed job identifier

Webhook URL cannot contain IP addresses, localhost domain, or SimpleLocalize API. It must be a valid URL. URL must respond to a HEAD request to be added.