Create channels in the dashboard under Notifications, or with
POST /v1/notifications/channels. Custom channel deliveries are signed.
Channel types
channel_type | Configure with | Delivery format |
|---|---|---|
slack | url at hooks.slack.com/services/… | Slack blocks |
discord | url at discord.com/api/webhooks/… | Embeds |
telegram | config.chat_id and secrets.bot_token | Bot API sendMessage |
feishu | url at open.feishu.cn/open-apis/bot/v2/hook/…; optional config.keyword and secrets.sign_secret | Interactive card |
wecom | url at qyapi.weixin.qq.com/cgi-bin/webhook/send… | Markdown |
dingtalk | url at oapi.dingtalk.com/robot/send…; optional secrets.sign_secret | Markdown |
email | config.recipients, limited to team member addresses | Email via Resend |
custom | url, config.auth_type, and credentials | JSON envelope with an HMAC signature |
Preset channel URLs must match both the allowed hostname and path prefix.
Custom channels authenticate with a preset config.auth_type instead of arbitrary
headers:
auth_type | Required secrets | Sent as |
|---|---|---|
none, the default | none | no Authorization header |
bearer | token | Authorization: Bearer <token> |
basic | username and password | Authorization: Basic <base64> |
secrets are stored encrypted and never returned by any read endpoint. Each team is
limited to 20 channels.
Events
| Event | Fires when |
|---|---|
crawl.started | a crawl job is accepted and queued |
crawl.completed / crawl.failed | a crawl job reaches a terminal state |
monitor.page | a monitor check observes new, changed, or removed |
monitor.check.completed | every monitor check finishes, including same and error |
notification.test is sent only by the Test action or channel_test.
crawl.page is available only on request-level crawl webhooks.
Custom channel signatures
Every delivery carries X-LeanCrawl-Event with the event type and
X-LeanCrawl-Delivery with the delivery ID used by the resend endpoint.
X-LeanCrawl-Signature: t=<unix_seconds>,v1=<hmac-sha256-hex>Sign {t}.{rawBody} with the original request body. Reject timestamps more than 300
seconds old. Do not re-serialize the JSON before verification.
Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';
const parts = Object.fromEntries(sig.split(',').map((p) => p.split('=', 2)));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) throw new Error('stale');
const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest();
const received = Buffer.from(parts.v1, 'hex');
if (received.length !== expected.length || !timingSafeEqual(received, expected)) {
throw new Error('invalid signature');
}Python
import hashlib, hmac, time
parts = dict(p.split('=', 1) for p in sig.split(','))
signed = f"{parts['t']}.{raw_body}".encode()
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
assert abs(time.time() - int(parts['t'])) <= 300
assert hmac.compare_digest(expected, parts['v1'])Payload
Custom channels receive the envelope {success, type, id, data, error}. data is
event-specific. Preset channels receive their native message format rendered from the
same event data. Payloads may include content fragments from the target page. Render
them as text, never as HTML.
monitor.page data:
| Field | Notes |
|---|---|
url | monitored page URL |
status | new, changed, or removed |
check_id | fetch the full diff with GET /v1/monitor/{id}/checks/{check_id}/diff |
snapshot_id / prev_snapshot_id | compared snapshots; retrieve content with GET /v1/monitor/{id}/snapshots/{snapshotId} before it expires |
excerpt | first 500 characters of new content; null for removed |
diff_excerpt | change summary {a, d, l, tr}; line types a, d, and c mean added, deleted, and context |
crawl.* payloads carry the job identity: job_id, url, status, page counts, and
credit_cost. A job that ends partial emits crawl.completed with
data.truncated_by_credits: true. Its results are incomplete.
Request-level crawl webhooks
POST /v1/crawl accepts webhook: {url, events, secret?} for that job. It supports
crawl.page, which managed channels do not. Supply your own secret to verify
signatures; an omitted secret is generated but never returned. Request-level deliveries
cannot be listed or resent. Use managed channels for persistent notifications. If both
target the same URL, it receives both deliveries.
Retries
Failed deliveries retry after 60 seconds, 300 seconds, and 900 seconds. After the last
attempt the delivery is marked dead. Resend it from the dashboard or with
POST /v1/notifications/channels/{channelId}/deliveries/{deliveryId}/resend. A
Retry-After response header is honored. Disabling a channel marks its in-flight
deliveries dead, and deleting a channel keeps deliveries for audit.
Managing channels via API
Authenticate with Authorization: Bearer sk-….
| Route | Notes |
|---|---|
GET /v1/notifications/channels | List channels; secrets are not returned |
POST /v1/notifications/channels | Create a channel; a custom channel's response includes signing_secret once |
PATCH /v1/notifications/channels/{id} | Update settings; changing url retargets pending deliveries |
POST /v1/notifications/channels/{id}/rotate | Rotate a custom channel's signing secret; returned once |
DELETE /v1/notifications/channels/{id} | Delete the channel and detach monitors; delivery history remains |
GET /v1/notifications/channels/{id}/deliveries | Most recent 50 deliveries, without pagination |
POST /v1/notifications/channels/{id}/deliveries/{deliveryId}/resend | Retry a failed or dead delivery now |
POST /v1/notifications/channels/{id}/test | Send a test event, up to 10 per hour per team |
PATCH supports name, url, events, status, config, and secrets. Use
name: null to clear the name. Secrets merge by key: an empty string preserves the
stored value, and an omitted key removes it.
The same surface is available from MCP as channel_list, channel_create,
channel_update, channel_rotate, channel_deliveries, channel_resend,
channel_delete, and channel_test.
Rotating secrets
POST /v1/notifications/channels/{id}/rotate replaces the signing_secret without
changing its ID or monitor attachments.
The old secret stops working immediately. Update your receiver with the new secret before retrying failed deliveries. Retries and resends use the current secret.