PATCH /webhooks/:id
Update a webhook subscription with a partial webhook object pass in the body. Whatever is passed will replace the same named property for that webhook in our system. Changes to a webhook will take affect immediately. Prior events published through th ewebhook cannot be resent using any new configuration. The change is point-in-time forward only.
Example Request
PATCH /v1/webhooks/:id
{
"secret": "5cPmmMNk7n&E3W"
}
Body Params
Field | Type | Required? | Description |
---|---|---|---|
description | String | Optional | Description of what the webhook is intended for. This is only for your own reference and documentation. |
target_url | String | Required* | A publicly accessible HTTPS endpoint that is setup to recieve a POST payload then return a 200 response quickly. |
version | String | Optional | A version string indicating the structure of the payload for HopDrive to send tot he webhook endpoint. This is similar to API versioning, but for the webhook schema instead of the schema of an endpoint's response for instance. At this time, the only webhook payload version is 1.0.0 and this will be applied as a default of version is not passed. |
secret | String | Required* | A shared secret used to sign the payload with an HMAC signature in the header of the webhook http transaction. |
event_types | String[] | Required* | An array of strings (webhook event names) for defining which webhook events this webhook should listen to. |
Example Response
For additional information, see the response section.
200 /v1/webhooks
{
"id": 22,
"version": "1.0.0",
"updatedat": "2022-08-23T05:08:31.772948+00:00",
"target_url": "https://webhook.site/27d9d588-1d4b-4150-9f30-42bacd4b1e5f",
"status": "enabled",
"secret": "5cPmmMNk7n&E3W",
"event_types": [
"move.cancel.failed"
"move.cancel.partial"
"move.cancel.pending"
"move.cancel.succeeded"
],
"description": "A test webhook to listen to pickup and delivery successful events.",
"rooftop": 59,
"createdat": "2022-08-23T05:08:31.772948+00:00"
}