Sample - Stripe API
POST/v1/webhook_endpoints/{webhook_endpoint}

Update a webhook endpoint

Updates the configuration of an existing webhook endpoint. Use url, enabled_events, disabled, description, or metadata to change the endpoint, and use expand to include additional response fields. The response contains the updated webhook endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
webhook_endpointstringrequired
The unique identifier of the webhook endpoint to update. Must be no more than 5000 characters.

Optional form-encoded fields used to update the webhook endpoint configuration.

descriptionstringoptional
An optional description of what the webhook is used for.
disabledbooleanoptional
Disable the webhook endpoint if set to true.
enabled_eventsarray<string>optional
The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection.
expandarray<string>optional
Specifies which fields in the response should be expanded.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
urlstringoptional
The URL of the webhook endpoint.

2 status codes
200Returns the updated webhook endpoint object, including its URL, enabled events, status, metadata, creation time, and unique identifier.
api_versionstringoptional
The API version events are rendered as for this webhook endpoint.
applicationstringoptional
The ID of the associated Connect application.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
descriptionstringoptional
An optional description of what the webhook is used for.
enabled_eventsarray<string>required
The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectrequired
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:webhook_endpoint
secretstringoptional
The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation.
statusstringrequired
The status of the webhook. It can be `enabled` or `disabled`.
urlstringrequired
The URL of the webhook endpoint.
defaultReturned when the API reports an error; the response contains an `error` object with a required `type`.
errorobjectrequired

Error handling

The webhook_endpoint identifier must be no more than 5000 characters. Each enabled_events value must match an event accepted by the API or be *, and description must be no more than 5000 characters when supplied. Metadata values must be strings, or you can send an empty value to unset metadata.