Site Group Rate Rate change Dilution Latency 7-day uptime Availability
Site Group Rate Rate change Dilution Latency 7-day uptime Availability
Site Group Rate Rate change Dilution Latency 7-day uptime Availability
Site Group Rate Rate change Dilution Latency 7-day uptime Availability
Site Group Rate Rate change Dilution Latency 7-day uptime Availability
When a site you follow changes availability or pricing, or a cheaper alternative group is found, zzstan sends a JSON event request to the Webhook URL you configured. Webhook is free for everyone, with a small credit cost to prevent abuse. This page covers delivery requirements, event types, payload structure, and signature verification. Set the callback URL and subscription scope in Account Center → Webhook .
Scope: when a subscribed site or group triggers an enabled event, zzstan sends a notification to the matching callback URL. Request format: every notification is an HTTP POST with a JSON body; see the field reference below. Success response: your receiver should return 2xx within the timeout; timeouts or other status codes count as failures and are retried per your settings. Security: verify the signature before parsing or processing the event, to confirm the request really comes from zzstan and was not tampered with. Onboarding check: after the first setup or any change, send a test event and check the latest success or failure results on the Webhook management page. Event Trigger Parameters Price network_outage Site network layer unreachable repeatedly, beyond the tolerance window Availability events network_recovery Site network layer recovered from an outage Availability events ai_outage Site AI endpoint unavailable for longer than the tolerance window (5 minutes by default) Availability events ai_recovery Site AI endpoint recovered from an outage Availability events price_increase A watched group's pricing multiplier rose to your "rises to" alert value Price events price_decrease A watched group's pricing multiplier fell to your "drops to" alert value Price events alternative_group A cheaper similar group was found on another site (different site, lower rate, overlapping flagship models) Alternative group events webhook.test
Every callback sends a JSON body that includes the following common fields:
Field Type Description event string Event type (see table above) site_id int Site ID. Always 0 for subscription events (the real site is data.site_id); the real site ID for webhook.test timestamp int Unix timestamp of the event, in seconds data object Event data; the shape varies by event (see below) group_id int? Group ID. Present only on group-level events
Availability events network_outage / network_recovery / ai_outage / ai_recovery
Field Type Description site_id int Site ID site_name string Site name title string Event title content string Event description
zzstan includes an X-Zzstan-Signature header in every callback request; the value is computed from the signing secret and the unparsed request body. Receivers verify the signature with these steps:
Configure and save the callback URL under "Account Center → Webhook"; a signing secret is generated automatically (dcwh_ prefix). On receiving a request, read the raw body first; do not parse the JSON before the signature check passes. Read the X-Zzstan-Signature request header. Compute HMAC-SHA256 over the raw body with the signing secret; the hex output is the expected signature. Compare the expected signature with the header in constant time; continue only when they match, otherwise reject the request. The samples below show how to receive a request, verify its signature, and parse the event. Replace APP_SECRET with your signing secret.
Python (FastAPI) Node.js (Express) Go PHP Java
from fastapi import FastAPI, Request, HTTPException
import hmac
import hashlib
APP_SECRET = "dcwh_your_secret"
app = FastAPI()
@app.post("/webhook")
async def webhook(request: Request):
raw = await request.body()
signature = request.headers.get("X-Zzstan-Signature", "")
expected = hmac.new(
APP_SECRET.encode(), raw, hashlib.sha256
).hexdigest()
if not hmac.compare_digest(signature, expected):
raise HTTPException(status_code=401, detail="invalid signature")
payload = await request.json()
event = payload["event"] # 事件类型
data = payload["data"] # 事件数据
# ...按 event 处理 data...
return {"ok": True}Triggered manually on the settings page to test your receiver
1,000 credits / 10k events
status string Current status (outage / operational / degraded)
Full request example
{
"event": "ai_outage",
"site_id": 0,
"timestamp": 1719000000,
"data": {
"site_id": 1001,
"site_name": "示例中转站",
"title": "示例中转站 AI 不可用",
"content": "检测到 AI 接口持续不可用,已超过 5 分钟容错窗口。",
"status": "outage"
},
"group_id": 2001
}Price events price_increase / price_decrease
Field Type Description site_id int Site ID site_name string Site name channel_name string Group (channel) name title string Event title content string Event description current_ratio float Current rate target_ratio float Your "rises to / drops to" alert value
Full request example
{
"event": "price_increase",
"site_id": 0,
"timestamp": 1719000000,
"data": {
"site_id": 1001,
"site_name": "示例中转站",
"channel_name": "Claude 专线",
"title": "示例中转站 / Claude 专线 倍率上涨",
"content": "倍率已涨至 1.8,触发您设置的「涨至 1.6」提醒。",
"current_ratio": 1.8,
"target_ratio": 1.6
},
"group_id": 2001
}Alternative group events alternative_group
Field Type Description site_id int Site ID hosting the new alternative group site_name string Name of the site hosting the new alternative group new_group_id int New alternative group ID title string Event title content string Event description new_ratio float New group's rate (cheaper) sub_ratio float Rate of the group you follow (the one replaced)
Full request example
{
"event": "alternative_group",
"site_id": 0,
"timestamp": 1719000000,
"data": {
"site_id": 1002,
"site_name": "另一中转站",
"new_group_id": 3001,
"title": "发现更便宜的替代分组",
"content": "另一中转站 / GPT 通道 提供同类模型,倍率 1.2 低于您关注的 1.5。",
"new_ratio": 1.2,
"sub_ratio": 1.5
},
"group_id": 2001
}Test events webhook.test
Field Type Description message string Fixed text: zzstan Webhook test group_id int? Group ID (present for user-level group-target tests)
Full request example
{
"event": "webhook.test",
"site_id": 1001,
"timestamp": 1719000000,
"data": {
"message": "中转神探 Webhook 测试",
"group_id": 2001
},
"group_id": 2001
}
1,000 credits / 10k events
1,000 credits / 10k events
1,000 credits / 10k events
1,000 credits / 10k events
1,000 credits / 10k events
1,000 credits / 10k events
1,000 credits / 10k events