Notifications Webhooks

Updates a webhook for an account

Updates the URL or the list of subscribed events for a webhook.

This endpoint uses optimistic locking. You must provide the webhook's current version in the If-Match header. You can get this value from the ETag header of a GET request for this resource.

put/accounts/{account_id}/webhooks/{webhook_id}

Request

Headers

If-Matchstring etag
Example:W/"1234"

The ETag value of the resource you intend to update. This is used for optimistic locking to prevent you from accidentally overwriting changes made by someone else. You can get the ETag from a GET request for the resource. The ETag value should always be wrapped in double quotes, whether it is part of a weak ETag or standalone.

Request body

urlstring url

The HTTPS endpoint where webhook notifications will be sent.

eventsWebhookEventType[]

An array of webhook event type names.

compression'gzip' | 'null' nullable

The compression applied to the body of every webhook request for this subscription.

To receive compressed request bodies, set this field to gzip. Each request then carries the Content-Encoding: gzip header. The Content-Type header remains application/json, because compression changes only how the body is encoded, not its media type.

Compression is not enabled by default. To receive uncompressed request bodies, omit this field, or set it to null or an empty string.

Updating a webhook replaces the subscription, so an update that omits compression disables it. To keep compression enabled, include the field in every update.

Example request

{
  "url": "https://example.com/webhook",
  "events": [
    "target-group-updated",
    "quota-fill-registered"
  ],
  "compression": "gzip"
}

Response

The webhook was updated successfully.

idstring ulid

The ID of the webhook.

urlstring url

The HTTPS endpoint where webhook notifications will be sent.

eventsWebhookEventType[]

An array of webhook event type names.

compression'gzip' | 'null' nullable

The compression applied to the body of every webhook request for this subscription.

To receive compressed request bodies, set this field to gzip. Each request then carries the Content-Encoding: gzip header. The Content-Type header remains application/json, because compression changes only how the body is encoded, not its media type.

Compression is not enabled by default. To receive uncompressed request bodies, omit this field, or set it to null or an empty string.

Updating a webhook replaces the subscription, so an update that omits compression disables it. To keep compression enabled, include the field in every update.

created_atstring date-time

The timestamp when the webhook was created, in RFC3339 UTC format.

updated_atstring date-time

The timestamp when the webhook was last updated, in RFC3339 UTC format.

Example response

{
  "id": "01JPVZD75DW4KRP7MPFMF6KGZX",
  "url": "https://example.com/webhook",
  "events": [
    "target-group-updated",
    "quota-fill-registered"
  ],
  "compression": "gzip",
  "created_at": "2023-01-01T23:00:00.000Z",
  "updated_at": "2023-01-01T23:05:00.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.