Youniton Docs

Receive Youniton webhooks

Build an endpoint that checks the signature, skips repeats and answers within 10 seconds.

  1. #Get an endpoint registered

    An Admin registers your HTTPS URL in Administration › Automation › Webhooks. Youniton checks the URL: it must be https:// and must not resolve to a private, loopback, link-local or metadata address. Youniton does not follow redirects. The answer shows the secret, whsec_…, one time. Keep it in your secret store.

    Then a rule with the action "send webhook" or a help-desk connection with a webhook sends to it. The Admin can send a test delivery of type kanseo.test.

  2. #Read the raw body

    Verify the signature over the raw bytes of the body, before you parse the JSON. A parse and a new serialisation change the bytes.

  3. #Verify the signature

    The signed content is {webhook-id}.{webhook-timestamp}.{body}. The key is the secret after whsec_, base64-decoded. The header webhook-signature holds one or more v1,<base64> values, separated by spaces (two during a secret rotation). Accept the delivery when one value matches. Compare in constant time. Refuse a timestamp that is far from your clock, for example more than 5 minutes.

    Verify a Youniton delivery
    import { createHmac, timingSafeEqual } from "node:crypto";
    
    export function verifyYounitonWebhook(rawBody, headers, secret, toleranceSeconds = 300) {
      const id = headers["webhook-id"];
      const timestamp = headers["webhook-timestamp"];
      const signatures = (headers["webhook-signature"] || "").split(" ");
      if (!id || !timestamp) return false;
      if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;
    
      const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
      const expected = createHmac("sha256", key).update(`${id}.${timestamp}.${rawBody}`).digest();
      return signatures.some((s) => {
        const [version, value] = s.split(",");
        if (version !== "v1" || !value) return false;
        const given = Buffer.from(value, "base64");
        return given.length === expected.length && timingSafeEqual(given, expected);
      });
    }
    
    // Express: app.post("/youniton/webhooks", express.raw({ type: "application/json" }), handler)
    // and call verifyYounitonWebhook(req.body.toString("utf8"), req.headers, process.env.YOUNITON_WEBHOOK_SECRET)
  4. #Skip repeats

    Store each webhook-id that you processed. The id stays the same over every retry and every redelivery, and a crash between Youniton's send and its record can repeat a delivery. When you see a known id, answer 200 and do nothing.

  5. #Answer fast, then work

    Answer a 2xx within 10 seconds. Put slow work on your own queue. Another answer, a timeout or a network error makes Youniton retry: after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h. Answer 410 Gone only when you want Youniton to disable the endpoint.

#Help-desk events

EventWhen
request.createda request enters the connection's scope (never for the connection's own create)
request.updatedthe client status or the progress changes, or the linked ticket changes as the client sees it
request.message_posteda client-visible message; never an internal note
request.decideda triage decision: accepted, merged or rejected
request.closedthe request closes without a decision: withdrawn, no response, or the client changed
Body of a help-desk event
{
  "id": "…",
  "type": "request.message_posted",
  "occurredAt": "2026-10-20T13:10:00Z",
  "tenantId": "…",
  "connection": { "id": "…", "name": "Orbit service desk" },
  "request": {
    "key": "ORB-R22", "summary": "Gift cards cannot be applied", "status": "…", "impact": "urgent",
    "categoryName": "…", "submittedAt": "…", "updatedAt": "…", "externalReference": "orbit-desk:case:88412"
  },
  "message": { }
}

request is the client view, without the description and the field values. Read them with GET/help-desk/requests/{requestKey}. A linkedTicket appears only when the connection's client role can see the ticket.

#Calls back into Youniton

When your receiver calls the API because of a delivery, send X-Kanso-Causation: <webhook-id>. Then an automation loop stops at its depth limit.

Was this helpful?