Update a webhook endpoint
/ webhook-endpoints/ {endpoint_id}Change an endpoint, stating only what changes.
An omitted member is left alone, so renaming an endpoint keeps its
enabled_eventsas they are.Turning an endpoint off is
{"is_active": false}and nothing else.
Show 7 more detailsShow fewer details
An edit is held to the destination rules.
A
urlthe body carries is checked against the rules a create applies (httpson port 443, a public address, no user name or password, seePOST /webhook-endpoints), stored as a create stores it, and checked for uniqueness inside the environment. An edit that leavesurlalone is still refused while the stored URL breaks the rules the endpoint was registered under, unless its only change is{"is_active": false}: an endpoint that delivers to a plainhttpURL, as a legacy endpoint may, is turned off, or given anhttpsURL, before anything else of it changes. The refusals are422parameter_invalidnaming the member for aurlthose rules refuse (urltoo when it is the stored one), anameoutside 1 to 255 characters, an emptyenabled_eventsor anenabled_eventsentry outside the catalogue;422parameter_missingfor a body that states no member;400parameter_unknownfor a member the body does not declare; and409webhook_endpoint_url_takenfor aurlanother endpoint in the environment already holds.A legacy endpoint keeps its own set of event types.
A legacy endpoint (
event_payload: legacy) can name inenabled_eventsonly the event types legacy endpoints are sent:["*"]anduda.settlement.refundedanswer422parameter_invalidnamingenabled_events.Turning an endpoint back on does not re-enable one disabled for failing.
{"is_active": true}sets what a person turned off; an endpoint Stridge disabled after three days without a2xx(disabled_reason: failing) is re-enabled byPOST /webhook-endpoints/{endpoint_id}/enable, which also replays what it missed.Who may.
In live it is an owner's alone: a developer or a viewer answers
403permission_denied, checked before the step-up. In a sandbox an owner and a developer may, and a viewer answers403permission_denied. A secret key of the environment may too when it holdswebhook.write; one without it answers403permission_denied.Step-up.
In live, a person needs a fresh step-up of any factor (
totp,backup_codeor an emailed code) no older than 15 minutes, which the act renews; without one it answers403step_up_required. A sandbox never asks, and a secret key is never asked.A resetting sandbox.
Live answers this for a sandbox environment too, and while that sandbox's reset runs it answers
409environment_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 it404operation_not_served(this operation is served to live keys only).
Parameters
Path
- endpoint_idstringrequired
The endpoint's identifier.
Headers
- 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 descriptionShow less
It is required under a person's session, exactly as
EnvironmentHeaderdescribes: a session request that omits it answers400withenvironment required, and one naming an environment the caller holds no membership of answers404.An API key names its own environment, so a request made with one omits this header. A key request that sends it answers
400withenvironment 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.
Request body
- urlstring <uri>
Where to deliver, under the rules a create applies: an absolute
httpsURL on port 443 with a host, which carries no user name or password, is notlocalhostand not a literal IP address in a non-public range. - namestring
What to call this endpoint.
- enabled_eventsarray<string>
Which events to send. At least one, each in the catalogue and none of them
webhook_endpoint.ping, which is never subscribed to; or["*"], every type the catalogue lists butwebhook_endpoint.ping. - event_payloadstringenum thin · legacy
Never changed. An endpoint keeps the payload format it was created with for its whole life, so a request naming
event_payload, whatever its value, is refused422parameter_invalidnaming it and changes nothing. Moving to thin events is a new endpoint run beside this one. - is_activeboolean
Whether deliveries are attempted.
Responses
The endpoint as it now stands.
- 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. An endpoint receives the events of one environment and no other, so a sandbox endpoint never receives a live environment's events.
- livemodebooleanrequired
truewhenenvironment_idnames aliveenvironment andfalsein 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.
Show full descriptionShow less
An endpoint registered through this API holds an absolute
httpsURL on port 443 with a public destination (the rules are onPOST /webhook-endpoints); one registered before it may hold a URL those rules refuse, which keeps receiving until it is changed. It is unique inside the environment: two endpoints on one URL would double every delivery to it. - namestringrequired
What this endpoint is called, for the people reading the list rather than for Stridge.
Show 9 more fieldsShow fewer fields
- enabled_eventsarray<string>required
Which events to send here: webhook event types this reference documents, or
["*"], every one of those types butwebhook_endpoint.ping, types added later included.Show full descriptionShow less
Which events reach the endpoint is the delivery policy's
enabled_eventsrule: an endpoint created through/v2is sent only the events/v2shows. An endpoint names at least one type: subscribing to nothing is an endpoint that never receives anything, which is a mistake no client means to make and none can express here. Alegacyendpoint 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: theThinEventof 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 descriptionShow less
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 a person has the endpoint on. An inactive endpoint is skipped rather than queued, so events that occur while it is off are not delivered when it comes back on. An endpoint Stridge disabled for failing stays
is_active: true; itsstatussays it is disabled. - statusstringrequiredenum enabled · disabled
Whether events are sent to the endpoint.
disablednames why indisabled_reason: a person turned it off (is_active: false), or Stridge disabled it after three days in which no delivery to it answered2xx, which onlyPOST /webhook-endpoints/{endpoint_id}/enableundoes.Show full descriptionShow less
A disabled endpoint's pending retries stop and new events are not sent to it.
- disabled_reasonstring | nullrequiredenum failing · user · null
Why a
disabledendpoint is disabled:failing, three days with no2xx, oruser, a person turned it off.nullwhile it isenabled. - failing_sincestring | null <date-time>required
When the endpoint's first failed delivery happened since a delivery to it last answered
2xx, ornullwhile it is not failing.Show full descriptionShow less
While the endpoint is enabled, any
2xxends it; a disabled endpoint keeps it, whatever a ping or a resend to it answers, untilPOST /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,Zsuffixed. - disable_atstring | null <date-time>required
When a failing endpoint is disabled unless a delivery to it answers
2xxfirst:failing_sinceplus three days.nullwhile it is not failing. - created_atstring <date-time>required
When the endpoint was registered. RFC3339 UTC,
Zsuffixed. It is the default sort, newest first. - 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.
- 400body_invalidInvalid request body
- 400environment_requiredEnvironment required
- 400header_invalidInvalid header
- 400422parameter_invalidInvalid parameter
- 400parameter_unknownUnknown parameter
- 401api_key_not_acceptedAPI key not accepted
- 401authentication_requiredAuthentication required
- 401publishable_key_not_acceptedPublishable key not accepted
- 401token_invalidInvalid or expired token
- 403membership_suspendedMembership suspended
- 403permission_deniedPermission denied
- 403step_up_requiredStep-up required
- 404environment_not_foundEnvironment not found
- 404operation_not_servedOperation not served
- 404resource_missingNo such object
- 409environment_provisioningEnvironment provisioning
- 409environment_resettingEnvironment resetting
- 409webhook_endpoint_url_takenWebhook endpoint URL taken
- 413body_too_largeRequest body too large
- 415media_type_unsupportedUnsupported media type
- 422parameter_missingMissing parameter
- 429rate_limitedToo many requests