Message Push Service

A notification service that pushes messages to your phone, mailbox or QQ. Three channels are available now: ServerChan (WeChat push), Email and QQBot; more push platforms/channels can be added later.

/api/push/

Service Description

The message push service sends what happens on your server / scripts / devices to your phone, mailbox or QQ — ideal for alerts, task-completion notices and scheduled-job summaries. Three channels are available now: ServerChan (WeChat push), Email and QQBot.

Which channel the message actually reaches (WeChat service account, WeCom app message, WeCom/DingTalk/Feishu group bot, Bark, PushDeer or a custom webhook) is decided by the channel configuration in the ServerChan console — switching channels requires no code change.

The SendKey is hosted server-side: add an account whose platform is "ServerChan" in the superadmin console's Account Management, and put the SendKey in the credential field (stored encrypted, never shown on pages). Callers neither need to nor should pass a SendKey.

The email channel comes from the former Email Service's send feature: POST /api/push/email/send and the old /api/email/v1/send share one implementation with identical parameters and response, and the old route keeps working.

The QQBot channel sends messages to QQ groups / friends through NapCat (OneBot 11 HTTP); the NapCat HTTP address and token are maintained on the superadmin console's QQBot page, and callers only pass the target and the content.

These endpoints require a project signature; every push leaves a record in the console's Push Logs (both successes and failures).

Response Format

Every endpoint returns the same JSON envelope; the payload is always inside data:

{
  "code": 10000,
  "msg": "成功",
  "data": { ... }
}
  • code: business status code. 10000 means success; anything else is an error — see the Error Codes page for the full list.
  • msg: a human-readable message you can show to end users, but never use it for program logic.
  • data: the payload; usually null on error. Each endpoint's Response section lists its data fields.

Judge success by code, not by the HTTP status code. View all error codes

ServerChan

ServerChan (sct.ftqq.com) WeChat push Signature Required

Push messages via a ServerChan SendKey; the SendKey is hosted server-side (console's Account Management). Project signature required.

POST /api/push/serverchan/send Total calls: 0

Send Message

Send a message; it is delivered to WeChat (or any other channel configured in your ServerChan console) through ServerChan.

Required: message title, up to 32 characters, no line breaks

Optional: message content, Markdown supported (paid members' cards can show the full text)

Optional: the message channel for this push; if not selected, the default channel set on the "Channel Config" page of ServerChan is used. To push to two channels at once, pass a combined value separated by | (e.g. 9|66). Channel values: Fangtang WeChat service account=9, WeCom app message=66, WeCom group bot=1, DingTalk group bot=2, Feishu group bot=3, Bark iOS=8, PushDeer=18, official Android client=98, test account=0, custom=88.

Optional: short-link title for the card message

Optional: message tags, separated by |

Optional: WeCom member openids to copy the message to, separated by |

Optional: whether to hide the source IP of this call; when hidden, ServerChan does not record the caller IP.

Optional: when set, desp is end-to-end encrypted before pushing, so the message stays ciphertext on ServerChan / WeChat; the recipient must enter the same password on the message detail page to read it. Share the password out-of-band — this platform does not store it.

  • title is at most 32 characters with no line breaks; desp supports Markdown.
  • The SendKey is hosted server-side (console Account Management → pick the "ServerChan" platform and put the SendKey in the credential field); callers do not pass it.
  • Free ServerChan accounts are limited to 5 messages per day and 50 per minute; when exceeded, the upstream returns an error code (this API reports it as an external service error).
  • When the upstream returns a non-zero code, this API returns 40001 with the upstream reason in msg.
  • Sending is asynchronous: a successful response only means it was queued. Use the status query endpoint and check wxstatus for actual delivery.
  • Passing encrypt_password enables end-to-end encryption: the push log stores the ciphertext, not the plaintext content.
Response Common envelope
Field Type Description
pushid string Identifier of this push; use it with the status query endpoint
readkey string Read key used for the status query endpoint and the reading page URL
encrypted bool Whether this push is end-to-end encrypted (true when encrypt_password was passed)
Example response
{"pushid": "11223344", "readkey": "abcdef123456", "encrypted": false}
GET /api/push/serverchan/status Total calls: 0

Query Push Status

Use the pushid + readkey returned by "Send Message" to check this message's actual delivery result (wxstatus).

Required: the pushid returned by the send endpoint

Required: the readkey returned by the send endpoint

  • ServerChan sends asynchronously: a successful send response only means "queued". Whether it actually reached WeChat is shown by wxstatus from this endpoint.
  • An empty wxstatus means the task may not have run yet; retry later.
Response Common envelope

data is the upstream push-detail JSON; wxstatus is the raw WeChat API result (empty means it may not have run yet). Refer to the actual response.

XiaoYingAPI · Unified API Aggregation Service