Skip to main content

Update a Webhook

Updates a Webhook resource.

Updating webhooks

As of this writing, you can only update a Webhook resource via API. In future releases, we will allow you to update webhooks via Dashboard.


Endpoint

PUT /webhooks/:id

Updating URLs

If you update the URL of a Webhook, all events currently being sent from the previous value of the URL will discontinue. Make sure that you don't need all the events being sent from the previous URL anymore.

Sample code

const client = require('payrex-node')('insert your PayRex Secret API key.');

const webhook = await client.webhooks.update(
'<ID of a Webhook resource>',
{
description: 'test description',
}
);

Parameters

url optional

The URL where the webhook will send the event. For security purposes, the URL must be using HTTPS protocol.


description optional

An arbitrary string attached to the Webhook. You can use this to give more information about the Webhook resource.


events optional

An array of strings that defines the list of events the webhook will listen to. To learn about the possible values, please refer to this list.

Returns

Returns a Webhook resource.