Skip to main content
Workchats POSTs signed events to your App’s registered callback URL. There is one URL per App, shared across every company that installs it. Every event has one flat type, and data.id names the entity the type is about. Ignore a type you don’t know, because new ones can be added in /v1. People can click an action button only once their Workchats client shows one. See Blocks for how rendering rolls out.

Envelope

id is unique per event, so a retried delivery is safe to ignore if you’ve already processed that id. created_at is ISO 8601 in UTC with milliseconds.

Event types

Each type has its own section, with an example body, on the Callbacks reference. For a user.*, conversation.* or app.*_conversation event, re-read the entity from data.id to get its current state.
directory.changed and data.kind are gone. The one-time correction replaced them with the flat types above. conversation.created became app.added_to_conversation.

Signature verification

Every callback carries:
<hex> is the lower-case hex HMAC-SHA256(signing_secret, "<timestamp>.<raw request body>"). Verify against the raw request body. Parsing it to JSON and re-serializing before you check the signature will not match.
Node
Reject anything where the signature doesn’t match, or where the timestamp is more than 5 minutes old. During a signing-secret rotation, Workchats sends two comma-separated values, v1=<new>,v1=<old>, for 24 hours. Check every value in the header rather than only the first.

Check your code against a worked example

This example is also in the OpenAPI description. Run the function above on these inputs to confirm your verification matches Workchats’. The body is one line and the signature covers exactly these bytes.
  • Signing secret: whsec_docs_example
  • X-Workchats-Timestamp: 1790593600
  • Body: {"id":"evt_5f0c7a52-6d1e-4c1b-9a8e-2f4b7c3d1e90","type":"user.deactivated","workspace_id":"cmp_0b7e4c1a-2d3f-4a5b-8c6d-7e8f9a0b1c2d","created_at":"2026-09-28T11:06:40.000Z","data":{"id":"usr_9a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"}}
  • X-Workchats-Signature: v1=fe1fc8d58be29674f3a112ce60aebb85ff039862e07205ae8ea36c60bab46451
Node
The timestamp in this example is fixed, so skip the 5-minute freshness check when you run it.

Delivery and retries

HTTPS only, TLS 1.2+, no redirects followed. A response other than 2xx within 3 seconds counts as a failure and is retried at 1 minute, 5 minutes, and 30 minutes, with the same event id. The 3 seconds cover the whole exchange, DNS lookup included. X-Workchats-Attempt counts deliveries of the same event from 1. Respond 2xx as soon as you’ve durably queued the event — don’t do slow work in the request path before responding. interaction is the one event where the response body matters; see below.

Interactions

An interaction fires when someone clicks an action button — a button with an action_id — on a message your bot posted. Link buttons (url) open their link and send nothing.
Workchats only sends a click from someone who can read the message and whom your App can see. A guest hidden from your App can’t click your buttons. In a group or channel, “can see” is the same rule as message history, so a guest who shares the conversation with your bot can click even though GET /v1/users/{id} returns 404 for them and user.email is absent. Treat that 404 as “a guest you can’t look up”, not as an error.

Replying to the person who clicked

The person is waiting while the first attempt is in flight, so it’s sent synchronously, with the same 3-second budget (DNS included). Answer with a 2xx inside it. Optionally, make the body JSON with an ephemeral string:
Workchats shows that text to the person who clicked, and only to them. It’s never stored, never shown to anyone else, and never posted in the conversation. It’s plain text: control characters (other than a newline) and bidirectional-override characters are stripped, surrounding whitespace is trimmed, and it’s cut to 500 characters. Any other 2xx body — empty, not JSON, no ephemeral key — shows nothing. Only the first 8 KB of the body is read, so a longer body isn’t valid JSON by the time it’s parsed and shows nothing either; keep the reply small. To change what everyone sees, edit the message instead with PATCH /v1/messages/{id}, using data.message.id.

When you don’t answer in time

If the first attempt fails — no response in 3 seconds, or anything other than a 2xx — the person sees that the click was sent and may take a moment. It isn’t shown as a failure, so they don’t click again and make your App act twice. The same event, with the same id, is retried at 1, 5 and 30 minutes (X-Workchats-Attempt 2 to 4). No ephemeral text is shown for a retry: the person has moved on, so a retry’s response body is ignored. If Workchats can’t queue the retry, none is sent: the click fails with 503 interaction_unavailable and the person is asked to click again. Each retry re-checks the click first, and is dropped instead of sent if the person can no longer read the message, the message or the button is gone, the person has been deactivated, your App can no longer see them, the company has turned the public API off, or your App has been disabled, uninstalled or deleted, or no longer has a callback URL. A retry also rebuilds user when it’s sent, so email can be missing from a retry if your App or the person has since stopped sharing it.

Double clicks

Repeat clicks on the same button by the same person that fall in the same 10-second window carry the same event id, and each one still reaches you — up to 30 clicks per person per minute. Clicks over that limit get 429 rate_limited and are never sent to you. Two clicks either side of a window boundary get two ids. Deduplicate on id, and make the action itself safe to repeat (claiming an already-claimed lead should be a no-op) for anything that matters.

Example handler

Verify the signature against the raw body, deduplicate on id, and reply within 3 seconds. This uses isValidWorkchatsSignature from Signature verification above. It works on Express 4 and 5: the handler catches its own errors and answers 500, because Express 4 doesn’t catch a rejected async handler.
Node
alreadyHandled, markHandled, claimLead and enqueue stand in for your own storage and queue. Mark an id only after its work succeeds: marked first, a failure would make Workchats’ retry look like a duplicate and the click would be lost. If the real work can’t finish in 3 seconds, queue it, reply with something like {"ephemeral": "Claiming…"}, and edit the message when it’s done.