Skip to main content

POST /webhooks

Create a webhook subscription

Example Request

POST /v1/webhooks
{
"version": "1.0.0",
"description": "A test webhook to listen to pickup and delivery successful events.",
"rooftop": 59,
"target_url": "https://webhook.site/27d9d588-1d4b-4150-9f30-42bacd4b1e5f",
"secret": "5cPmmMNk7n&E3W",
"event_types": [
"move.pickup.successful",
"move.delivery.successful"
]
}

Body Params

FieldTypeRequired?Description
rooftopNumberOptionalFor users configured as dealer admins with the ability to create webhooks for multiple rooftops. Specify the id of the rooftop you wish to create the webhook for.
descriptionStringOptionalDescription of what the webhook is intended for. This is only for your own reference and documentation.
target_urlStringRequired*A publicly accessible HTTPS endpoint that is setup to recieve a POST payload then return a 200 response quickly.
versionStringOptionalA 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.
secretStringRequired*A shared secret used to sign the payload with an HMAC signature in the header of the webhook http transaction.
event_typesString[]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,
"status": "enabled",
"version": "1.0.0",
"description": "A test webhook to listen to pickup and delivery successful events.",
"rooftop": 59,
"target_url": "https://webhook.site/27d9d588-1d4b-4150-9f30-42bacd4b1e5f",
"secret": "5cPmmMNk7n&E3W",
"event_types": [
"move.pickup.successful",
"move.delivery.successful"
],
"createdat": "2022-08-23T05:08:31.772948+00:00",
"updatedat": "2022-08-23T05:08:31.772948+00:00"
}