Use webhooks to receive instant notifications about events happening in Lokalise as POST requests. 

The webhook is sent once as the event happens and it expect any answer from your side with 2xx status code. We do not sign the requests, so you may want to restrict the incoming requsts from IP's 159.69.72.82, 138.201.23.91 and 94.130.129.237.

To set up the integration for your project:

  1. Navigate to project settings > Integrations
  2. Click Connect at the required integration
  3. Enter configuration parameters
  4. Select desired events
  5. Click Enable integration

Changes

We've completely rewritten webhook implementation. Projects, where old webhook system was used will have a Webhooks (legacy) integration, which is documented here. Here is what's new in current version:

  • You can subscribe and unsubscribe from webhooks programmatically, using our API.
  • Retry mechanism (see below).
  • Secret is sent in header, so you can validate the request.
  • Payload for some events has been updated.

Requirements

  • Accept POST requests
  • Return 2xx  status code (200, 201, 202 etc.)

Retry mechanism

In case webhook was not sent our system will retry to re-send it up to 4 times:

  • in ± 10 minutes, after initial retry.
  • in ± 40 minutes, after initial retry.
  • in ± 3 hours, after initial retry.
  • and in ± 24 hours, after initial retry.

Each webhook is independent and is sent separately.

Available webhook events

  • project.imported 
  • project.exported 
  • project.snapshot 
  • project.languages.added 
  • project.language.removed  
  • project.language.settings_changed 
  • project.key.added 
  • project.key.modified 
  • project.keys.deleted 
  • project.key.comment.added 
  • project.translation.updated 
  • project.translation.proofread 
  • project.contributor.added 
  • project.contributor.deleted 
  • project.task.created 
  • project.task.closed 
  • project.task.deleted 
  • project.task.language.closed 

Webhook payload examples

  • project.imported :
{
  "event": "project.imported",
  "import": {
    "filename": "en.json",
    "format": "json",
    "inserted": 231,
    "updated": 0,
    "skipped": 0
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.exported :
{
  "event": "project.exported",
  "export": {
    "type": "json",
    "filename": "files/export/138c1ffa0ad94848f01f980e7f2f2af19d1bd553/67d1a7ff9cab3a57e32ea71c4561a58d/locales.zip",
    "platform": "Web"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.snapshot :
{
  "event": "project.snapshot",
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.languages.added :
{
  "event": "project.languages.added",
  "languages": [
    {
      "id": 734,
      "iso": "it",
      "name": "Italian"
    }
  ],
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.language.removed :
{
  "event": "project.language.removed",
  "language": {
    "id": 734,
    "iso": "it",
    "name": "Italian"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.language.settings_changed :
{
  "event": "project.language.settings_changed",
  "language": {
    "id": 734,
    "iso": "it",
    "name": "Italian"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.key.added :
{
  "event": "project.key.added",
  "key": {
    "id": 16307699,
    "name": "test.title",
    "base_value": "Hello, world!"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.key.modified :
{
  "event": "project.key.modified",
  "key": {
    "id": 16307699,
    "name": "test.title_modified",
    "previous_name": "test.title"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.keys.deleted :
{
  "event": "project.keys.deleted",
  "keys": [
    {
      "id": 16307699,
      "name": "test.title_modified"
    },
    {
      "id": 16307700,
      "name": "test.to_delete"
    }
  ],
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.key.comment.added :
{
  "event": "project.key.comment.added",
  "comment": {
    "value": "My comment to test.title key"
  },
  "key": {
    "id": 16307701,
    "name": "test.title"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.translation.updated :
{
  "event": "project.translation.updated",
  "translation": {
    "id": 84835169,
    "value": "Hello, %s!"
  },
  "language": {
    "id": 640,
    "iso": "en",
    "name": "English"
  },
  "key": {
    "id": 16307701,
    "name": "test.title"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.translation.proofread :
{
  "event": "project.translation.proofread",
  "translation": {
    "id": 84835169,
    "value": "Hello, %s!",
    "is_proofread": true
  },
  "language": {
    "id": 640,
    "iso": "en",
    "name": "English"
  },
  "key": {
    "id": 16307701,
    "name": "test.title"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.contributor.added :
{
  "event": "project.contributor.added",
  "contributor": {
    "email": "contributor@mycompany.com"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.contributor.deleted :
{
  "event": "project.contributor.deleted",
  "contributor": {
    "email": "contributor@mycompany.com"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.task.created :
{
  "event": "project.task.created",
  "task": {
    "id": 5022,
    "title": "Headings translation",
    "due_date": "2019-08-01 00:00:00",
    "description": "Task description"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.task.closed :
{
  "event": "project.task.closed",
  "task": {
    "id": 5022,
    "title": "Headings translation",
    "due_date": "2019-08-01 00:00:00",
    "description": "Task description"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.task.deleted :
{
  "event": "project.task.deleted",
  "task": {
    "id": 5022,
    "title": "Headings translation",
    "due_date": "2019-08-01 00:00:00",
    "description": "Task description"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}
  • project.task.language.closed :
{
  "event": "project.task.language.closed",
  "language": {
    "id": 640,
    "iso": "en",
    "name": "English"
  },
  "task": {
    "id": 5022,
    "title": "Headings translation",
    "due_date": "2019-08-01 00:00:00",
    "description": "Task description"
  },
  "project": {
    "id": "138c1ffa0ad94848f01f980e7f2f2af19d1bd553",
    "name": "TheApp Project"
  },
  "user": {
    "email": "jdoe@mycompany.com",
    "full_name": "John Doe"
  },
  "created_at": "2019-07-29 12:18:31",
  "created_at_timestamp": 1564395511
}


Receiving webhooks in PHP (example)

$input = @file_get_contents("php://input");
$data = json_decode($input, true);
http_response_code(200);
Did this answer your question?