Skip to content
On this page

Webhooks

A webhook lets Locize call your endpoint when something happens in your project, for example when a version is published or a namespace is fully translated, so your own systems can react without asking Locize.

Set it up

Set the webhook up in your project's Settings › Integration, with your endpoint's URL (HTTPS only) and, if it needs them, headers. By default every event except namespaceUpdated is sent; you can choose the events. Webhooks come with Growth and higher plans, and with the trial (pricing).

When you set or change the URL or the headers, Locize sends a test event, dummyTestEvent, and saves the setup only if your endpoint answers with a 2xx status code within 10 seconds.

Verifying deliveries

Every delivery carries the header X-Locize-Event-Signature. Its value is a signed token (a JWT, algorithm ES256) that ties the request to Locize and to the exact body you received:

ClaimMeaning
issalways locize
subthe project id (meta.project.id)
jtithe message id (id in the body)
iat, expissued at, valid for 5 minutes
body_sha256base64url-encoded SHA-256 of the raw request body

The public keys are published as a JSON Web Key Set at https://api.locize.app/documentation/webhook-signing-keys.json. Keys can rotate; the token names its key in the kid header, so verify through that URL instead of pinning a key.

To verify a delivery: read the raw body bytes before parsing them, verify the token against the key set (issuer locize, algorithm ES256), then compare body_sha256 with the hash of the raw body. Any JWT library that supports JWKS does the first part.

javascript
// Node.js (Express) with jose
import { createRemoteJWKSet, jwtVerify } from 'jose'
import { createHash } from 'node:crypto'

const KEYS_URL = 'https://api.locize.app/documentation/webhook-signing-keys.json'
const JWKS = createRemoteJWKSet(new URL(KEYS_URL))

const raw = express.raw({ type: 'application/json' })

app.post('/locize-webhook', raw, async (req, res) => {
  try {
    const token = req.get('X-Locize-Event-Signature')
    const { payload } = await jwtVerify(token, JWKS, {
      issuer: 'locize',
      algorithms: ['ES256']
    })
    const hash = createHash('sha256').update(req.body).digest('base64url')
    if (payload.body_sha256 !== hash) throw new Error('body hash mismatch')
  } catch (err) {
    return res.sendStatus(401)
  }
  res.sendStatus(204) // acknowledge first, process the event afterwards
  const event = JSON.parse(req.body)
  // ...handle event
})
python
# Python with PyJWT (pip install "pyjwt[crypto]")
import base64, hashlib, jwt

KEYS_URL = "https://api.locize.app/documentation/webhook-signing-keys.json"
jwks = jwt.PyJWKClient(KEYS_URL)

def verify(raw_body: bytes, token: str) -> dict:
    key = jwks.get_signing_key_from_jwt(token)
    claims = jwt.decode(token, key, algorithms=["ES256"], issuer="locize")
    digest = hashlib.sha256(raw_body).digest()
    digest = base64.urlsafe_b64encode(digest).rstrip(b"=").decode()
    if claims["body_sha256"] != digest:
        raise ValueError("body hash mismatch")
    return claims
csharp
// C# with Microsoft.IdentityModel.JsonWebTokens
const string KeysUrl = "https://api.locize.app/documentation/webhook-signing-keys.json";
var jwks = new JsonWebKeySet(await http.GetStringAsync(KeysUrl));
var parameters = new TokenValidationParameters
{
    ValidIssuer = "locize",
    ValidateAudience = false,
    IssuerSigningKeys = jwks.GetSigningKeys()
};
var handler = new JsonWebTokenHandler();
var result = await handler.ValidateTokenAsync(token, parameters);
if (!result.IsValid) return Results.Unauthorized();
var digest = Base64UrlEncoder.Encode(SHA256.HashData(rawBody));
if ((string)result.Claims["body_sha256"] != digest)
    return Results.Unauthorized();

The hash covers the exact bytes Locize sent, so read the body before any JSON parsing or re-serialization (ASP.NET: Request.EnableBuffering(); Express: express.raw() or the verify callback of express.json()). Allow a little clock tolerance if your servers drift; every JWT library has a leeway option.

