Skip to content

Open a DueReason approval request from any system that can POST JSON

Any system that can send an HTTP POST -- an internal tool, a script, or a SaaS with no dedicated connector -- can open a signed DueReason approval request.

Updated · 7 min read

In short

  • The custom source is the one inbound webhook that is not built around a vendor's event shape: any system that can POST a JSON object can open a DueReason approval request, with a signed grant and a ledger entry behind it, not just a notification.
  • Unlike GitHub, Linear and GitLab, there is no vendor webhook settings page to point at DueReason -- your own system has to compute the HMAC signature itself and send it as the X-DueReason-Signature header on every delivery.
  • There is no event-type or state-transition filter: once the signature checks out, any JSON object body opens a request, mapped through a payload template straight from the top level of the body (not nested under an `issue` or `data` key, since a generic sender has no fixed envelope).
  • A console "send a sample payload" dry run exists for this source, the same as GitHub's, so you can check the template against a pasted example before wiring up the real sender.
  • GitHub, Linear, Jira and GitLab are the other sources on the same shape, each built around that vendor's own event and signature format; the custom source is the fallback for everything else -- an internal admin tool, a script, or a less-common SaaS with no dedicated connector.

A script, an internal admin panel or a SaaS tool with no dedicated DueReason connector can still need a human decision before it proceeds -- a support tool flagging an account for a refund, a deploy script asking before it touches a protected environment, a homegrown ops panel wanting sign-off before it runs. The custom inbound webhook turns one HTTP POST from that system into a real DueReason approval request, with a signed grant and a ledger entry behind the decision, instead of a Slack message someone has to remember to act on.

What actually happens

