Webhooks are a mechanism that allows magnews to automatically send notifications to external systems when a specific event occurs (for example a contact is created or an email is opened).
This page contains the technical documentation to implement them. If instead you want to understand when and why to use webhooks from a functional perspective, see the use-case article and integration scenarios.
Supported events (topics)
Webhooks operate via events, called topics.
Each topic represents an action or a change that happens inside magnews and can trigger a notification to an external system.
When you create a webhook subscription you choose which topics to listen to, depending on the information you need.
Below you will find the available topics grouped by functional area.
Contact management
| Topic | Description | Example use |
|---|---|---|
contacts/create |
A new contact is created in magnews. | Sync new contacts to CRM or external databases. |
contacts/update |
An existing contact's data is updated. | Keep profiles and information aligned across systems. |
contacts/unsubscription |
A contact requests to unsubscribe from communications. | Align subscription status across platforms. |
contacts/delete |
A contact is removed from the system. | Remove the contact from external systems as well. |
Communications
| Topic | Description | Example use |
|---|---|---|
communications/msg/sent |
Message sent. | Monitor sends in BI or CRM systems. |
communications/msg/open |
Message opened. | Update interest scores or segments. |
communications/msg/click |
Link clicked. | Trigger actions based on demonstrated interest. |
communications/msg/conversion |
Conversion tracked. | Trigger automations or update external KPIs. |
communications/msg/bounce |
Delivery error. | Handle delivery issues in other systems. |
communications/msg/complaint |
Marked as spam. | Update blacklists or reputation status. |
Transactional messages
| Topic | Description | Example use |
|---|---|---|
transactionals/msg/sent |
Message sent. | Track operational notifications (e.g. order confirmation). |
transactionals/msg/open |
Message opened. | Monitor interactions with operational notifications. |
transactionals/msg/click |
Link clicked. | Trigger subsequent actions in external systems. |
transactionals/msg/conversion |
Conversion tracked. | Connect operational events to internal systems. |
transactionals/msg/bounce |
Delivery error. | Handle critical undelivered notifications. |
transactionals/msg/complaint |
Marked as spam. | Align reputation status across systems. |
Workflow
| Topic | Description | Example use |
|---|---|---|
workflows/msg/sent |
Message sent within a workflow. | Monitor progress through automated paths. |
workflows/msg/open |
Message opened within a workflow. | React to behavior during a journey. |
workflows/msg/click |
Link clicked within a workflow message. | Trigger actions based on specific interactions. |
workflows/msg/conversion |
Conversion recorded within a workflow message. | Connect the journey to external systems. |
workflows/msg/bounce |
Delivery error within a workflow message. | Monitor issues in automated paths. |
workflows/msg/complaint |
Spam complaint within a workflow message. | Manage reputation and compliance for journeys. |
Technical guide to subscriptions
Webhook subscriptions are managed via a dedicated REST resource. A subscription defines where magnews should send notifications (the endpoint) and which events it should forward (topics).
Creating a subscription
To activate a webhook, send a POST request to /webhooks/create specifying:
-
uri
The URL of your endpoint that will receive notifications (e.g.https://your-system.com/webhook-receiver). -
topics
A comma-separated string with the desired topics (e.g.contacts/create,contacts/update).
For a complete example of the subscription API request, see our REST API documentation.
URL verification
When creating a subscription, magnews verifies the provided URL to ensure the endpoint is reachable and responds correctly.
- magnews sends a
POSTto the provided URL with JSON body{"verify": true}. - The request includes the
X-magnews-hmacsha256header (see "Signature verification"). - Your system must validate the signature and respond with
200 OK.
If verification fails, the subscription is not created and the endpoint returns an error. Creation may also fail if the maximum number of subscriptions per account has been reached.
Updating and deleting a subscription
Once created, you can manage a subscription using:
-
POST /webhooks/update
Updates an existing subscription.idis required;uri,topicsandstatusare optional. -
DELETE /webhooks/delete/{id}
Deletes a subscription. Returns200if successful and404if the subscription does not exist.
Event handling and security
All webhook notifications sent by magnews are POST requests with a JSON body. The receiving endpoint must respond with 200 OK to confirm receipt: any other status is considered an error and the event will be retried (see "Error handling, retry and backoff" for details).
HTTP headers
Each notification includes the following technical headers:
-
X-magnews-webhook-topic: the topic that triggered the event (e.g.contacts/update). -
X-magnews-webhook-subscriptionid: the unique subscription ID. -
X-magnews-webhook-event-timestamp: the event timestamp in ISO 8601 format (UTC). -
X-magnews-hmacsha256: security signature of the payload.
Signature verification (HMAC-SHA256)
To ensure the request comes from magnews, verify the HMAC-SHA256 signature in the X-magnews-hmacsha256 header. The signature is calculated from the raw request body and the client_secret associated with the Digital Certificate linked to your application.
- Retrieve the raw body of the request (without transformations or parsing).
- Compute the HMAC-SHA256 of the body using the
client_secretas key. - Compare the resulting hash with the value of
X-magnews-hmacsha256.
If the two values match, the request can be considered authentic.
HTTPS requirements
The endpoint must be exposed over HTTPS and present a valid certificate (not self-signed).
Event delivery timing
Event delivery via webhooks happens in near real-time. This means the event is not necessarily delivered at the exact instant it occurs inside the platform.
Under normal conditions notifications are sent within a few seconds, but a delay of several minutes may occur, particularly when processing queues or high load are present.
For this reason integrations should treat webhooks as eventually consistent and not as synchronous notifications.
Error handling, retry and backoff
Each subscription maintains its own event progress. In case of errors, magnews applies retry logic with progressive backoff to avoid frequent attempts to unreachable endpoints.
If consecutive errors exceed predefined thresholds, the subscription may be automatically suspended to avoid inefficient use of resources. In that case, after fixing the problem on the endpoint, the webhook must be manually reactivated (via API call).
Monitoring
A monitoring view is available at Monitor > Development > Webhook, intended for a quick check of subscription status.
The screen shows key information for each webhook, including:
- endpoint (URI)
- subscribed topics
- last execution
- active backoff (if any)
- subscription status (active or suspended)
If the system detects consecutive delivery errors to an endpoint, automatic system notifications are triggered:
- Malfunction warning: sent when a threshold of consecutive errors is exceeded to indicate reachability or response issues.
- Suspension notification: sent when the subscription is automatically suspended due to persistent errors.
Notifications are sent to the email addresses associated with the account's main contacts (for example the commercial contact and the customer contact). Manual configuration of recipient addresses is not available.
If a subscription is suspended, after resolving the technical issue on the external endpoint the subscription must be manually reactivated.