Hage
Hagahan wuxuu ku qoran yahay Ingiriisi.
Webhooks
Raadiso calls your server when something happens that you would otherwise have to ask about: a buyer writes about one of your listings, a listing goes live, is refused or is taken down. Each call is signed, so your server can tell it came from Raadiso and was not changed or replayed.
Events
Every delivery is one event, a POST with a small JSON body. Bodies carry ids and codes only, never a
message, a name or contact details: fetch the details with your token.
| Event | When | data |
|---|---|---|
lead.created |
A buyer starts a conversation about one of your listings | leadId, listingExternalId |
lead.message_received |
A buyer writes again in a conversation | leadId, listingExternalId |
listing.published |
A listing is live on Raadiso | listingId, listingExternalId |
listing.rejected |
The marketplace rules refused a listing | listingId, listingExternalId, reason |
listing.removed |
Raadiso's moderators took a listing down | listingId, listingExternalId, reason |
webhook.ping |
You asked for a test delivery | nothing |
{
"type": "lead.created",
"timestamp": "2026-10-23T09:58:01Z",
"data": {
"leadId": "5f0e2b8c-7d43-4c2e-8f3b-2c1d0e9a7b66",
"listingExternalId": "room-deluxe-12"
}
}
Add an endpoint
POST /partner/v1/webhooks with the URL and
the events you want (scope webhooks:manage). The URL must be https on port 443, with a public host
name: no IP address, no private or internal name. Raadiso checks it when you save it and again before
every delivery. An organization has at most five endpoints.
The answer carries the endpoint's signing secret, once. It starts with whsec_. Store it in your
secret store at once; Raadiso never shows it again. In the examples below it comes from the environment
variable RAADISO_WEBHOOK_SECRET.
Verify every delivery
Each delivery carries three headers, from Standard Webhooks:
webhook-id: the event's id, the same on every retry;webhook-timestamp: when this attempt was signed, in seconds since 1970;webhook-signature:v1,<signature>, or two of them separated by a space while a secret is rotating.
To verify one:
- Refuse a timestamp more than 5 minutes (300 seconds) from your clock: it may be a replay.
- Take the secret's bytes: the base64 after
whsec_, decoded. - Compute the HMAC-SHA256 of
{webhook-id}.{webhook-timestamp}.{body}with those bytes, where the body is the request's raw bytes, before any JSON parsing, and encode it in base64. - Compare it, in constant time, with each
v1,signature inwebhook-signature. One match is enough.
Then answer any 2xx within 10 seconds, and do the work afterwards (a queue, a background job).
Verify the signature (TypeScript)
Node.js, with the raw body as a string (in Express, express.text({ type: 'application/json' }) on
this route):
import { createHmac, timingSafeEqual } from 'node:crypto';
/** True when a delivery comes from Raadiso: a fresh timestamp and a matching signature. */
export function verifyWebhook(
headers: Record<string, string | undefined>,
rawBody: string,
secret: string, // process.env.RAADISO_WEBHOOK_SECRET ("whsec_…")
): boolean {
const id = headers['webhook-id'];
const timestamp = headers['webhook-timestamp'];
const signatures = headers['webhook-signature'];
if (!id || !timestamp || !signatures || !/^\d+$/.test(timestamp)) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
const expected = createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest();
return signatures.split(' ').some((entry) => {
const [version, value] = entry.split(',');
if (version !== 'v1' || !value) return false;
const given = Buffer.from(value, 'base64');
return given.length === expected.length && timingSafeEqual(given, expected);
});
}
Verify the signature (Python)
With the raw body as bytes (in Flask, request.get_data(); its request.headers ignores case):
import base64
import hashlib
import hmac
import time
def verify_webhook(headers, raw_body: bytes, secret: str) -> bool:
"""True when a delivery comes from Raadiso: a fresh timestamp and a matching signature."""
msg_id = headers.get("webhook-id")
timestamp = headers.get("webhook-timestamp")
signatures = headers.get("webhook-signature")
if not msg_id or not timestamp or not signatures or not timestamp.isdigit():
return False
if abs(time.time() - int(timestamp)) > 300:
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
signed = f"{msg_id}.{timestamp}.".encode() + raw_body
expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
for entry in signatures.split(" "):
version, _, value = entry.partition(",")
if version == "v1" and hmac.compare_digest(value, expected):
return True
return False
Verify the signature (PHP)
With the raw body from php://input and the headers in lower case:
<?php
/** True when a delivery comes from Raadiso: a fresh timestamp and a matching signature. */
function verify_webhook(array $headers, string $rawBody, string $secret): bool
{
$id = $headers['webhook-id'] ?? '';
$timestamp = $headers['webhook-timestamp'] ?? '';
$signatures = $headers['webhook-signature'] ?? '';
if ($id === '' || $signatures === '' || !ctype_digit($timestamp)) {
return false;
}
if (abs(time() - (int) $timestamp) > 300) {
return false;
}
$key = base64_decode(preg_replace('/^whsec_/', '', $secret), true);
$expected = base64_encode(hash_hmac('sha256', "$id.$timestamp.$rawBody", $key, true));
foreach (explode(' ', $signatures) as $entry) {
[$version, $value] = array_pad(explode(',', $entry, 2), 2, '');
if ($version === 'v1' && hash_equals($expected, $value)) {
return true;
}
}
return false;
}
$headers = array_change_key_case(getallheaders(), CASE_LOWER);
$rawBody = file_get_contents('php://input');
if (!verify_webhook($headers, $rawBody, getenv('RAADISO_WEBHOOK_SECRET'))) {
http_response_code(401);
exit;
}
http_response_code(204);
Retries
Delivery is at least once, in no guaranteed order. Keep the webhook-ids you have handled for a
day and drop repeats.
A delivery that gets no 2xx within 10 seconds is tried again after 5 seconds, 5 minutes, 30 minutes,
2 hours, 5 hours and 10 hours, for up to 24 hours in all. After that it goes to Raadiso's dead-letter
queue: ask Raadiso support to send those again once your endpoint works.
An endpoint where every delivery failed for 24 hours is switched off (enabled: false,
disabledReason: failing) and your organization's account is e-mailed.
PATCH /partner/v1/webhooks/{webhookId}
with "enabled": true switches it back on.
Test an endpoint
POST /partner/v1/webhooks/{webhookId}/ping
sends a webhook.ping, signed like any other event.
GET /partner/v1/webhooks/{webhookId}/deliveries
shows the last 7 days of deliveries: each one's state, attempts and your server's status code.
Rotate the secret
POST /partner/v1/webhooks/{webhookId}/rotate-secret
answers a new secret, once. For the next 24 hours every delivery carries two signatures, one with the
old secret and one with the new, so the code above accepts deliveries whichever secret your servers
have while you deploy the new one.