LemuAIDocs

Guides · 5 min read

Webhooks

Get signed LemuTickets events at your endpoint: subscribing, the event list, payloads, verifying signatures and retries

Open in ChatGPTOpen in ClaudeMarkdown

Webhooks tell your system when something happens in LemuTickets, such as a new ticket, a status change or a customer reply, so you don't have to poll. LemuTickets sends an HTTPS POST with a JSON body to your URL for every event you subscribe to.

Subscribe#

Either in the app:

  1. Open Settings → API keys and webhooks and select the Webhooks tab.
  2. Click Add webhook.
  3. Enter the Endpoint URL, an optional Description, the Events to send (use area.* for every event of that kind, for example ticket.*), and optionally the Projects to send events for. Empty means all projects.
  4. Copy the signing secret. It is shown only once.

Or with the API: Create a webhook.

The URL must be public. Private, local and internal addresses are refused.

On the same tab you can see each webhook's Deliveries with the response your endpoint gave, Send again a delivery, Send test event, and Rotate secret. The old secret stops working as soon as you rotate it.

Events#

EventWhen
ticket.createdA ticket was created
ticket.updatedFields on a ticket changed
ticket.transitionedA ticket moved to another status
ticket.assignedThe assignee or team changed
ticket.resolvedA ticket reached a resolved status
ticket.reopenedA resolved or closed ticket was reopened
ticket.closedA ticket was closed
ticket.deletedA ticket was deleted
ticket.mergedA ticket was merged into another
ticket.escalatedA ticket was escalated
ticket.linkedA link between tickets was added
ticket.major_incidentA ticket was flagged or unflagged as a major incident
comment.createdA reply or internal note was added
comment.delivery_updatedA reply's delivery status changed (for example, the email or WhatsApp message was delivered or failed)
sla.warningAn SLA target is close to breach
sla.breachedAn SLA target was breached
csat.submittedA requester rated a ticket
approval.requestedAn approval was requested
approval.decidedAn approval was approved or rejected
worklog.createdTime was logged on a ticket
requester.createdA requester was created
requester.updatedA requester was updated
account.updatedAn account was created or updated
assignment.unassignedA ticket stayed unassigned longer than the project allows
asset.createdAn asset was created
asset.updatedAn asset changed
problem.createdA problem record was created
problem.updatedA problem record changed
change.createdA change request was created
change.updatedA change request changed status or was voted on
visit.updatedA field visit was scheduled or changed
visit.reminderA field visit is due tomorrow
ai.triagedThe AI classified a new ticket
autopilot.action_proposedAutopilot proposed an action (inside its review window)
autopilot.action_doneAutopilot carried out an action
lemu.issue_suggestedLemu AI found an issue in a conversation and it is waiting for review
webhook.disabledA webhook subscription was turned off after repeated failures

GET /v1/events/catalog returns the same list as {"data": [{"type", "description"}]}.

Patterns use * as a wildcard: ticket.* matches every ticket event, * matches everything. Each pattern must match at least one event.

When a webhook is limited to some projects, it only gets events that belong to a ticket in those projects. Events that are not about a ticket (requesters, accounts, webhook.disabled) are only sent to webhooks without a project filter.

Payload#

Every delivery has the same envelope:

JSON
{
  "id": "evt_48213",
  "type": "ticket.transitioned",
  "created_at": "2026-11-25T09:30:02.114210+00:00",
  "org_id": "5e7a9c1b-3d2f-4a6e-8b0c-2d4f6a8c0e1b",
  "data": {
    "actor": {
      "type": "user",
      "id": "0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b",
      "name": "Arjun Mehta"
    },
    "ticket": {
      "id": "2f9c7e1a-5b3d-4c8e-9a6f-1d0e2b4c6a8f",
      "key": "SUP-1042",
      "title": "Refund not received for order 58213",
      "status": { "id": "6e1f2a3b-8c4d-4f5e-a6b7-c8d9e0f1a2b3", "name": "In progress", "category": "open", "color": "blue" },
      "status_category": "open",
      "priority": "p2",
      "external_id": "ERP-CMP-58213",
      "version": 4
    },
    "changes": {},
    "details": {
      "from": "Open",
      "to": "In progress",
      "from_category": "open",
      "to_category": "open",
      "transition": "Start work"
    }
  }
}
FieldDescription
idThe event id. It stays the same on every retry and redelivery, so use it to ignore events you have already handled.
typeThe event name from the list above.
created_atWhen the event was queued.
org_idYour organization's id.
data.actorWho caused it: type is user, api_key, integration, requester, automation, ai or system, with id and name.
data.ticketFor ticket and comment events: the whole ticket as it is when the event is sent. See the ticket object. Shortened above.
data.changesFor ticket.updated: each changed field as [old, new], for example {"priority": ["p3", "p1"]}. Empty for other events.
data.commentFor comment.* events: the comment, in the same shape as List comments.
data.detailsEvent-specific details, for example the from and to status of a transition, or the minutes of a worklog.

