Webhooks
A webhook is a URL in your system that Hovi calls when something happens, for example when a holder accepts a credential or shares a proof. Webhooks belong to an organization, so you get the events for that organization without having to keep asking the API.
Before you start
Make sure you have:
- An API key for your ecosystem.
- An organization. Its ID goes in the
x-organization-idheader of every webhook request. - An HTTPS URL in your system that can receive
POSTrequests.
Steps
This example adds a webhook in the EU Digital Identity ecosystem. The steps are the same in every ecosystem.
- Open the API Reference and select the EU Digital Identity Ecosystem API under Hovi Connect API.

- Go to the Webhooks section.

- Open POST - Add Webhook and click Test Request.

- Enter your API key as a Bearer Token, enter your organization ID and your
webhookUrl, and click Send.
The response includes a webhookId and a webhookSecret.
The webhookSecret is shown only once: when you add the webhook and when you rotate its secret. Store it safely. You need it to verify webhook signatures.
Manage your webhooks
| Endpoint | What it does |
|---|---|
| POST - Add Webhook | Adds a webhook URL and returns its webhookId and webhookSecret. |
| GET - Get All Webhooks | Lists your organization's webhooks, or finds one by webhookId. The secret isn't included. |
| DELETE - Remove Webhooks | Deletes a webhook by its webhookId. |
| POST - Rotate Webhook Secret | Creates a new secret for a webhook and returns it. The old secret stops working. |
Verify webhook signatures
Check the signature of every webhook request to make sure it really comes from Hovi. Without this check, anyone who knows your webhook URL could send you fake events.
Every signed request has two headers:
| Header | Value |
|---|---|
x-webhook-timestamp | When the request was created, in Unix seconds. |
x-webhook-signature | sha256= followed by the hex HMAC-SHA256 of {timestamp}.{rawBody}, using your webhookSecret as the key. |
To verify a request:
- Read both headers and the raw request body, exactly as received. Reject the request if any of them is missing.
- Reject the request if the timestamp is too old. We recommend a window of five minutes.
- Compute the HMAC-SHA256 of
{timestamp}.{rawBody}with your webhook secret, as a hex string, and addsha256=in front. - Compare it with
x-webhook-signatureusing a timing-safe comparison. If they don't match, return401 Unauthorizedand ignore the event.
For example, in Node.js with Express:
const crypto = require('crypto');
const express = require('express');
const app = express();
const WEBHOOK_SECRET = process.env.HOVI_WEBHOOK_SECRET;
// Keep the raw body: parsing and re-serializing the JSON breaks the signature.
app.post('/webhooks/hovi', express.raw({ type: 'application/json' }), (req, res) => {
const timestamp = req.get('x-webhook-timestamp');
const signature = req.get('x-webhook-signature');
const rawBody = req.body.toString('utf8');
if (!timestamp || !signature || !rawBody) return res.sendStatus(401);
// Reject requests older than five minutes.
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.sendStatus(401);
const expected =
'sha256=' +
crypto.createHmac('sha256', WEBHOOK_SECRET).update(`${timestamp}.${rawBody}`).digest('hex');
const received = Buffer.from(signature);
const computed = Buffer.from(expected);
if (received.length !== computed.length || !crypto.timingSafeEqual(received, computed)) {
return res.sendStatus(401);
}
const event = JSON.parse(rawBody);
// Handle the event here.
res.sendStatus(200);
});
Events
For EU Digital Identity, cheqd and Indicio, the request body has a type and a payload:
{ "type": "credential-exchange", "payload": { "…": "…" } }
Event types include:
type | What it's about |
|---|---|
did-exchange | A connection (cheqd and Indicio) |
credential-exchange | A credential offer (cheqd and Indicio) |
proof-exchange | A verification request (cheqd and Indicio) |
openid-issuance-session | A credential offer (EU Digital Identity) |
openid-verification-session | A verification request (EU Digital Identity) |
The payload of each event, including the events for Microsoft Entra and Polygon, is described in the Webhook Events section of your ecosystem's API reference, for example EU Digital Identity.
What happens next
Use the IDs in each event, such as credentialExchangeId or proofExchangeId, to match it to the offer or request you sent. To receive events for a user's cloud wallet instead, see Cloud Wallet webhooks.