Skip to content

Webhook, links and redirect

PLUS

A statically built front end needs to know when your properties have changed so that it can rebuild the affected pages. For this, WP-ImmoMakler calls an address of your front end after every transfer from your CRM software: the webhook. The two other options on this page make sure that links and visitors that still arrive at WordPress end up at the front end.

You will find all settings in the back end of your website (wp-admin) under WP-ImmoMakler → Integrations → Headless.

Enable Send webhook and enter the address that your front end provides for notifications under Webhook URL, for example https://www.your-domain.com/api/revalidate/. Enter the address exactly as your front end answers it, with a trailing slash for the Astro starter: if the front end redirects, for example from an address without a trailing slash to one with it, WP-ImmoMakler does not follow the redirect and notes “Headless webhook refused by the front end” in the log, together with the status of the redirect, for example 308. WP-ImmoMakler collects changes and sends them in bundles: after an import that creates, changes or deletes many properties, a single message goes out once the seconds set under “Wartezeit” (German label, not yet translated) have passed without further changes (default: 60). A property published or deleted by hand is reported in the same way.

The message is a POST with a JSON document:

{
"event": "properties.changed",
"api_version": 1,
"site": "https://wordpress.your-domain.com/",
"api_base": "https://wordpress.your-domain.com/wp-json/immomakler-headless/v1",
"sent_at": "2026-10-12T18:30:00+00:00",
"delivery_id": "6f1c…",
"import_counts": { "files_imported": 1, "created": 2, "updated": 14, "deleted": 1 },
"created": [ { "objektnr_extern": "WP1240", "post_id": 4711, "title": "…", "frontend_url": "https://www.your-domain.com/properties/…/" } ],
"updated": [ … ],
"deleted": [ { "objektnr_extern": "WP1101", "post_id": 0, "title": "…" } ],
"full_rebuild_hint": false
}

created, updated and deleted name the affected properties by their object number; a front end rebuilds the pages named or triggers a full build. full_rebuild_hint is true when something has changed that cannot be assigned to a single property, such as settings that affect all pages. A front end should respond to it with a full build.

Every message carries the headers X-ImmoMakler-Event, X-ImmoMakler-Delivery (a unique identifier), X-ImmoMakler-Timestamp (Unix time of sending) and X-ImmoMakler-Signature. The signature is sha256= followed by the HMAC-SHA256 over timestamp.body, using the webhook secret from the settings as the key. Your front end calculates the same value over the unchanged body and compares it; if it differs, or if the timestamp is more than a few minutes old, it discards the message.

import { createHmac, timingSafeEqual } from 'node:crypto';
const expected = 'sha256=' + createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const valid = timingSafeEqual(Buffer.from(expected), Buffer.from(signatureHeader));

WP-ImmoMakler generates the secret the first time the settings are opened; with Generate new secret you replace it, after which the front end must also know the new secret.

If your front end does not respond with a 2xx status, or does not respond at all, WP-ImmoMakler repeats the delivery after 1, 5 and 30 minutes, 2 and 6 hours. After that it gives up on the message and notes this in the log immomakler-headless-*.log in the import directory; the next change starts afresh. You can see the status of the last delivery in the settings under Webhook, and with Send test message you send a message with the ping event to check the connection.

With Rewrite links to the front end, all links that WordPress builds to a property, the property list or a category point to the front end: in the emails for contact enquiries and property alerts, in feeds, in menus and in the “View” links of the back end. The interface itself continues to give the WordPress address under wp_url.

As soon as the front end serves the property pages, enable Redirect visitors to the front end. When a visitor or a search engine requests a property, the property list or a category on your WordPress website, WP-ImmoMakler responds with a permanent redirect (301) to the corresponding page of the front end; search parameters of the property list are carried over. This way addresses listed in search engines keep their value.

The following are not redirected: the PDF expose, the preview image for social networks, the QR code, the gallery and map iframes, the feeds for Kyero and the Facebook catalogue, previews, and logged-in users who are allowed to edit posts. An address with the parameter ?noredirect also stays on WordPress.