Create a webhook endpoint

POST/webhook-endpoints

Register a destination for the environment's events, and answer its signing secret.

  • This answer and a rotation's are the only ones on the contract that carry signing_secret.

    It is what a receiver verifies a delivery's signature with; no read returns it and no other write reveals it, because a secret a read can return is a secret every read can leak. A client must surface it immediately and must not log it. An endpoint that has lost its secret is given a new one by POST /webhook-endpoints/{endpoint_id}/rotate-secret rather than recovered.

  • Retrying the create.

    Send an Idempotency-Key and a retry with the same key and the same body within 24 hours answers the first 201 again, the same endpoint and the same signing_secret, and registers nothing more, so a create whose answer was lost is recovered rather than repeated. The replay is the first answer as it was: after a later rotation it still carries the secret that rotation replaced. The saved answer is kept encrypted with the key that seals signing secrets, and is gone when its 24 hours are up. The same key with a different body answers 400 idempotency_key_reused, and a retry while the first create is still running answers 409 idempotency_key_in_use. A refusal made before execution, a 409 webhook_endpoint_url_taken included, is not saved.

Show 8 more details
  • The refusals.

    url, name and enabled_events are required, and a missing one answers 422 parameter_missing naming it; a url the destination rules below refuse, a name outside 1 to 255 characters, an empty enabled_events and an enabled_events entry outside the catalogue answer 422 parameter_invalid naming the member. A member the body does not declare answers 400 parameter_unknown naming it. A url already registered in this environment answers 409 webhook_endpoint_url_taken, and a sixth endpoint answers 409 webhook_endpoint_limit_reached — both are conflicts with existing state rather than malformed bodies, which is why they are not 422.

  • A webhook goes to a public https address on port 443 and nothing else.

    Every attempt's response is shown back in the dashboard, so a destination inside Stridge's own network would turn a webhook into a read of internal services. url must therefore be https on port 443 (no other port, and no http in live or in a sandbox), must have a host, must not carry a user name or a password, must not be localhost or a name under it, and must not be a literal IP address in a non-public range (private, loopback, link-local, carrier-grade NAT, multicast, reserved or documentation); each answers 422, and the refusal does not repeat the URL. The URL is stored as it was checked: without the whitespace around it, its scheme and host in lower case and port 443 left out, so one destination is registered once. A host name is not resolved here, because what it resolves to can change after registration: instead every delivery checks each address it dials and refuses one that is not public, recording why. A delivery to the endpoint never follows a redirect: an attempt answered 3xx is a failed attempt, retried on schedule. A receiver on a developer's own machine is reached through a public https address that forwards to it.

  • enabled_events names the types to send, or is ["*"]: every webhook event type this reference documents but webhook_endpoint.ping, types added later included. "*" stands alone, and a group pattern such as payout.* is refused like a type outside the catalogue. Whatever the list, the endpoint is sent only the events /v2 shows, as the delivery policy's enabled_events rule states.

  • The limit and the uniqueness are per environment, not per workspace.

    The same URL may receive a sandbox environment's events and a live one's.

  • Who may.

    In live it is an owner's alone: a developer or a viewer answers 403 permission_denied, checked before the step-up. In a sandbox an owner and a developer may, and a viewer answers 403 permission_denied. A secret key of the environment may too when it holds webhook.write; one without it answers 403 permission_denied.

  • Step-up.

    In live, a person needs a fresh step-up of any factor (totp, backup_code or an emailed code) no older than 15 minutes, which the act renews; without one it answers 403 step_up_required. A sandbox never asks, and a secret key is never asked: a key is answered the signing_secret exactly as a person who has stepped up is, since the key is itself the integration's credential and has no second factor to show.

  • A resetting sandbox.

    Live answers this for a sandbox environment too, and while that sandbox's reset runs it answers 409 environment_resetting: nothing is served for a sandbox until its reset finishes.

  • Called with a live secret key.

    A key calls this with a live secret key (sk_live_). The webhook endpoints' configuration is served by live alone, and a sandbox secret key (sk_sbx_) reaches the sandbox, which does not serve this operation and answers it 404 operation_not_served (this operation is served to live keys only).

