Webhook Integration
Receive real-time notifications when new regulatory announcements are ingested.
How webhooks work
- You register a webhook URL and choose which events to subscribe to
- When matching announcements are ingested, EUREG sends an HTTP POST to your URL
- Your server verifies the signature and processes the payload
Creating a webhook
cURLbash
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/eureg-webhook",
"events": ["announcement.created"],
"jurisdictions": ["ES", "FR"]
}' \
"https://api.eureg.io/api/v1/webhooks"Save the secret from the response. It is only shown once and is needed for signature verification.
Payload format
{
"event": "announcement.created",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"announcement": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"source_id": "es_boe",
"jurisdiction": "ES",
"category": "company_formation",
"title": "Constitucion de sociedad...",
"publication_date": "2025-01-15"
}
}
}Verifying signatures
Every webhook delivery includes an X-EUREG-Signature header containing an HMAC-SHA256 signature of the request body using your webhook secret.
Pythonpython
import hmac
import hashlib
def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode(), payload, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)JavaScriptjavascript
const crypto = require("crypto");
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac("sha256", secret)
.update(payload)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(signature)
);
}Retry policy
If your endpoint returns a non-2xx status code or times out (10s), EUREG retries with exponential backoff: 30s, 2min, 15min. After 3 failed attempts, the delivery is marked as failed.
Available events
| Event | Description |
|---|---|
announcement.created | New announcement ingested |
entity.updated | Entity record updated with new information |
source.error | Data source ingestion failure |
Manage webhooks
Create, test, and monitor webhooks from your Dashboard. Use the test button to send a sample payload to your endpoint.