Managing Webhook Configurations
A webhook configuration has the following schema:
Field | Type | Description |
---|---|---|
| String | A unique ID for the webhook configuration. This is generated by us and returned from |
| String | The type of webhook. At the moment, this should always be |
| String | |
| String (URL) | The URL that we will |
| Boolean | An on/off switch for the configuration. When this is false, we will ignore this config and not send webhooks |
| String | The HMAC shared secret. See Webhook Security. This is only shown in the response when creating or deleting configs, not when listing via |
Example:
requestUrl
must be an https://
URL (with a valid TLS cert). It must use a domain name which is resolving properly (via an A
/AAAA
record) at time of registration. If you are having trouble with this and have registered the domain (or updated its records) very recently, try waiting several minutes for DNS propagation.
In our implementation every message type must be configured with a subscription separately - meaning all message are not included by default. It allows customers to subscribe to only these messages that are expected. Typically customers would want to subscribe to messages that are not directly created with a request like Transaction Notifications - Transaction Notification
You can have multiple configurations with the same URL, allowing you to have one handler for several message types. You will need to create each one with a separate PUT, and each will have its own subscriptionReference
.
You can only have one configuration for a given messageType
. Attempts to create duplicates will result in an error (even if one of them has active
set to false
).
Creating a Webhook Configuration
POST
https://connect.lhv.com/notifications/subscription
This creates a new webhook configuration. The request body should be a partial webhook configuration JSON.
You must include messageType
, requestUrl
, and active
. You can optionally include sharedSecret
, or leave it absent to allow one to be generated (see Webhook Security for more info).
The response will be the completed configuration, with all fields present.
Example request:
Example response:
We will only show you the generated sharedSecret
once, in the response to this request. If you lose it then you'll need to generate a new one using the edit endpoint (below)
Listing Configs
GET
https://connect.lhv.com/notifications/subscription
This lists your registered webhook configs, as a JSON array of config objects (without secrets).
Example response:
Querying a Config by Reference
GET
https://connect.lhv.com/notifications/subscription/{subscriptionReference}
Example response:
Editing a Config
PUT
https://connect.lhv.com/notifications/subscription/{subscriptionReference}
The request body should be the fields you want to edit. The webhook to edit is identified by the subscriptionReference
in the body
Example request:
Example response:
If you want to keep using the same sharedSecret
then you must provide it in the edit request body. If it is absent then a new secret will be generated and returned, replacing the old one
Deleting a Config
DELETE
https://connect.lhv.com/notifications/subscription/{subscriptionReference}
No request body is needed. The response will also have no body, just a 200 OK status to indicate success
Last updated