Header parameters

  • X-Stridge-Environmentstring <uuid>optional

    Which environment the request acts inside, on an operation a session and an API key both call. Learn more

    Show full description

    It is required under a person's session, exactly as EnvironmentHeader describes: a session request that omits it answers 400 with environment required, and one naming an environment the caller holds no membership of answers 404.

    An API key names its own environment, so a request made with one omits this header. A key request that sends it answers 400 with environment header not accepted, whatever it names, rather than having the header ignored: a header that is silently ignored hides the integration bug that sent it.

  • Idempotency-Keystringoptional

    A caller-chosen key making this request safe to retry. Sent, the server remembers what the first request with it produced; omitted, every request is a new one. Learn more

    Show full description

    The same key with the same parameters returns the first result, status and body both, and does nothing a second time. So a retry after a dropped connection is safe whether or not the first attempt landed. The parameters are compared as parsed, not as bytes: the query with its names sorted and the JSON body decoded, so member order, spacing and escaping never make two requests differ, while any changed value does.

    What is remembered is the answer of an attempt that began execution, success or failure, a 500 included. A refusal made before execution is not remembered, so a retry with the same key runs afresh once its cause is fixed: a validation error (400, 422), a 409 conflict, a 429, a 403 step_up_required, and any answer carrying Retry-After. An answer whose body is larger than 64 KiB is not remembered either, and an operation may say that its 500 is not; a retry of either runs the request again. What the first attempt did stands, so a create that took a unique value answers that value's conflict on the retry: a payout whose first attempt took its reference_id answers 409 payout_reference_taken.

    The same key with different parameters answers 400 with idempotency key replayed with a different body: a key names one request, and reusing it for another is a client bug rather than a retry. A replay while the first request is still in flight answers 409 at once with a request with this idempotency key is still in flight, and the remedy is to retry once the first has answered.

    Keys are scoped to the environment the request acts inside, and to its reset: one environment's key never answers another environment's request, and a key used before a sandbox reset runs afresh after it.

    An operation that acts on a workspace or on the account rather than inside an environment, such as creating a workspace or requesting go-live in the dashboard, scopes its keys to the caller and to its path, so the same key sent for another workspace is a separate request and never a replay.

Request body

  • urlstring <uri>required

    Where to deliver. An absolute https URL on port 443 with a host, which carries no user name or password, is not localhost (or a name under it) and not a literal IP address in a non-public range, and which is not already registered in this environment.

    Show full description

    A host name is not resolved when the URL is registered; every delivery checks the addresses it dials instead. Anything else answers 422. The URL is stored with its scheme and host in lower case and port 443 left out.

  • namestringrequired

    What to call this endpoint.

  • enabled_eventsarray<string>required

    Which events to send. At least one, and every entry must be in the catalogue: a type outside it is refused, because an endpoint subscribed to something Stridge never emits is configured, silent, and gives no reason why.

    Show full description

    ["*"], alone, selects every type the catalogue lists but webhook_endpoint.ping, types added later included; a group pattern such as payout.* is refused like a type outside the catalogue. webhook_endpoint.ping is refused the same way: it is delivered to the endpoint it is sent to whatever this list says.

Responses

The endpoint was registered. This answer carries the signing secret.

  • idstringrequired

    The endpoint's own identifier.

  • objectstringrequired

    The object's type, always webhook_endpoint.

  • environment_idstring <uuid>required

    The environment whose events this endpoint receives.

  • livemodebooleanrequired

    true when environment_id names a live environment and false in a sandbox. It is carried on the object itself, so a payload read on its own, a logged response or a webhook body, still says which side of the boundary it came from.

  • urlstring <uri>required

    Where deliveries are sent.

  • namestringrequired

    What this endpoint is called.

