Managing Webhook Configurations
Last updated
Last updated
A webhook configuration has the following schema:
Field | Type | Description |
---|---|---|
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
).
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)
GET
https://connect.lhv.com/notifications/subscription
This lists your registered webhook configs, as a JSON array of config objects (without secrets).
Example response:
GET
https://connect.lhv.com/notifications/subscription/{subscriptionReference}
Example response:
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
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
subscriptionReference
String
A unique ID for the webhook configuration. This is generated by us and returned from PUT
requests. You can then use it to edit or delete the config
eventType
String
The type of webhook. At the moment, this should always be GENERAL_WEBHOOK
messageType
String
requestUrl
String
(URL)
The URL that we will POST
the webhook events to
active
Boolean
An on/off switch for the configuration. When this is false, we will ignore this config and not send webhooks
sharedSecret
String
The HMAC shared secret. See Webhook Security. This is only shown in the response when creating or deleting configs, not when listing via GET
The type of Connect messages that will be sent via this webhook configuration. See the types at