---
title: Receive Monitoring Webhooks
description: Have MarsYoo send your server a signed notification when each monitoring subscription run finishes.
type: guide
status: stable
updated: 2026-12-03
url: /en/docs/webhooks
markdown: /en/docs/webhooks.md
---

Read as needed; not a required onboarding step. Path：[Data Access Path](/en/docs)

# Receive Monitoring Webhooks

When a monitoring subscription run finishes, MarsYoo can send an HTTPS request to your server. By the end of this page you can configure the endpoint, verify signatures and handle duplicates and resends.

A notification only says "this run finished"; it doesn't contain the collected content. Read data with the [change feed](/en/docs/change-feed) or [browse](/en/docs/browse).

## Configure the endpoint [#configure]

In the console's [notification settings](/en/portal/notifications):

1. Choose an application and a monitoring subscription.
2. Enter the receiving URL; one per subscription.
3. Save, and copy the signing secret right away. **The secret is shown only once** and can't be viewed again.

Requirements:

- A public HTTPS URL you control, on port 443.
- No internal addresses, no credentials or query string in the URL, no redirects.
- Only organization owners and admins can save, disable, rotate the secret or resend; other members can view.

> Note: Saving the configuration cancels notifications that haven't been sent yet. They aren't sent to the new URL or re-signed with the new secret.

Disabling notifications doesn't affect the subscription. This feature is console-only, with no API. If the page says the service isn't configured, contact us to enable it.

## What a notification contains [#payload]

| Event | Sent when |
| --- | --- |
| `collection.subscription.completed` | A run finally completes |
| `collection.subscription.failed` | A run finally fails or times out |

Runs still retrying, paused or canceled don't send notifications.

The body contains:

- The event ID, `schema_version: 1`, the time it happened and the subscription ID.
- `task`: the run ID, final status, and counts `collected_count`, `ingested_count`, `duplicate_count`.

No body text or execution details. A completed run doesn't mean the content is searchable yet.

## Verify the signature [#verify]

Each notification carries these headers:


```text
X-Whale-Delivery-ID: <event ID>
X-Whale-Timestamp: <Unix seconds at send time>
X-Whale-Signature: v1=<lowercase hex HMAC-SHA256>
Content-Type: application/json
```


To verify:

1. Build the signed string: `timestamp + "." + event ID + "." + raw request body`.
2. Compute HMAC-SHA256 using the secret's **string bytes** as the key (don't base64-decode it), as lowercase hex.
3. Compare it with the value after `v1=` in `X-Whale-Signature` using a constant-time comparison.
4. Reject requests whose timestamp is more than 300 seconds from now.

> Note: Verify against the raw body you received. Parsing and re-serializing JSON changes the bytes and the signature won't match.

## Handle duplicates and ordering [#dedupe]

- You may receive the same notification more than once. Deduplicate by event ID and store processed IDs durably.
- Order isn't guaranteed.
- Return `2xx` as soon as you've stored the notification reliably.

## Retries and resends [#retry]

Automatic retries:

- Up to 6 attempts per notification.
- Network errors and `408`, `425`, `429`, `5xx` are retried with exponential backoff starting at 15 seconds.
- Other non-`2xx` statuses (including redirects) aren't retried.
- Each attempt waits at most 10 seconds. Notifications older than 7 days aren't sent.

Manual resends: notification settings show each notification's status, attempts and error code.

- Completed or failed notifications can be resent manually up to 3 times within 7 days of creation, at least 1 minute apart.
- Waiting, sending or canceled notifications, or ones whose configuration has changed, can't be resent.
- Up to 10 resends per application per minute.
- A resend keeps the original event ID and body but has a new timestamp and signature. Keep deduplication in place.

## Continue Your Task

[Return to the integration path](/en/docs); return to your task after consulting this reference.
