Webhooks

Access your webhooks though the API to mange them.

Event types

Webhooks are fired as fast as possible after the event have taken place in our system. Theese are the supported events:

  • consent_created: fired when a consent is created.

  • consent_withdrawn: fired when a consent is withdrawn.

get
List all webhooks

https://app.legalmonster.com/api/v1/webhooks
List all webhooks on the project.
Request
Response
Headers
x-api-key
required
string
Your API key
200: OK
[
{
"webhook_endpoint": {
"public_key":"TRNQzTKQvTxmShKZ4CFyWjdN",
"target_url":"https://cool.webhook",
"events":[
"consent_created",
"consent_withdrawn"
],
"created_at":"2018-08-21T16:32:18.364Z",
"updated_at":"2018-08-21T16:32:18.364Z"
}
},
{
"webhook_endpoint": {
"public_key":"sDdyTHgDDx4YDYNW5p9hEjMw",
"target_url":"https://cool.webhook/2",
"events":[
"consent_created"
],
"created_at":"2018-08-21T16:32:18.364Z",
"updated_at":"2018-08-21T16:32:18.364Z"
}
}
]
403: Forbidden
{ "message": "API key not found" }

post
Add a webhook

https://app.legalmonster.com/api/v1/webhooks
Request
Response
Headers
x-api-key
optional
string
Your API key
Query Parameters
target_url
required
string
The URL that the webhook should trigger.
events
required
string
The events that the webhook should be activated on. If multiple events separated them with a comma.
200: OK
[
{
"webhook_endpoint": {
"public_key":"TRNQzTKQvTxmShKZ4CFyWjdN",
"target_url":"https://cool.webhook",
"events":[
"consent_created",
"consent_withdrawn"
],
"created_at":"2018-08-21T16:32:18.364Z",
"updated_at":"2018-08-21T16:32:18.364Z"
}
},
{
"webhook_endpoint": {
"public_key":"sDdyTHgDDx4YDYNW5p9hEjMw",
"target_url":"https://cool.webhook/2",
"events":[
"consent_created"
],
"created_at":"2018-08-21T16:32:18.364Z",
"updated_at":"2018-08-21T16:32:18.364Z"
}
}
]

delete
Delete a webhook

https://app.legalmonster.com/api/v1/webhooks/:public_key
Request
Response
Path Parameters
public_key
required
string
The public_key of the webhook.
Headers
x-api-key
required
string
Your API key
200: OK
The method returns a empty page on 200.
‚Äč
403: Forbidden
{ "message": "API key not found" }