Events that are not about a ticket put their fields directly in data, for example {"actor": {"type": "system"}, "requester_id": "8b4d6f2a-..."} for requester.created. Fetch the full object with the API if you need it.

comment.created is sent for internal notes too. Check data.comment.visibility (public or internal) before showing a comment to a customer.

Headers#

HeaderValue
Content-Typeapplication/json
User-AgentLemuTickets-Webhooks/1.0
X-LemuTickets-EventThe event type, for example ticket.created
X-LemuTickets-DeliveryThe delivery id. A manual Send again gets a new one
X-LemuTickets-Signaturet=<unix time>,v1=<signature> (see below)

Verify the signature#

Check every delivery before you trust it. The signature is an HMAC-SHA256, in hex, of the timestamp, a dot, and the raw request body, using your webhook's signing secret (whsec_...) as the key:

Text
v1 = hex(HMAC_SHA256(secret, "<t>.<raw body>"))
  1. Read t and v1 from the X-LemuTickets-Signature header.
  2. Compute the HMAC over the raw body bytes as received. Parsing and re-encoding the JSON changes the bytes and breaks the check.
  3. Compare with v1 in constant time.
  4. Reject the delivery if t is more than 5 minutes from your clock, to stop replays.
JavaScript
import crypto from "node:crypto";
import express from "express";
 
const app = express();
const SECRET = process.env.LEMU_TICKETS_WEBHOOK_SECRET; // whsec_...
 
app.post("/lemutickets/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const header = req.get("X-LemuTickets-Signature") || "";
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2)));
  const t = Number(parts.t);
  const expected = crypto
    .createHmac("sha256", SECRET)
    .update(`${parts.t}.`)
    .update(req.body)
    .digest("hex");
  const ok =
    parts.v1 &&
    parts.v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected)) &&
    Math.abs(Date.now() / 1000 - t) <= 300;
  if (!ok) return res.status(400).send("bad signature");
 
  const event = JSON.parse(req.body.toString("utf8"));
  // Handle the event, then answer quickly with a 2xx
  res.sendStatus(204);
});

Responding and retries#

  • Answer with any 2xx status within 10 seconds. Do slow work after you answer, for example in a queue.
  • Redirects are not followed, and any other status, a timeout or a connection error counts as a failure.
  • Failed deliveries are retried with growing gaps (30 seconds, 1 minute, 2 minutes, 4 minutes and so on, up to 1 hour between tries) for 24 hours. After that the delivery is marked failed. You can still send it again from Deliveries.
  • Deliveries go out within about 10 seconds of the event, several at a time, so they can arrive out of order. Use created_at and the ticket's version to tell which is newer.
  • After 50 failed attempts in a row, the webhook is turned off, its pending deliveries are marked failed, and a webhook.disabled event is sent to any other webhook subscribed to it. Fix your endpoint, then turn Send events back on in the webhook's settings. That resets the failure count.

Test your endpoint#

Send test event on the webhook (or POST /v1/webhooks/{webhook_id}/ping) sends a signed webhook.ping event straight away:

JSON
{
  "id": "ping_Xk2pQ9aB",
  "type": "webhook.ping",
  "created_at": "2026-11-25T09:31:10.004512+00:00",
  "org_id": "5e7a9c1b-3d2f-4a6e-8b0c-2d4f6a8c0e1b",
  "data": {
    "webhook_id": "f2a4c6e8-0b1d-4f3a-8c5e-a7c9e1b3d5f7",
    "message": "Webhook is reachable"
  }
}