Webhooks and signature verification
Frihet webhooks let you receive real-time HTTP notifications when events occur in your account. Instead of polling the API, configure an endpoint URL and Frihet sends a POST request with event data the moment it happens.
Quick walkthrough: from your first API read to a verified webhook
If you already completed your first authenticated read with GET /v1/clients?limit=5 in Developers: getting started, this walkthrough validates the next integration milestone: checking permissions and plan limits, cryptographically verifying the X-Frihet-Signature (HMAC-SHA256) header over the raw request body (rawBody) before opening external traffic, and confirming delivery from the dashboard or via the REST API.
1. Prerequisites, permissions, and plan gate
Before registering an endpoint via POST /v1/webhooks or from Integrations → Webhooks, confirm these four contract requirements:
| Requirement | Production contract | Where to verify |
|---|---|---|
| Prior API read | Received 200 OK from GET https://api.frihet.io/v1/clients?limit=5 with your X-API-Key: fri_... header | Developers: getting started |
| API key permissions | Current API keys grant full access to account resources (read and write across /v1/*). There are no per-resource granular scopes in v1 | API Keys (Integrations → API Keys) |
| Required plan & quota | Webhooks require the Premium (or Enterprise) plan. Account limits: maximum 20 webhooks registered and 100 KB per delivered payload | Settings → Plan & Billing and Plans & billing |
URL & secret field | Public https:// url (http://localhost or 127.0.0.1 allowed only in local development; RFC 1918 private IPs blocked against SSRF). The secret field (max 256 chars) is write-only on POST /v1/webhooks and PATCH /v1/webhooks/:id: read operations return hasSecret: true without exposing plaintext | Webhooks configuration |
2. Deterministic walkthrough: verify HMAC-SHA256 signature locally
The most common webhook integration failure is computing the HMAC over a JSON object that was already parsed and re-serialized by a web framework, which alters whitespace or key ordering and invalidates the signature. The complete signing, constant-time verification, and X-Frihet-Delivery-Id deduplication flow follows this sequence:
Verification flow: Webhook event → HMAC signature → Validation → Rejection or acceptance
X-Frihet-Signature (HMAC-SHA256) + X-Frihet-Delivery-Idinvoice.paidPOST HTTPSFrihet serializes the event payload (max 100 KB) and assigns a unique delivery identifier X-Frihet-Delivery-Id.
HMAC-SHA256X-Frihet-SignatureUsing the endpoint secret, Frihet computes sha256=<hex> over the exact raw UTF-8 HTTP request body bytes.
timingSafeEqualDeduplicationYour server reads rawBody before JSON parsing, recomputes HMAC-SHA256, and checks whether X-Frihet-Delivery-Id was already seen.
401 Reject200 AcceptIf the signature fails, return 401; if valid, return 200 OK immediately and run business logic exactly once.
The computed digest does not match X-Frihet-Signature. The receiver drops the payload without mutating state; Frihet logs the failure and schedules up to 3 exponential-backoff retries.
The signature matches in constant time. If X-Frihet-Delivery-Id is new, record it and process the event; if already seen from a network retry, return 200 OK without duplicating side effects.
View textual specification and Mermaid sequence source
sequenceDiagram
participant F as Frihet ERP
participant R as HTTPS Receiver (rawBody)
F->>R: POST payload + X-Frihet-Signature (sha256=...) + X-Frihet-Delivery-Id
R->>R: Compute HMAC-SHA256(secret, rawBody) & compare via timingSafeEqual
alt Invalid signature or tampered body
R-->>F: 401 Unauthorized (Reject delivery, triggers exponential backoff retry)
else Valid signature & X-Frihet-Delivery-Id already processed
R-->>F: Idempotent 200 OK (Ignore duplicate without re-running business logic)
else Valid signature & fresh X-Frihet-Delivery-Id
R-->>F: 200 OK (< 30s) + record X-Frihet-Delivery-Id + enqueue job
endYou can interactively test all three scenarios (valid signature 200 OK, tampered body 401 Unauthorized, and repeated delivery ID 200 OK idempotent) directly in your browser using the deterministic local simulator below, or run the Node.js one-liner in your terminal:
Local webhook signature & idempotency verification lab
100% in-browser · Web Crypto HMAC-SHA256 · Zero networkTest the three scenarios on the synthetic Estudio Norte S.L. fixture (F-2026-0001) or edit rawBody to recompute the HMAC-SHA256 digest via TextEncoder + Web Crypto. The in-memory list simulates X-Frihet-Delivery-Id deduplication (it does not replace durable database persistence or concurrency control).
The HMAC-SHA256 digest computed via Web Crypto over the UTF-8 rawBody bytes matches X-Frihet-Signature and X-Frihet-Delivery-Id is not in the in-memory list.
- HMAC-SHA256 computed via Web Crypto over rawBody (expected):
sha256=970173bb5ff9661383456c2737b482c7f654992ec27204d88fa87bf9fc53f10a - X-Frihet-Signature header verified via crypto.subtle.verify (in your Node server use crypto.timingSafeEqual):
sha256=970173bb5ff9661383456c2737b482c7f654992ec27204d88fa87bf9fc53f10a - Simulated receiver action:Record del_01J8X9N8Q4 and process payment for F-2026-0001.
Before exposing your HTTPS receiver to internet traffic, also run this deterministic local test with Node.js (built-in crypto, zero external dependencies). It uses the synthetic documentation fixture (Estudio Norte S.L., tax ID B12345674, facturacion@example.com, invoice F-2026-0001) and the sample secret whsec_test_ejemplo_doc_no_usar_en_produccion:
node -e '
const crypto = require("crypto");
const secret = "whsec_test_ejemplo_doc_no_usar_en_produccion";
const rawBody = "{\"event\":\"invoice.paid\",\"timestamp\":\"2026-10-15T10:00:00.000Z\",\"data\":{\"id\":\"inv_01J8X9N4P2\",\"invoiceNumber\":\"F-2026-0001\",\"clientId\":\"cli_01J8X9M2K4\",\"clientName\":\"Estudio Norte S.L.\",\"clientTaxId\":\"B12345674\",\"clientEmail\":\"facturacion@example.com\",\"subtotal\":1500,\"taxAmount\":315,\"total\":1815,\"status\":\"paid\"}}";
const headerSig = "sha256=970173bb5ff9661383456c2737b482c7f654992ec27204d88fa87bf9fc53f10a";
const expectedHex = crypto.createHmac("sha256", secret).update(rawBody, "utf8").digest("hex");
const receivedHex = headerSig.replace(/^sha256=/, "");
const isValid =
expectedHex.length === receivedHex.length &&
crypto.timingSafeEqual(Buffer.from(expectedHex, "hex"), Buffer.from(receivedHex, "hex"));
console.log(JSON.stringify({ isValid, event: "invoice.paid", signaturePrefix: headerSig.slice(0, 23) + "..." }));
'
- Why
B12345674andexample.com:B12345674passes the Spanish check-digit algorithm (4), but does not prove existence, non-existence, or ownership in the AEAT tax census; andexample.comis an IANA-reserved documentation domain (RFC 6761), not a controlled QA mailbox or a delivery-blocking guarantee. Do not use these values to issue or send live invoices. - Body shape: the fixture body only exercises the signature. The real body shape of each event is in Payload structure.
- What this command proves vs. what requires live networking: this command deterministically verifies your signature logic (
createHmacoverrawBody+ constant-timetimingSafeEqual). To verify network reachability, TLS certificates, and firewall rules from Google Cloud (us-central1), register your URL in Integrations → Webhooks and click Send test (which delivers a body withevent: "webhook.test"and the headerX-Frihet-Event: invoice.created).
3. Expected result: local check and test delivery
- In your local terminal (command above): you get this exact output with exit code
0:
{"isValid":true,"event":"invoice.paid","signaturePrefix":"sha256=970173bb5ff96613..."}
- When registering the webhook (
POST /v1/webhooks): the API returns201 Createdwith the webhook identifier (id),active: true,hasSecret: true, and the subscribed event types (from the catalog of 39 subscribable event types). - When clicking Send test in the dashboard (Integrations → Webhooks): your server receives a
POSTrequest with the headersX-Frihet-Event: invoice.created(the header does NOT carrywebhook.test; the test is identified only by the body,event: "webhook.test"),X-Frihet-Delivery-Id,X-Frihet-Timestamp, andX-Frihet-Signature. When your endpoint responds200 OKwithin 30 seconds, the Deliveries tab logs the attempt asdelivered.
You can register the endpoint and trigger the test delivery from any of the three equivalent channels:
- Web UI
- REST API
- MCP
- Go to Integrations → Webhooks and click Create webhook.
- Enter your HTTPS URL (
https://...), selectinvoice.paid, and set your verificationsecret. - Open the newly created webhook, click Send test (body
webhook.test, headerinvoice.created), and verify under the Deliveries tab that the attempt is logged asdelivered(200 OK).
Register the webhook via POST /v1/webhooks using your X-API-Key header:
curl -X POST "https://api.frihet.io/v1/webhooks" \
-H "X-API-Key: $FRIHET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.example.com/frihet",
"events": ["invoice.paid"],
"secret": "whsec_test_ejemplo_doc_no_usar_en_produccion",
"active": true
}'
From your agent connected to @frihet/mcp-server, call create_webhook to register the subscription and test_webhook to dispatch a test delivery (body event: "webhook.test", header X-Frihet-Event: invoice.created):
{
"tool": "create_webhook",
"arguments": {
"url": "https://hooks.example.com/frihet",
"events": ["invoice.paid"],
"secret": "whsec_test_ejemplo_doc_no_usar_en_produccion"
}
}
4. Webhook diagnosis and recovery
If webhook registration or delivery verification fails, apply this direct recovery table:
| Symptom or status code | Verifiable root cause | Recovery action |
|---|---|---|
isValid: false or 401 on your receiver | Your server ran JSON.parse before computing the HMAC or used a different secret than the one configured | Pass raw bytes (express.raw({ type: 'application/json' }) in Express or request.data in Flask) into createHmac. If you lost the secret, rotate it via PATCH /v1/webhooks/:id with a new secret field |
403 Forbidden when calling POST /v1/webhooks | The account is not on the Premium plan or has reached the cap of 20 webhooks | Check your subscription in Settings → Plan & Billing, or list current registrations with GET /v1/webhooks and delete unused ones via DELETE /v1/webhooks/:id |
400 Bad Request when saving url | The URL uses http:// outside localhost/127.0.0.1, resolves to a private IP (SSRF protection), or includes event names outside the 39 subscribable event types | Use a public domain with a valid TLS certificate (https://) and verify exact event names in Event types |
Status paused (pausedReason: "consecutive_failures") | The circuit breaker paused the webhook after 3 consecutive failed deliveries (each with up to 3 attempts and a 30s timeout) | Fix the 5xx/timeout error on your server, confirm it responds 2xx in under 30s, and re-enable it from Integrations → Webhooks or by sending PATCH /v1/webhooks/:id with {"active": true} |
5. Next action
- Connect an AI agent or IDE over MCP: continue with the MCP Server or the step-by-step guide Connect Frihet to Claude, Cursor or ChatGPT.
- Operate via direct HTTP/JSON: review full schemas, pagination, and idempotency in the REST API reference.
- Manage webhooks without code from the UI: see Webhooks configuration in the app.
Setup
You can manage webhooks from the Frihet dashboard (Integrations → Webhooks) or programmatically through the REST API.
From the dashboard
- Go to Integrations → Webhooks in your Frihet account
- Click Create webhook
- Enter a descriptive name, the destination URL, and select the events you want to receive
- Optionally, define a secret for HMAC verification (recommended)
- Save the webhook
Webhook REST API
Manage webhooks programmatically with the full CRUD endpoints.
List webhooks
GET /v1/webhooks
curl https://api.frihet.io/v1/webhooks \
-H "X-API-Key: fri_your-key-here"
Response (200):
{
"data": [
{
"id": "wh_abc123",
"url": "https://my-app.com/hook",
"events": ["invoice.paid", "invoice.created"],
"active": true,
"createdAt": "2026-02-01T10:00:00.000Z"
}
],
"total": 1,
"limit": 50,
"offset": 0
}
Get webhook
GET /v1/webhooks/:id
curl https://api.frihet.io/v1/webhooks/wh_abc123 \
-H "X-API-Key: fri_your-key-here"
Create webhook
POST /v1/webhooks
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Destination URL (HTTPS required in production) |
events | string[] | Yes | List of event types to receive |
secret | string | No | Secret for HMAC-SHA256 signing (recommended) |
active | boolean | No | Webhook status (default: true) |
curl -X POST https://api.frihet.io/v1/webhooks \
-H "X-API-Key: fri_your-key-here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://my-app.com/hook",
"events": ["invoice.paid", "expense.created"],
"secret": "my-hmac-secret"
}'
Response (201):
{
"id": "wh_def456",
"url": "https://my-app.com/hook",
"events": ["invoice.paid", "expense.created"],
"active": true,
"createdAt": "2026-03-18T10:00:00.000Z"
}
Update webhook
PATCH /v1/webhooks/:id
You only need to send the fields you want to modify.
curl -X PATCH https://api.frihet.io/v1/webhooks/wh_def456 \
-H "X-API-Key: fri_your-key-here" \
-H "Content-Type: application/json" \
-d '{
"events": ["invoice.paid", "invoice.created", "expense.created"],
"active": false
}'
Response (200): Updated webhook object.
Delete webhook
DELETE /v1/webhooks/:id
curl -X DELETE https://api.frihet.io/v1/webhooks/wh_def456 \
-H "X-API-Key: fri_your-key-here"
Response: 204 No Content
URL requirements:
- Must use HTTPS (HTTP is allowed only for
localhostand127.0.0.1during development) - Private IPs (10.x, 172.16-31.x, 192.168.x) are not allowed to prevent SSRF attacks
- Must respond with a 2xx status code within 30 seconds
Limits:
- Maximum 20 webhooks per account
- Maximum payload size of 100 KB per delivery
Event types
You can subscribe a webhook to 39 event types, grouped by resource. Any other name is rejected on save.
The Status column shows whether the production version emits the event:
- Active (15 events): Frihet emits it and delivers it to subscribed webhooks.
- No emitter (24 events): the name can be subscribed to, but it produces no deliveries today. You can subscribe ahead of time; the body shape of these events is not fixed yet.
Invoices (9 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
invoice.created | Active | An invoice is created. It is emitted after the fiscal number is assigned. More than one delivery can arrive for the same invoice: deduplicate on the id of invoice. | invoice |
invoice.updated | Active | An existing invoice is modified. before holds the document as it was before the change. | invoice, before |
invoice.paid | Active | The invoice status changes to paid. | invoice |
invoice.overdue | Active | The invoice status changes to overdue. | invoice |
invoice.generated | No emitter | Planned: invoice PDF generated. | To be defined |
invoice.one_off_created | No emitter | Planned: one-off invoice created outside a recurring schedule. | To be defined |
invoice.voided | No emitter | Planned: invoice voided after issuance. | To be defined |
invoice.payment_status_updated | No emitter | Planned: change in the invoice payment status. | To be defined |
invoice.payment_failure | No emitter | Planned: the payment provider failed to charge the invoice. | To be defined |
Payments (3 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
payment.succeeded | Active | The payment of an invoice completes through Stripe. payment includes paymentIntentId, amount, currency (uppercase) and invoiceId. | payment |
payment.requires_action | No emitter | Planned: the payment needs an extra action from the customer, for example 3-D Secure. | To be defined |
payment_receipt.created | No emitter | Planned: payment receipt generated. | To be defined |
Credit notes (2 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
credit_note.created | No emitter | Planned: credit note created against an issued invoice. | To be defined |
credit_note.generated | No emitter | Planned: credit note PDF generated. | To be defined |
Quotes (5 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
quote.created | Active | A quote is created. | quote |
quote.updated | Active | An existing quote is modified. before holds the document as it was before the change. | quote, before |
quote.accepted | Active | The quote status changes to accepted. | quote |
quote.rejected | Active | The quote status changes to rejected. | quote |
quote.expired | No emitter | Planned: quote past its due date without a response. | To be defined |
Expenses (2 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
expense.created | Active | An expense is logged. More than one delivery can arrive for the same expense: deduplicate on the id of expense. | expense |
expense.updated | Active | An existing expense is modified. | expense |
Clients (3 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
client.created | Active | A client is created. | client |
client.updated | Active | A client is modified. | client |
client.vies_check | No emitter | Planned: VIES validation of a client VAT ID performed. | To be defined |
Products (2 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
product.created | Active | A product or service is created. | product |
product.updated | Active | An existing product or service is modified. | product |
Dunning (overdue collection) (1 event)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
dunning.finished | No emitter | Planned: a dunning campaign exhausts all its retries. | To be defined |
Stay (reservations, properties, guests, cleaning, settlements and channels) (12 events)
| Event | Status | When it is emitted | Body keys |
|---|---|---|---|
reservation.created | No emitter | Planned: a reservation is created. | reservation |
reservation.updated | No emitter | Planned: a reservation is modified. | reservation, before |
reservation.cancelled | No emitter | Planned: the reservation status changes to Cancelled. | reservation |
reservation.checked_in | No emitter | Planned: the reservation status changes to Checked In. | reservation |
reservation.checked_out | No emitter | Planned: the reservation status changes to Checked Out. | reservation |
property.created | No emitter | Planned: a property is created. | property |
property.updated | No emitter | Planned: a property is modified. | property |
guest.compliance_completed | No emitter | Planned: the guest completes document verification and signature. | compliance |
cleaning_task.created | No emitter | Planned: a cleaning task is created. | cleaning_task |
cleaning_task.completed | No emitter | Planned: the task status changes to Completed. | cleaning_task |
settlement.generated | No emitter | Planned: a settlement is generated. | settlement |
channel.sync_completed | No emitter | Planned: a channel sync completes. | channel |
Payload structure
Each delivery of an active event is a POST request with a JSON body. The event type is not in the body: it travels in the X-Frihet-Event header.
The body is an object whose main key is the resource name (invoice, quote, expense, client, product or payment). Its value is the document as stored in Frihet, including its id. Timestamps arrive as ISO 8601 strings. invoice.updated and quote.updated add before, with the document as it was before the change.
invoice.paid example (only some fields are shown; the document includes the rest of the invoice fields):
{
"invoice": {
"id": "inv_abc123",
"status": "paid",
"total": 750
}
}
payment.succeeded example:
{
"payment": {
"paymentIntentId": "pi_3Nabc123",
"amount": 750,
"currency": "EUR",
"invoiceId": "inv_abc123"
}
}
The test delivery is the exception: its body carries event: "webhook.test" (the X-Frihet-Event header carries invoice.created) and uses the event, timestamp and data fields, as described in Testing.
Delivery headers
Every webhook request includes the following headers:
| Header | Description | Example |
|---|---|---|
Content-Type | Content type | application/json |
X-Frihet-Event | Event type | invoice.paid |
X-Frihet-Delivery-Id | Unique delivery identifier | d4e5f6a7b8c9 |
X-Frihet-Timestamp | ISO 8601 timestamp | 2026-02-12T14:30:00.000Z |
X-Frihet-Signature | HMAC-SHA256 signature of the payload | sha256=a1b2c3d4e5f6... |
The X-Frihet-Signature header is only included if you configured a secret on the webhook.
Signature verification
If you configure a secret when creating the webhook, Frihet signs every payload with HMAC-SHA256. The verification process:
- Take the raw request body
- Compute the HMAC-SHA256 using the secret as the key
- Compare the result with the value in the
X-Frihet-Signatureheader (without thesha256=prefix)
With the SDK (recommended)
import { Webhooks } from '@frihet/sdk';
app.post('/webhook/frihet', express.raw({ type: 'application/json' }), (req, res) => {
const isValid = Webhooks.verifySignature(
req.body,
req.headers['x-frihet-signature'],
process.env.FRIHET_WEBHOOK_SECRET,
);
if (!isValid) return res.status(401).send('Invalid signature');
const event = JSON.parse(req.body.toString());
console.log(req.headers['x-frihet-event'], event.data);
res.sendStatus(200);
});
Manual Node.js example
const crypto = require('crypto');
function verifyWebhookSignature(rawBody, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
const receivedSignature = signature.replace('sha256=', '');
return crypto.timingSafeEqual(
Buffer.from(expectedSignature, 'hex'),
Buffer.from(receivedSignature, 'hex')
);
}
// Usage in an Express server
app.post('/webhook/frihet', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-frihet-signature'];
const secret = process.env.FRIHET_WEBHOOK_SECRET;
if (!signature || !verifyWebhookSignature(req.body.toString(), signature, secret)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(req.body.toString());
const eventType = req.headers['x-frihet-event'];
console.log(`Event received: ${eventType}`, event.data);
// Handle the event by type
switch (eventType) {
case 'invoice.paid':
// Update your accounting system
break;
case 'expense.created':
// Notify the finance team
break;
}
res.status(200).send('OK');
});
Python example
import hmac
import hashlib
from flask import Flask, request, abort
app = Flask(__name__)
WEBHOOK_SECRET = 'your-secret-here'
def verify_signature(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode('utf-8'),
payload,
hashlib.sha256
).hexdigest()
received = signature.replace('sha256=', '')
return hmac.compare_digest(expected, received)
@app.route('/webhook/frihet', methods=['POST'])
def handle_webhook():
signature = request.headers.get('X-Frihet-Signature', '')
if not verify_signature(request.data, signature, WEBHOOK_SECRET):
abort(401)
event = request.get_json()
event_type = request.headers.get('X-Frihet-Event')
print(f'Event received: {event_type}')
if event_type == 'invoice.paid':
# Update your accounting system
pass
elif event_type == 'quote.accepted':
# Convert quote to invoice
pass
return 'OK', 200
Important: Always use constant-time comparison (timingSafeEqual in Node.js, compare_digest in Python) to prevent timing attacks.
Retry policy
If a webhook delivery fails (non-2xx response or timeout), Frihet retries automatically with exponential backoff:
| Attempt | Delay | Cumulative time |
|---|---|---|
| 1 (initial) | immediate | 0s |
| 2 (first retry) | 2 seconds | 2s |
| 3 (second retry) | 4 seconds | 6s |
- Maximum 3 attempts per delivery (1 initial + 2 retries)
- Maximum 30 seconds delay between retries
- 30-second timeout per request
- If all 3 attempts fail, the delivery is marked
failed
Retries are processed by a job that runs every 5 minutes, ensuring reliability even if the main process restarts.
You can check the delivery history for each webhook from the Frihet dashboard, including the response code, response body (first 1000 characters), and errors for each attempt.
Testing
From the Frihet dashboard, you can send a test event to any configured webhook. The test payload looks like:
{
"event": "webhook.test",
"timestamp": "2026-02-12T14:30:00.000Z",
"data": {
"message": "This is a test webhook from Frihet ERP"
}
}
This lets you verify that your endpoint is reachable, that signature validation works, and that your system handles events without errors.
Best practices
Respond fast
Your endpoint should respond with a 200 status code as quickly as possible. If you need to do heavy processing (send emails, update external databases, etc.), accept the event and process it asynchronously in a job queue.
Handle idempotency
It's possible for the same event to be delivered more than once (for example, if your server timed out but still processed the event). Use the X-Frihet-Delivery-Id header as an idempotency key to avoid duplicates.
Always verify the signature
Never trust a webhook without verifying the X-Frihet-Signature header. Anyone with access to your URL could send fake payloads.
Use HTTPS
In production, your endpoint must be protected with HTTPS. Frihet rejects HTTP URLs (except in local development).
Monitor failures
Check delivery logs in the Frihet dashboard periodically. If you see recurring failed deliveries, verify that your endpoint is available and responds in under 30 seconds.
Filter events
Subscribe only to the events you need. Each webhook can listen to one or several event types. Processing fewer unnecessary events reduces load on your server.
Debugging deliveries
Frihet logs the result of every webhook delivery. You can inspect them from the dashboard:
- Go to Integrations → Webhooks
- Click on the webhook you want to inspect
- Open the Deliveries tab
Each entry shows:
- Response code returned by your endpoint
- Response time in milliseconds
- Response body (first 1000 characters)
- Date and time of each attempt (including retries)
- Final status:
delivered,retrying, orfailed
Common issues
| Symptom | Likely cause | Solution |
|---|---|---|
| All deliveries fail with timeout | Endpoint takes more than 30s to respond | Accept the event with an immediate 200 and process asynchronously |
| SSL/TLS error | Expired certificate or incomplete chain | Renew the certificate and verify the chain with openssl s_client |
| Systematic 403 | Firewall blocking inbound POST requests | Allow traffic from Google Cloud IPs (us-central1) |
| 502/503 | Server down or under maintenance | Check your server logs and verify the process is running |
Test button
On each webhook's detail screen, the Send test button sends a synthetic event to your URL. The body carries event: "webhook.test", but the X-Frihet-Event header carries invoice.created: a consumer that routes on the header will see the test as a created invoice; tell them apart by the body. Use this button to verify:
- That the URL is reachable from the internet
- That the HMAC signature validates correctly
- That your server responds with a
2xxcode
The test result appears immediately in the delivery log.
Troubleshooting
Not receiving webhooks
- Verify the webhook URL is correct and publicly accessible
- Check that the webhook is active in the dashboard
- Review delivery logs for errors
- If you use a firewall, ensure inbound POST requests from Google Cloud (
us-central1) are allowed
Signatures not matching
- Verify you're using the raw request body (before parsing the JSON)
- Confirm the secret in your code matches the one configured in the Frihet dashboard
- Do not modify or reformat the body before verifying the signature
- Check that your framework isn't automatically parsing the body before you can access the raw version
Retries not arriving
- Retries are processed every 5 minutes. If your endpoint was briefly down, the retry attempts may have already been exhausted
- Check the delivery history to confirm the status of each attempt
- If all 3 attempts failed, the delivery will not be retried automatically
Payload too large
If the resource associated with the event is very large (many line items in an invoice, extensive fields), the payload may exceed the 100 KB limit and the delivery will be rejected. Simplify the resource data or contact support if you need a higher limit.
Related: Webhooks configuration · REST API · MCP Server