Custom headers

The Headers field takes a JSON object, and every header in it goes with every delivery, for example { "X-Webhook-Token": "a-long-random-secret" }. A secret token there, which your endpoint checks, is a simpler way to authenticate deliveries than the signature, or an addition to it. Locize stores the headers encrypted and sends them only to your URL over HTTPS. A redirect to another host or to http is followed without them, so enter the final URL your endpoint answers at.

Good practice

  • Verify the signature on every delivery.
  • Answer at once with a 2xx status code (for example 204) and process the event afterwards. Locize waits up to 35 seconds, but a gateway in between often gives up earlier (AWS API Gateway answers 504 after 29 seconds).
  • Log the events you receive, for troubleshooting.

Events

Every event is a POST with a JSON body. By default every event except namespaceUpdated is sent; the setup dialog chooses others.

EventWhenFields of payload
languageAddeda language was addedlanguage, versions
languageDeleteda language was removedlanguage, versions
versionAddeda version was createdversion
versionDeleteda version was deletedversion
referenceLanguageChangedthe source language was changedfrom, to
orderCreateda translation order was createdservice, version
orderCompleteda translation order was completedservice, version
invitationAcceptedsomeone accepted an invitation to the projectnone; who is in meta.user
versionPublisheda version was published by hand; not with Auto publishversion
versionOverwrotea version was overwritten with anotherfrom, to
languageOverwrotea language was overwritten from another versionfrom, to, language
namespaceAddeda namespace was addednamespace, version
namespaceDeleteda namespace was deletednamespace, version
namespaceUpdateda namespace was changed; not sent by defaultnamespace, language, version
namespaceCompleteda namespace became fully translated in a languagenamespace, language, version
namespaceNotCompletedAnymorea fully translated namespace got untranslated keys in a languagenamespace, language, version
needsReviewThresholda language's review queue crossed the threshold of the review queue notification; sent once per crossinglanguage, version, count

A change of the source text of an existing key does not end namespaceCompleted: the translation still exists. The editor marks such translations as needing review, and needsReviewThreshold tells you when that queue grows beyond your threshold. To react to new translations without publishing by hand, use namespaceCompleted and namespaceNotCompletedAnymore.

The body

Every event has the same shape; payload holds the fields from the table, meta the project, the person who caused the event (if one did) and a link into Locize. The test event dummyTestEvent lists every event type in payload.messageTypes.

json
{
  "id": "427cc4dd-adf5-4fb8-ad8d-8508f2788fe3",
  "name": "versionPublished",
  "occurredAt": "2026-11-29T21:27:11.326Z",
  "message": "William Timberland published version production!",
  "payload": { "version": "production" },
  "meta": {
    "project": {
      "id": "23dad587-b3bf-4663-b15c-ad8d66213ac6",
      "name": "My app",
      "slug": "albo6dxk"
    },
    "user": {
      "id": "ab075147-c7a3-45d2-9b24-739ae2ed948a",
      "firstname": "William",
      "lastname": "Timberland"
    },
    "link": "https://www.locize.app/p/albo6dxk/v/production"
  }
}

Automatic deactivation

Every delivery expects a 2xx response. Locize does not retry a failed delivery, but it switches a webhook off only when your endpoint keeps failing:

  1. When your endpoint answers with a non-2xx status code, the failure is recorded on the webhook, together with its time.
  2. Further failures within the next three days leave the webhook switched on.
  3. A delivery that fails three days or more after the first recorded failure, with no successful delivery in between, disables the webhook automatically.
  4. A successful delivery clears the recorded failure.

Only the status code counts, whatever the response body is. A delivery that gets no answer at all (no connection, or no response within 35 seconds) neither counts as a failure nor clears one.

An automatically disabled webhook reads turned off after errors in Settings › Integration › Notifications, with the last error below it (e.g. Got a "504" http status code, but expecting "2xx"); the Project health card on the project's Overview names it as well.

To recover, fix your endpoint, then switch the webhook on again. Re-enabling starts the three days anew; it sends no test event.