Lexicon webhooks are emitted by the Accounts API when lexicon entries are created or updated via PUT /lexicons.
Events
| Action | Event name |
|---|---|
| create or update lexicons (PUT /lexicons) | lexicons.updated |
Payload example (lexicons.updated)
The webhook payload includes the standard envelope (id, attemptId, created, event, livemode) and a data object with the following fields:
{
"attemptId": "20ebdb3d-85e1-47a4-a81d-7b6c7dd1a481",
"created": 1634755434,
"data": {
"providerId": "52a377ec430c7d4e220001fc",
"apiKey": "the-x-api-key-header-value",
"data": [
{
"_id": "6170632a61ecfa13a78c6eb9",
"key": "lexicon.key.example",
"values": { "en-us": "Example", "es-ar": "Ejemplo" },
"context": ["websales"],
"accountId": "52a377ec430c7d4e220001fc"
}
]
},
"event": "lexicons.updated",
"id": "2e32d603-a379-46f9-9393-ba4d1859e2fe",
"livemode": true
}
Payload fields (lexicons.updated)
| Field | Type | Description |
|---|---|---|
| id | string | Webhook event id |
| attemptId | string | Delivery attempt id |
| created | number | Unix timestamp when the event was created |
| event | string | lexicons.updated |
| livemode | boolean | Whether the account is in live mode |
| data | object | Custom payload from the API |
| data.providerId | string | Account id (ObjectId) that owns the updated lexicons |
| data.apiKey | string | Value of the X-API-KEY header used in the request |
| data.data | array | The lexicon entries that were created or updated (same shape as PUT response entries) |