Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chamilonster/Piumy/llms.txt
Use this file to discover all available pages before exploring further.
router.json is the whitelist and routing table for Piumy. It controls two things: which phone numbers are allowed to reach the switchboard at all (the inbound gate), and how matched numbers’ messages are routed once through (mode and bridge plugin). Its path is set via PIMYWA_ROUTER (default router.json). The file is loaded at startup — to apply changes, restart pimywa-core. The in-memory router can also be inspected and mutated live via GET /api/router and POST /api/router/whitelist.
Example
The following is the annotated example fromcore/router.example.json:
- Only
56999999999@s.whatsapp.netcan send messages through the gateway (whitelist). - That specific number is routed to
advancedmode with themcp-agentplugin. - The wildcard
"*"route is a catch-all for any number that somehow passes the whitelist — here it also goes toadvancedmode with no plugin. - All numbers not in the whitelist are silently dropped at the gateway level before routing is even consulted.
Fields reference
If
true, all inbound numbers bypass the whitelist check entirely — any
number can send messages through the gateway. Leave this false in
production. It exists for development and testing only.The routing mode applied to numbers that pass the whitelist but are not
matched by any entry in
routes. Either auto (bridge-driven auto-reply)
or advanced (queued for an MCP agent).Phone JIDs in
number@s.whatsapp.net format. Only these numbers pass the
inbound gateway filter — all other numbers are dropped before any routing
logic runs. Managed live via POST /api/router/whitelist.Ordered list of routing rules. Routes are evaluated in order; the first
match wins. Each route object has the following fields:
match(string) — Exact JID (56999999999@s.whatsapp.net) or the wildcard string"*"which matches any JID. A wildcard route at the end acts as a catch-all default.mode(string) —autooradvanced. Overridesdefault_modefor matched numbers.plugin(string) — The bridge plugin forautomode:none(no auto-reply drafting) ordirect-api(DeepSeek bridge). Ignored whenmodeisadvanced.model(string) — Model name recorded in the chat’slast_modelfield (informational; used by the dashboard to show which model replied). Empty string if not applicable.
JID format
WhatsApp JIDs are phone numbers in international format without the leading+, suffixed with the server:
| Type | Format | Example |
|---|---|---|
| Individual | <number>@s.whatsapp.net | 56999999999@s.whatsapp.net |
| Group | <number>@g.us | 120363000000000001@g.us |
56912345678@s.whatsapp.net.
Per-chat rules vs. routing
router.json is the inbound gate — it decides whether a message enters the system at all. What the agent is allowed to say in response is a separate concern: per-chat behavior rules are set via the dashboard or POST /api/chats/rules. For send_message to work, both conditions must be true: the number must be whitelisted in router.json AND the chat must have effective rules configured.