LM-Kit OneDocs2026.11.1lm-kit.comEULA
Integration

Webhooks

A document management system waiting for a transcription, a CRM that files a finished agent run, a chat channel that should hear when a run waits for approval: none of them should poll. A webhook posts each event to their URL the moment it happens, signed, and retries until it lands.

1Subscribe#

Open Admin > Connect > Webhooks and choose New webhook: the URL, the events it receives (none checked receives them all), and whose events:

Whose events Receives
Every owner Every event of every API key owner, and the server's alerts
An API key Only that key's owner's runs, approvals, escalations and jobs; never the server's alerts

Saving shows the signing secret once; New secret replaces it.

Event When
run.awaiting_approval, run.awaiting_input A run stops for a person
run.handed_off A run hands its work to a person
run.completed, run.failed, run.cancelled A run ends
approval.decided Someone approves or denies a call
escalation.taken, escalation.resolved A hand-off moves through the escalations inbox
job.completed, job.failed, job.cancelled An asynchronous job ends
alert.raised An alert is raised

2What arrives#

POST /hooks/lmkit HTTP/1.1
Content-Type: application/json
X-LMKit-Event: run.completed
X-LMKit-Delivery: evt_3a62e8850e7c30b5262e7ffd0cf853be
X-LMKit-Timestamp: 1794790366
X-LMKit-Signature: sha256=74e03d5d1202d5b35afd163c7cf2ca99180dbd0aaa5ecd84e242704df53ef225

{"id":"evt_3a62e8850e7c30b5262e7ffd0cf853be","type":"run.completed","created_at":"2026-11-16T00:51:06Z",
 "data":{"run_id":"run_71c9…","kind":"workflow","agent":"quote-check","status":"completed","output":"Quote: 12"}}

Check every delivery before trusting it: the signature is sha256= and the hex HMAC-SHA256 of {timestamp}.{body} under the secret, over the exact bytes received.

import hashlib, hmac

def verified(secret: str, headers: dict, body: bytes) -> bool:
    timestamp = headers["X-LMKit-Timestamp"]
    expected = "sha256=" + hmac.new(secret.encode(), timestamp.encode() + b"." + body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, headers["X-LMKit-Signature"])

Answer any 2xx once the event is safely stored. X-LMKit-Delivery names the event and is the same on every retry: drop an event you already have.

3Retries and given-up events#

A delivery that gets no answer or a non-2xx answer is retried after 30 seconds, 2 minutes, 10 minutes, 30 minutes, 2 hours and 6 hours. After the last retry it is given up and an alert says so. Deliveries on a webhook's row lists every event of the last week with each attempt (status and duration), and Redeliver puts any event back in the queue.

Each event is written to a shared outbox when it happens, and one node of a farm posts the outbox (the webhook-delivery job holds a lease, listed on Admin > Operate > Jobs), so an event leaves once, whichever node it happened on.

Test on a webhook's row posts a signed webhook.test event at once and shows the raw exchange: the request as sent and the receiver's answer.