Webhooks

Last modified: November 17, 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

How to set up webhooks

Webhook integration is available in the 'Integrations' tab under 'Webhooks' section. To set up webhooks, click 'Add webhook'. Then, fill in the form and click 'Add webhook'. Every webhook invocation is registered, so you can check the history of webhook invocations, execution time, execution URL, trigger, response status code and body.

webhook configuration

Sample webhook executions

Sample webhook payload triggered by 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 namedescription
triggersubscribed trigger type
projectTokenproject token
projectNameproject name, it can be changed in project settings
accountNamename 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
jobIdjob identifier, for example auto-translation job
changeslist of translation modifications during the change

Possible trigger field values

trigger valueEvent description
ENVIRONMENT_PUBLICATIONOn publication to Production environment
PUBLICATIONOn publication to Latest environment
CHANGEEvery saved translation change via API, WEB or CLI
REVERTOn reverted translations via WEB
IMPORTOn every file import via WEB, API or CLI
EXPORTOn every file export via WEB, API or CLI
EXTRACTIONOn translations CLI extraction via CLI
AUTO_TRANSLATION_SUCCESSOn every succeeded auto-translation job started via WEB, API or CLI. jobId will contain finished job identifier
AUTO_TRANSLATION_FAILEDOn 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.