Home

Webhooks

Webhooks enable you to receive events from Signatu. When a certain event you are subscribed to, e.g., somebody consents to a a policy, Signatu will send a HTTP POST to the registered webhook url with event data. You can use the data to trigger actions in your systems - e.g., update

Endpoint

NOTE: webhooks are used across multiple Signatu APIs. Hence you will register webhooks at https://api.signatu.com/webhooks/v0

Registering a webhook

You can register a webhook through the API using a valid Access Token. Since an access token is associated with a specific Application, the webhook will be registered for that Application.

To register a webhook for e.g., the consent event:

$ curl https://api.signatu.com/webhooks/v0 \
-H 'Authorization: Bearer YOUR_OAUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d  \
'{\
"url": "https://my.server/webhookhandler", \
"events": ["consent"] \
}'
{
"url": "https://my.server/webhookhandler",
"events": [
"consent"
],
"id": 1
}

Custom headers

You can set headers in the webhook using the headers field. This can be useful to e.g., authorize the webhook access to your API. To set headers, simply include a headers map when registering the webhook:

$ curl https://api.signatu.com/webhooks/v0 \
-H 'Authorization: Bearer YOUR_OAUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d  \
'{
"url": "https://my.server/webhookhandler",
"events": ["consent"]
"headers": {
"Authorization": "MY_AUTH_DETAILS",
"MyOtherHeader": "SOME_VALUE"
}
}'
{
"url": "https://my.server/webhookhandler",
"events": [
"consent"
],
"headers": {
"Authorization": "MY_AUTH_DETAILS",
"MyOtherHeader": "SOME_VALUE"
}
"id": 2
}

Showing registered webhooks

$ curl https://api.signatu.com/webhooks/v0 \
-H 'Authorization: Bearer YOUR_OAUTH_TOKEN'
[
{
"url": "https://my.server/webhookhandler",
"events": [
"consent"
],
"id": 1
}
]