Show 10 more fields
  • enabled_eventsarray<string>required

    Which events to send here, drawn from the catalogue. A legacy endpoint registered with no list reads []: it receives nothing.

  • event_payloadstringrequiredenum thin · legacy

    The body this endpoint receives, fixed for its whole life. thin, every endpoint created through this API: the ThinEvent of every type, which names the object and carries no copy of it. legacy, every other endpoint: the full legacy body of each type, unchanged.

    Show full description

    It never changes: an update naming it is refused. To move to thin events, create a new endpoint, run it beside the old one (both receive each event under the same webhook-id, so a receiver deduplicating on it acts once), then delete the old one.

  • is_activebooleanrequired

    Whether deliveries are attempted. A newly created endpoint is active; a rotation leaves it as it was.

  • statusstringrequiredenum enabled · disabled

    Whether events are sent to the endpoint. disabled names why in disabled_reason: a person turned it off (is_active: false), or Stridge disabled it after three days in which no delivery to it answered 2xx, which only POST /webhook-endpoints/{endpoint_id}/enable undoes.

    Show full description

    A disabled endpoint's pending retries stop and new events are not sent to it.

  • disabled_reasonstring | nullrequiredenum failing · user · null

    Why a disabled endpoint is disabled: failing, three days with no 2xx, or user, a person turned it off. null while it is enabled.

  • failing_sincestring | null <date-time>required

    When the endpoint's first failed delivery happened since a delivery to it last answered 2xx, or null while it is not failing.

    Show full description

    While the endpoint is enabled, any 2xx ends it; a disabled endpoint keeps it, whatever a ping or a resend to it answers, until POST /webhook-endpoints/{endpoint_id}/enable, so the re-enable replays every event it missed. After two days failing the workspace's owners get one notice for the endpoint, in the dashboard; after three it is disabled. RFC3339 UTC, Z suffixed.

  • disable_atstring | null <date-time>required

    When a failing endpoint is disabled unless a delivery to it answers 2xx first: failing_since plus three days. null while it is not failing.

  • signing_secretstringrequired

    The secret a receiver verifies delivery signatures with, in the Standard Webhooks form: whsec_ and the base64 of the HMAC key's bytes (how a signature is computed is on WebhookEventDelivery.request_headers). Answered only here, by the create or the rotation that minted it, and by a retry of that request under its Idempotency-Key. No read returns it and no other write reveals it.

  • created_atstring <date-time>required

    When the endpoint was registered.

  • updated_atstring <date-time>required

    When the endpoint was last changed.

Errors

The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.

Request
curl "https://api.stridge.com/v2/webhook-endpoints" \
  -X POST \
  -H "Authorization: Bearer $STRIDGE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/hooks/stridge",
  "name": "Production receiver",
  "enabled_events": [
    "deposit.confirmed",
    "payout.confirmed"
  ]
}'

Set your secret key as STRIDGE_SECRET_KEY (sent as Authorization: Bearer).

Response201
"id": "sub_00000000000000000000000001",
"object": "webhook_endpoint",
"environment_id": "3f2a6d7e-6b1c-4f2a-9a11-0b53f8d6b2c1",
"livemode": false,
"url": "https://example.com/hooks/stridge",
"name": "Production receiver",
"deposit.confirmed"
],
"event_payload": "thin",
"is_active": true,
"status": "enabled",
"disabled_reason": null,
"failing_since": null,
"disable_at": null,
"signing_secret": "whsec_NGY4YzFkMmUzYTViNmM3ZDhlOWYwYTFiMmMzZDRlNWY2MDcxODI5M2E0YjVjNmQ3ZThmOWEwYjFjMmQzZTRmNQ==",
"created_at": "2026-06-01T00:00:00Z",
"updated_at": "2026-06-01T00:00:00Z"
}