Each custom inbound endpoint ties one free-text name (shown in the console's endpoint list in place of a repository, label or team key) to one DueReason action. Unlike the GitHub, Linear and GitLab sources, there is no repository, label, team key or project path to match, and no particular event shape to recognize: once the delivery's signature checks out, DueReason opens a request against the action you chose every time, pre-filled from the event -- a title such as Custom webhook: Refund review, a reason naming the webhook (Opened automatically by the custom webhook "Refund review".), and whatever payload fields your template maps from the body you sent. From there it is a normal DueReason request -- it goes through the action's own workflow, routes to the approvers you configured, and produces the same signed, single-use grant any other request does.

Set it up in DueReason first

In Settings > Inbound webhooks, Add endpoint with source Custom asks for three things: Name (a free-text label for this endpoint, up to 100 characters, shown in the endpoint list so you can tell several custom sources apart), Action (which DueReason action the request opens against, picked from your organization's configured actions), and a Payload template -- JSON mapping that action's payload fields to the event you plan to send, for example { "accountId": "{{account.id}}", "reason": "{{reason}}" }. You also paste in a webhook secret here: a value *you* generate (16 to 500 characters), not one DueReason issues -- your own sending system signs every delivery with this same value, and DueReason never shows it again after this step.

Creating the endpoint hands you back one webhook URL on your own domain, shaped /api/webhooks/custom-inbound/{endpointId}. Nothing happens until your own system is sending signed deliveries to it.

Then sign deliveries from your own system

This is the one inbound source with no vendor settings page to paste the URL and secret into -- GitHub, Linear and GitLab each have their own webhook UI that signs deliveries for you; here, your own script or system has to do that signing itself. On every request, compute an HMAC-SHA256 of the exact raw request body using the secret you just generated, hex-encode it, prefix it with sha256= -- the same shape GitHub uses for its own X-Hub-Signature-256 header -- and send the result as the X-DueReason-Signature header. DueReason recomputes that same HMAC over the raw bytes it received and compares it in constant time; a missing or mismatched header is rejected before the body is even parsed as JSON.

There is no event filter -- any JSON object matches

GitHub only matches an issue or pull request being labeled; Linear only an issue moving into a configured state; GitLab only a merge request or pipeline reaching a configured state or status. The custom source has none of that, because a generic sender has no fixed vendor event shape to filter on: once the signature checks out and the endpoint is active, any request whose body parses as a JSON object (not an array, not a bare string or number) opens a request. The only "no match" outcome for this source is a body that isn't valid JSON, or that parses to something other than a plain object -- and DueReason still answers with success for that case, exactly like every other no-op outcome, so a misbehaving sender is not endlessly retried.

Delivery ids and retries

Unlike GitHub's X-GitHub-Delivery or Linear's Linear-Delivery header, a generic sender rarely carries one fixed delivery-id header name. DueReason checks a short list of common conventions, in order -- X-DueReason-Delivery, X-Delivery-Id, X-Request-Id, X-Webhook-Id, X-Event-Id -- and uses whichever one shows up first. If your system sends none of them, DueReason falls back to a SHA-256 hash of the exact raw request body as the delivery id instead: good enough to recognize an exact retry of the same event, though it means two genuinely different deliveries that happen to carry byte-identical bodies would also be treated as the same one. Sending one of the named headers from your own system avoids that edge case entirely and is the better choice if you control the sender.

Mapping your JSON into the request

The payload template is plain JSON with {{dot.path}} placeholders, resolved directly against the top level of the body you sent -- not nested under an issue or data key the way GitHub's or Linear's templates are, since the custom source has no fixed envelope to nest under. If you POST { "account": { "id": "acct_123" }, "reason": "chargeback dispute" }, your template can reference {{account.id}} and {{reason}} directly. A field that is *only* one placeholder, like "{{account.id}}", keeps that field's own type rather than being stringified; a path your body doesn't actually have resolves to null rather than breaking the delivery, and what actually gates the request is still the target action's own payload schema -- a template that maps a required field to a path your body never carries fails the same validation a manually-filed request with a missing field would.

Try it before you wire up the real sender

The console's Send a sample payload preview lets you paste an example JSON body and see exactly what title, reason and payload your template would produce, without touching a real signature, the database, or filing a real request -- the same dry run GitHub's source offers, and currently the only two sources that have one (Linear, Jira and GitLab do not yet).

Why this is a request, not a notification

A Slack message posted by your own script tells someone a decision is needed; it does not produce anything that records who decided, under what workflow, or that can be checked again later. Because this opens a real DueReason request, the usual workflow applies in full -- routing to the right approver group, requiring a written reason where the action demands one, producing a signed grant once it's answered -- and the request, its decision and its grant all sit on the same hash-chained ledger as a request filed from the console or the API. The no-code webhook recipe covers the opposite direction -- reacting to DueReason's own approval.approved event once a request like this is decided -- if you want to wire up what happens *after* the approval, too. GitHub, Linear and GitLab each cover the same inbound shape for one specific vendor's own events: see the GitHub issue/PR guide, the Linear issue guide and the GitLab merge-request/pipeline guide.

A worked example: an internal admin tool

Say an internal admin panel lets support staff flag a customer account for a manual refund above your usual self-serve limit. Instead of building a bespoke approval screen into that panel, point it at a custom inbound endpoint: the panel computes the HMAC signature with a secret stored in its own server-side config, then POSTs { "account": { "id": "acct_9fQ2", "email": "person@example.com" }, "amount": 480, "currency": "USD", "requestedBy": "support-agent-17" } to the webhook URL. A payload template such as { "accountId": "{{account.id}}", "amount": "{{amount}}", "currency": "{{currency}}" } carries the real numbers into the request DueReason files, which then routes to whichever approver group the refund action is configured with -- no code in the admin panel has to know anything about DueReason's own API, approval routing or grant format beyond sending one signed POST.

What's not here yet

There is no installable integration or marketplace listing for the custom source, which is expected -- it exists precisely because the system on the other end is not one DueReason has a dedicated integration for. Every endpoint is configured by hand, per organization, in DueReason's own console, and the HMAC signing has to be implemented in whatever system or script is sending the events, since there is no vendor webhook UI to do that part for you the way there is for GitHub, Linear and GitLab.

Questions

Does the custom source filter on an event type or state the way GitHub, Linear and GitLab do?
No. Once the signature checks out and the endpoint is active, any request body that parses as a JSON object opens a request -- there is no label, state or status to match, because a generic sender has no fixed vendor event shape to filter on. The only no-op outcome is a body that is not valid JSON, or that parses to something other than a plain object.
Who computes the X-DueReason-Signature header -- DueReason or my own system?
Your own system. Unlike GitHub, Linear and GitLab, which each have a vendor webhook settings page that signs deliveries for you once you paste in a secret, the custom source has no such page: whatever script, service or admin tool sends the event has to compute the HMAC-SHA256 of the exact raw body itself, using the secret you generated, hex-encoded and prefixed sha256=, and send it as that header.
What if my system doesn't send any of the delivery-id headers DueReason looks for?
DueReason falls back to a SHA-256 hash of the exact raw request body as the delivery id. That still recognizes a true retry of the same event, though two different deliveries that happen to carry byte-identical bodies would also be treated as a duplicate. Sending X-DueReason-Delivery, X-Delivery-Id, X-Request-Id, X-Webhook-Id or X-Event-Id from your own system avoids that edge case.
Can I preview what a custom payload would file before wiring up the real sender?
Yes. The console's "Send a sample payload" preview takes a pasted example JSON body and runs it through your configured template, showing the exact title, reason and payload it would produce, without touching a real signature, the database, or filing a real request. GitHub has the same kind of preview; Linear, Jira and GitLab do not yet.
Is my payload template nested under an issue or data key the way GitHub's or Linear's is?
No. The custom source has no fixed envelope, so the template is resolved directly against the top level of whatever JSON object you POST -- if you send { "account": { "id": "acct_123" } }, your template references {{account.id}} directly, with nothing to nest under first.
Can I wire this up for GitHub, Linear, Jira or GitLab instead of a custom source?
Yes, all four. Pick source GitHub and configure a repository and label, Linear and configure a team key and target workflow state, Jira and configure a project key and target status, or GitLab and configure a project path and a target merge-request state or pipeline status -- each of those matches a specific event shape from that vendor; the custom source is the one that matches any JSON object instead.

Open your first request from a custom webhook

Add a custom inbound endpoint in Settings > Inbound webhooks, sign a POST from your own system with the shared secret, and send an event to see the request appear.

Create your account

Sources

This guide explains the regulation as we read it; it is not legal advice. Check the official text and your national law, which may add obligations.

Start with DueReason

Create a free account, try it live, or talk to us about your workflow.

Get product updates