Update a Webhook
Updates a Webhook resource.
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
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
- curl
- Node
- PHP
- Python
- Ruby
curl --location 'https://api.payrexhq.com/webhooks/<ID of a Webhook resource>' \
--request PUT \
-u replace_with_secret_api_key: \
--data-urlencode 'description=test description'
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',
}
);
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$webhook = $client->webhooks->update(
'<ID of a Webhook resource>'
[
'description' => 'test description',
]
);
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
webhook = client.webhooks.update(
'<ID of a Webhook resource>',
{
'description': 'test description'
}
)
client = Payrex::Client.new("insert your PayRex Secret API key.")
webhook = client.webhook.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.