add_hook
Creates an inbound webhook address for a deployed app, verifies each delivery's signature, and forwards provider headers and exact body to the specified app path; returns URL and secret key.
Instructions
Give a deployed app an inbound webhook address a provider can POST to.
The machine verifies each delivery's signature before the app sees it,
then POSTs the provider's headers and exact body to ``path``. No secret
travels through this tool: the response carries ``url`` (paste it at the
provider) and ``secret_key``; then store the provider's signing secret
with ``set_secret(name, {secret_key: value})``. ``url`` is null until
the machine is linked, and answers only once the app is shared.
Refusals: 422 ``hook.invalid`` (``reason`` ``name`` or ``shape``), 422
``hook.kind_unsupported`` (models and databases), 409 ``hook.exists``
(a different webhook already has that name). A replay of the same
webhook answers ``created: false``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name (or row id) of an existing deployed app — only kind 'service' can be exposed: ``share_service``/``add_domain`` refuse a model or database with 422 ``*.kind_unsupported``, while the remove tools just find nothing to undo. | |
| path | Yes | App path each delivery is POSTed to, e.g. ``/webhooks/stripe``. | |
| header | No | sender ``hmac`` only (required there): the signature header. | |
| prefix | No | sender ``hmac`` only: text before the hex digest (``sha256=``). | |
| sender | Yes | Who signs the deliveries: ``stripe`` (Stripe-Signature), ``github`` (X-Hub-Signature-256), ``slack`` (X-Slack-Signature), ``hmac`` (HMAC-SHA256 lowercase hex in ``header``, after ``prefix``) or ``none`` (unsigned: the URL is the only guard). | |
| hook_name | Yes | Webhook name: lowercase letters, digits and '-', 1-32 characters, starting with a letter (e.g. ``stripe``); maps to ``NERDIT_HOOK_<NAME>_SECRET`` and ``NERDIT_HOOK_<NAME>_URL``. | |
| idempotency_key | No | Caller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts. |