# pingwa > WhatsApp alerts and questions from any tool or agent, to you and your team. > Works from any agent, script, cron or CI — plain HTTP, no OAuth, no vendor lock: a REST > call, a hook URL or an MCP tool. > Official WhatsApp API: the human texts "join" once, never links a personal number. > Messages go to the key owner's phone by default; `to` reaches the team (see Teams). Base URL: https://pingwa.dev ## Agent setup (do this when a human says "set up pingwa for me") Run the whole thing end-to-end. Only the WhatsApp tap needs the human. Works for BRAND-NEW and EXISTING numbers alike — an existing account just gets an additional named key (up to 10), nothing is rotated or taken over. 1. Ask the human for their phone number in E.164 (e.g. +15551234567). 2. POST https://pingwa.dev/v1/registrations {"phone_e164":"+15551234567","key_name":"my-agent"} → save `id` and `claim_token` (shown once). `key_name` (optional) names the key you will receive. See "Agent registration" below for the full field list. 3. Show the human `wa_link` (or render `qr_svg`) and tell them to tap it and send the prefilled "verify " on WhatsApp from that exact number. 4. Poll GET https://pingwa.dev/v1/registrations/ with header X-Claim-Token until status=verified. 5. POST https://pingwa.dev/v1/registrations//claim with header X-Claim-Token → returns `api_key` exactly once. 6. Store it as PINGWA_KEY. Do NOT print the key back to the human. Then wire it in: - MCP client: add the server block from "MCP server & CLI" with the header `Authorization: Bearer `, or - CLI: export PINGWA_KEY and use `uvx pingwa send`. 7. Send a test: POST https://pingwa.dev/v1/notify {"text":"pingwa is set up ✅"} and confirm the human received it on WhatsApp. ## Onboarding (human does this once) The human sends `join llms` (plain `join` works too) via WhatsApp to +48797882513 (link: https://wa.me/48797882513?text=join%20llms). pingwa replies instantly with an API key (`pw_...`). Re-sending `join` mints an ADDITIONAL key (existing keys keep working; max 10 active). Replying `stop` disables sending. Key management from the phone: reply `keys` to list active keys, `revoke ` / `revoke all` to revoke. An AI agent cannot do this step — ask your human to tap the link (or better: use "Agent setup" above, which needs only one tap). ## Send a notification POST https://pingwa.dev/v1/notify Header: Authorization: Bearer pw_YOUR_KEY Body (JSON): {"text": "deploy finished"} # 1..1024 chars Optional: {"text": "build failed", "image_url": "https://.../screenshot.png"} - `image_url` (public https link WhatsApp can fetch) is sent as an IMAGE with `text` as the caption when your 24h reply window is open (e.g. a Playwright screenshot, a chart, a diff). Cold sends fall back to text only. CLI: `pingwa send --image-url URL "caption"`. Response 202: {"id": "...", "billing_class": "window_free|direct_send|template", "status": "queued"} Buttons under an alert (Ack, Snooze, or one of your actions): `actions`, `topic`, `ref`; see "Alert buttons" below. A send whose `topic` is snoozed answers 200 {"suppressed": true, "topic", "until"}: nothing sent, nothing counted. Optional header `Idempotency-Key: ` makes retries safe: the same key (per account) replays the ORIGINAL result — same message id, no second send, no extra quota — even under a concurrent retry. Use a fresh UUID per distinct message; reuse the same key when retrying the same message. Same key + a different body → 409 idempotency_conflict. Keys are honored for 24h. Also accepted on /v1/ask. Errors are self-describing JSON with fields error/message/action: - 401 unauthorized → action explains how to get a key (send 'join') - 402 quota_exceeded → free plan is 30 messages/month; every send counts, inside the 24h reply window too (quota resets on the 1st, UTC). It also carries `options`: the ways forward, cheapest first, each with the call that buys it (see Billing): for a low-volume number a prepaid pack first (each with "about N messages for your number"), else the next plan (a Team: more seats), then the packs. - 402 plan_limit → the action needs more than this plan includes (a capability limit such as hooks, schedules or team seats; the message quota keeps `quota_exceeded`). The body adds `limit` (the entitlement's name, as in `GET /v1/me` `entitlements`), `current` (this account's value now), `allowed` (the plan's value), `plan` and `upgrade_plan` (the cheapest plan that raises it, null = contact the operator); `action` says how to upgrade. Do not retry: the answer stays the same until the plan changes. - 403 notifications_stopped → user sent 'stop'; they must send 'join' to re-enable - 403 insufficient_scope → the API key is limited to other scopes; `required` names the scope this call needs (e.g. `{"error":"insufficient_scope","required":"send",...}`). Don't retry with the same key: use a key with that scope (see API keys) - 429 duplicate_message → the same text (+ image / ask options) was already sent too often from this account (default: 3 times in 10 minutes). Stop retrying: a `Retry-After` header gives the seconds until it is accepted again. Retry a send that may have failed with the same `Idempotency-Key` (a replay returns the original result and does not count); to send a new message, change its content. Applies to /v1/notify, /v1/ask and the MCP tools. - 429 daily_cap_reached → this account already sent its per-day cap of messages (UTC day; default 20 on free, 150 on pro, 500 on scale — the cap of the account's current plan). Stop sending: a `Retry-After` header gives the seconds until midnight UTC, when the count restarts. A replay with the same `Idempotency-Key`, a send refused as duplicate or a send that failed does not count. Applies to /v1/notify, /v1/ask and the MCP tools; `GET /v1/me` shows `usage.daily_cap` (null = no cap) and `usage.sent_today`. - 429 account_paused → this account kept sending after its sends were refused (repeated message, daily cap or send rate — default: more than 50 refusals in one hour), so every send is refused until `paused_until` (ISO time, in the error and in `GET /v1/me`; a `Retry-After` header gives the seconds left). The operator is alerted and may lift it early. Stop sending and fix the loop: never retry a 429 at once. A replay with the same `Idempotency-Key` of a send made before the pause still returns its original result. Applies to /v1/notify, /v1/ask and the MCP tools. - 503 delivery_enqueue_failed → recorded but not queued; retry shortly - A message accepted while the recipient's 24h window is closed can later show status `failed` with error `template_blocked` (GET /v1/messages): WhatsApp changed the notification template's category and pingwa held the send instead of paying another price. Not resent automatically; messages inside the 24h window are not affected. ## Ask a question and wait for the human's answer (two-way / human-in-the-loop) POST https://pingwa.dev/v1/ask Header: Authorization: Bearer pw_YOUR_KEY Body (JSON): {"text": "Deploy v2 to prod?", "buttons": ["Yes", "No", "Wait"], "timeout": 60} - `buttons` optional, up to 3 tap options (titles ≤20 chars). Inside the user's open 24h window they render as native WhatsApp tap buttons; otherwise the options are appended to the text and the human replies with the number or the option word — either way you get a structured `button_id` back. - Omit `buttons` for a FREE-TEXT answer: the human types whatever they want and it comes back in `reply.text`. Use this to let the human steer you mid-task ("which approach?", "what should I name it?", "anything else before I ship?"). - `timeout` optional seconds to block (default 60, max 90 — kept under the CDN's 100s limit). A timeout does NOT cancel the question. Response 200 (human answered): {"message_id","answered":true, "reply":{"answer_id","text","button_id","created_at"}} `button_id` is "b0","b1",... matching the buttons you sent (null for free text). Response 408 ask_timeout: {"message_id","action"} — the question was delivered; the human may still answer. Keep waiting with the reply endpoint below, or poll the inbox. Guards/quota are identical to /v1/notify (a paid ask costs one slot). - `timeout_ok` optional bool (default false). True: no answer within `timeout` is 200 {"message_id","answered":false,"reply":null} instead of 408, for platforms (Zapier, Make) that treat a 4xx as a failed step. The question stays open; read the answer with the reply endpoint below. A team ask (`to`) adds `group_id`, `recipients`, `skipped` (mode "all": `answers`, `pending`, `unreachable`). ## Poll for the reply to a specific message GET https://pingwa.dev/v1/messages//reply?wait=60 Header: Authorization: Bearer pw_YOUR_KEY Long-polls up to `wait` seconds (max 90). Returns the same {"answered":true,"reply":{...}} shape, or 408 no_reply_yet. Works for any outbound the human quoted or button-tapped, not only asks. Use this to resume waiting after an /v1/ask 408. ## Inbox (all inbound messages, long-poll) GET https://pingwa.dev/v1/inbox?since=&wait=30&limit=20 Header: Authorization: Bearer pw_YOUR_KEY Returns {"messages":[{id, body, button_id, reply_to_message_id, wa_message_id, created_at}], "cursor": "..."}. Pass the returned `cursor` back as `since` to get only newer messages (it is a URL-safe ISO-8601 timestamp). `wait` (max 90) long-polls until a message arrives or the timeout elapses; `wait=0` (default) returns immediately. Every inbound message opens/extends the 24h reply window. Prefer PUSH? Register a webhook instead of polling — see "Webhooks" below. ## Webhooks (pingwa PUSHES inbound messages to you) The inverse of the inbox: instead of you polling, pingwa POSTs every inbound WhatsApp message to HTTPS endpoints you register. Use this when you want an agent/automation to react to replies without a long-poll loop. Register: ``` curl -X POST https://pingwa.dev/v1/webhooks \ -H "Authorization: Bearer pw_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://your-host.example/pingwa-hook"}' ``` → 201 {"id","url","secret":"whsec_...","active":true,"created_at"}. The `secret` is shown ONCE here and never again — store it, it signs every delivery. - `url` must be public HTTPS (no localhost/private/loopback hosts) → else 422 invalid_webhook_url. Max 5 active webhooks per account → else 409 webhook_limit_reached. - GET https://pingwa.dev/v1/webhooks → {"webhooks":[{id,url,active,created_at, last_delivery_at,failure_count}]}. The secret is NEVER returned here. - DELETE https://pingwa.dev/v1/webhooks/ → {"deleted":true}; 404 webhook_not_found. CLI equivalents (uvx pingwa): `pingwa webhooks` lists, `pingwa webhooks add https://your-host/hook` creates (prints the whsec_... once), `pingwa webhooks rm ` deletes. Delivery: on every inbound message pingwa POSTs to each active webhook: ``` {"event":"inbound_message","message_id","body","button_id", "reply_to_message_id","wa_message_id","window_open","created_at"} ``` `button_id` is "b0","b1",... for a tapped button (null for free text), `reply_to_message_id` links back to the outbound you sent (null if unsolicited), `window_open` is whether the sender's 24h reply window is open at delivery time. A voice message adds a `media` object: ``` {..., "media":{"kind":"audio","voice":true,"mime_type":"audio/ogg; codecs=opus", "url":"https://.../v1/media/?exp=&sig="}} ``` `body` is empty for a pure voice note; GET `media.url` to fetch the audio bytes (no api key needed — the signature authorizes it; the link is short-lived (~1h), so fetch it promptly). The payload NEVER contains your api_key, the secret, or the phone number. Support may send a connectivity probe, signed the same way: `{"event":"test","sent_at":""}`. Answer it with any 2xx and otherwise ignore it: switch on `event` and handle only "inbound_message". Verify the signature (reject anything that fails): ```python import hmac, hashlib sig = "sha256=" + hmac.new(secret.encode(), raw_body_bytes, hashlib.sha256).hexdigest() assert hmac.compare_digest(sig, request.headers["X-Pingwa-Signature"]) ``` Compute the HMAC-SHA256 over the EXACT raw request body bytes (do not re-parse and re-serialize) and compare to the `X-Pingwa-Signature` header — its value is `sha256=`. Respond 2xx to acknowledge. Retries: a non-2xx/timeout/blocked delivery is retried with backoff (up to 5 tries). After 3 recent exhausted deliveries the webhook is auto-deactivated (GET shows active:false, failure_count) — re-create it once your endpoint is healthy. A 2xx resets failure_count. ## Hook URLs (any tool that can "send a webhook to a URL") Shopify, Stripe, TradingView, form builders and uptime monitors can't add an Authorization header or send `{"text": ...}`. Give them a hook URL instead: every request to it becomes a WhatsApp message to this number. The URL itself is the credential (no header needed), so treat it like an API key. Endpoints (Bearer key with the `manage` scope): POST /v1/hooks creates, GET /v1/hooks lists, DELETE /v1/hooks/ revokes, PATCH /v1/hooks/ edits, GET /v1/hooks/presets lists the presets, POST /v1/hooks//test sends a test message. Create: ``` curl -X POST https://pingwa.dev/v1/hooks \ -H "Authorization: Bearer pw_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "shopify"}' ``` → 201 {"url":"https://pingwa.dev/h/hk_<32 chars>","id","name","active":true,"allow_get":false, "preset":null,"template":null,"has_signing_secret":false,"created_at"}. Optional create fields: `preset`, `template`, `signing_secret`, `send_to` (see "Templates, presets and signatures" below). With a preset, the hook turns that tool's payload into a readable message; paste the returned URL into the tool: ``` curl -X POST https://pingwa.dev/v1/hooks -H "Authorization: Bearer pw_YOUR_KEY" \ -H "Content-Type: application/json" -d '{"name": "shop", "preset": "shopify_order"}' # → 201 {"url": "https://pingwa.dev/h/hk_...", "preset": "shopify_order", ...} curl -X POST https://pingwa.dev/h/hk_... -d 'Order #1001 paid: 49 EUR' # a send needs no header ``` The `url` is shown ONCE here and never again (only a hash of it is stored). `name` (default "hook") follows the key-name rule: 1-48 letters, digits, `.` `_` `-`, starting with a letter or digit; anything else → 422. - How many active hooks a number may have is the `hooks` entitlement of that number's own plan (GET /v1/me with its key); past it → 402 `plan_limit` with `"limit": "hooks"`. After a downgrade nothing is deleted: the number's oldest hooks up to the limit keep sending, its newer ones answer {"accepted": false, "error": "plan_limit"} and GET /v1/hooks marks them `"over_plan_limit": true` until older ones are deleted or the plan goes up. - GET https://pingwa.dev/v1/hooks → {"hooks":[{id,name,active,allow_get,preset,template, has_signing_secret,created_at,last_used_at,use_count,over_plan_limit}],"limit":N}. Never the URL, never the signing secret. - GET sends are OFF unless the hook is created with `"allow_get": true`. Enable it only for a tool that can do nothing but fetch a URL (some cron jobs, uptime checkers, smart-home buttons): a full `?text=` URL pasted into Slack, Teams or an email is fetched by link unfurlers and scanners, and every fetch would send a message. Without it a GET answers 405 (`Allow: POST`), sends nothing and counts nowhere. - DELETE https://pingwa.dev/v1/hooks/ → {"deleted":true}: the URL stops working (404) at once; 404 hook_not_found for an unknown id. Send (no header): ``` curl -X POST https://pingwa.dev/h/hk_... -d 'Order #1001 paid: 49 EUR' curl "https://pingwa.dev/h/hk_...?text=backup%20done" # only with "allow_get": true ``` Payload rules (the message is cut to 1,024 characters, control characters removed): - text/plain (or anything else): the body is the message. - JSON: a string is the message; an object's `text` or `message` string field is the message, else its first 10 top-level scalar fields as `key: value` lines (arrays, nested objects and null are skipped). Invalid JSON is sent as plain text. - Form (urlencoded or multipart): the `text`, `message` or `body` field, else every field as `key: value` lines (files are ignored). - GET (allow_get hooks only): the `text` query parameter. A GET without `text`, a HEAD or an OPTIONS sends nothing. Answers — always 200 with a tiny JSON body, so the sending tool never disables the hook: - {"accepted": true, "id": ""}: queued, like POST /v1/notify. - {"accepted": false, "error": ""}: not sent. `error` is the code /v1/notify would give: quota_exceeded, daily_cap_reached, duplicate_message, rate_limited, account_paused, notifications_stopped, no_sender_number, ... plus "empty" (nothing to send) and "plan_limit" (the hook is past the plan's hook limit, see above). Check GET /v1/me for the quota and caps. The non-200 answers: 404 for an unknown or deleted hook URL, 405 for a GET on a hook without allow_get, 413 for a body over 64 KB, 408 for a body that does not arrive within 10 seconds. Limits: hook sends go through every limit of /v1/notify (quota, daily cap, duplicate guard, account send rate, pause), and each hook URL also accepts at most 30 requests a minute, whatever the method (`rate_limited` past it; a GET on a hook without allow_get answers 429 with Retry-After instead of 405). There is no Idempotency-Key on hooks: a sender's retry of the same text is caught by the duplicate guard. ### Templates, presets and signatures A hook with a `template` turns the sender's payload into your own message instead of the default `key: value` lines. Grammar (nothing else: no logic, no loops): - `{{ path }}` — a value from the payload; `{{ path | default text }}` — with a fallback. - path = keys joined by `.` and `[n]` indexes: `{{ order.customer.name }}`, `{{ line_items[0].title }}`. A key is any text without `.` `[` `]` `|` `}`. - What a path reads: the JSON body (object or array); a form's fields (urlencoded or multipart); the query parameters of a GET (allow_get hooks); for a plain-text or invalid-JSON body, the whole body as `{{ body }}`. - A missing field, a null, an object or an array renders the default (else nothing); true/false and numbers render like JSON. A template never fails on any payload. - Limits: 2,000 characters, 50 placeholders, paths 10 keys/indexes deep (→ 422 at create/update). The rendered text is cleaned like any hook text and cut to 1,024 characters at a word boundary. A template that renders empty answers {"accepted": false, "error": "empty"}. Presets: GET https://pingwa.dev/v1/hooks/presets (manage scope) → {"presets":[{id,title,setup,template,signing_secret,signature_header}]}. Create with `{"preset": ""}` and the preset's template is copied into the hook (send your own `template` too, or PATCH it later, to change it). Unknown preset → 422. Presets: - shopify_order — Shopify "Order creation" (signed: X-Shopify-Hmac-Sha256) - woocommerce_order — WooCommerce "Order created" (unsigned here) - stripe_payment — Stripe payment_intent.succeeded, Snapshot payload (signed: Stripe-Signature) - form_generic — Tally form responses; edit the template for Typeform, Google Forms, WordPress - uptime_generic — Uptime Kuma; UptimeRobot / Better Stack sending {"msg","url"} - tradingview — TradingView alert message (plain text or JSON with "text") - github — workflow runs and releases (signed: X-Hub-Signature-256) Each preset's `setup` text says where to paste the URL in that tool. Alert buttons on a hook's sends: `actions` (as on /v1/notify, checked at create and PATCH with the same 422s), `topic_template` and `ref_template` (up to 256 / 512 characters, templates like `template`, rendered over each request). The rendered topic keeps letters, digits and . _ : / - (any other run of characters becomes "-": "My Web Server" → "My-Web-Server"), cut to 64, so names that differ only there are one topic ("web prod" and "web-prod" are both "web-prod": one snooze mutes both); the ref is cut to 256; an empty render is none. A snooze needs topic_template; at send time an entry that no longer works (an action deleted, a topic that rendered empty for a snooze) is left out, never the alert. A snoozed topic answers {"accepted": true, "suppressed": true, "topic", "until"}. Recipe: "Alert buttons". Edit: PATCH https://pingwa.dev/v1/hooks/ with any of {"name","template","allow_get", "signing_secret","send_to","actions","topic_template","ref_template"}; only the fields sent change, `"template": null` goes back to the default rendering, `"signing_secret": null` turns the check off, `"send_to"` takes the values of `to` (422 unknown_recipient as at create; null = "me"). → 200 the hook (as in the list); 404 hook_not_found for an unknown id or another number's hook. Signatures: set `signing_secret` (8-256 characters, at create or with PATCH) to the secret the sender signs with, and every request must carry a valid signature of its raw body, else 401 {"error": "bad_signature"} — nothing sent, nothing counted (only the per-URL limit counts it). The scheme comes from the preset: - Shopify: X-Shopify-Hmac-Sha256 = base64 HMAC-SHA256 of the body. - Stripe: Stripe-Signature `t=,v1=`, HMAC-SHA256 of "."; any v1 may match; a `t` more than 300 seconds from now is refused (replay window). - GitHub, and any hook without a preset: X-Hub-Signature-256 = "sha256=" + hex HMAC-SHA256 of the body. A preset whose sender does not sign refuses a signing_secret (422 signing_not_supported). A GET to a signed hook answers 405 (even with allow_get). The secret is write-only: the API never returns it (`has_signing_secret` says whether one is set). Test: POST https://pingwa.dev/v1/hooks//test (manage scope) sends the preset's sample payload (without a preset: {"text": "pingwa hook test"}) through the hook's template, as a real message: it counts toward the quota, the daily cap and every guard like any send, and answers like the hook URL: {"accepted": true, "id"} or {"accepted": false, "error"}. Recent deliveries: GET https://pingwa.dev/v1/hooks//deliveries (manage scope) lists the hook's last 20 answered requests and tests, newest first; the list is dropped after 7 days without a request: {"deliveries": [{"at", "accepted", "error", "id"}]} (error: the code the URL answered with, e.g. bad_signature, rate_limited, plan_limit). The payload is never stored. After create, GET /v1/hooks shows only `url_hint` ("…/h/hk_…" + the URL's last 4 characters); GET /v1/hooks/presets gives each preset's setup as three `steps`. ## No-code hooks A hook URL (`https://pingwa.dev/h/hk_...`, see "Hook URLs" above) lets a tool that can only "send a webhook to a URL" reach WhatsApp with no code. One recipe page per preset, each with the rendered message, the sender's own menu steps and the signing-secret step where the sender signs (the steps are the preset's `steps`, GET /v1/hooks/presets): - [Shopify](https://pingwa.dev/shopify): new order (preset shopify_order, signed) - [WooCommerce](https://pingwa.dev/woocommerce): new order (preset woocommerce_order) - [Stripe](https://pingwa.dev/stripe): successful payment (preset stripe_payment, signed) - [Forms](https://pingwa.dev/forms): new form response, Tally; Typeform / Google Forms by editing the template (preset form_generic) - [TradingView](https://pingwa.dev/tradingview): alert message (preset tradingview). Bots and scripts that trade: https://pingwa.dev/trading pingwa messages only people who joined, never a shop's customers or a form's respondents. ## Integrations (WordPress, Zapier, Make) Apps for the tools' own directories. Each page says whether its app is listed yet; while it is "coming soon" the page leads with the hook URL / API route that works today, no app needed: - [WordPress](https://pingwa.dev/wordpress): WooCommerce new orders and Contact Form 7 / WPForms / Elementor Pro / Gravity Forms submissions to WhatsApp. The message carries no customer e-mail, phone or address; payment, card and upload fields are skipped. WordPress plugin coming soon (not listed yet). Today: WooCommerce's own webhook to a hook URL (preset woocommerce_order, https://pingwa.dev/woocommerce) - [Zapier](https://pingwa.dev/zapier): Send Notification, Ask and Wait, Reply Received trigger; sign-in connection, no key copy. Zapier app coming soon (not listed yet). Today: Webhooks by Zapier POST to a hook URL, or Custom Request to /v1/ask with `timeout` <= 25 and `timeout_ok: true` - [Make](https://pingwa.dev/make): Send a Notification, Ask and Wait, Watch Replies; sign-in connection, no key copy. Make app coming soon (not listed yet). Today: HTTP "Make a request" to a hook URL, or to /v1/ask with `timeout` <= 30 and `timeout_ok: true` ## Scheduled messages (send later: once, every N seconds, or cron) You cannot deliver a message later yourself: your session ends, nothing of yours keeps running. When the human wants something later or repeatedly ("remind me tomorrow at 9", "every weekday at 8:30"), REGISTER A SCHEDULE and then tell the human the registered local time from the response (`next_run_local`, `registered`). pingwa's server sends it. POST https://pingwa.dev/v1/schedules (Bearer key, scope `send`) with `text` (1-1024), optional `name` (letters, digits, . _ -; up to 40; unique per number among its schedules that may still run, so a finished one-time schedule's name may be reused; default schedule-N), optional `buttons` (up to 3 options; the answer arrives in the inbox, nobody waits for it), `timezone` (IANA, e.g. "Europe/Warsaw"; default: the zone of the phone's country, UTC when the country has several zones: pass it when you know the human's zone) and EXACTLY ONE of: - `at`: one time, ISO 8601 in the future ("2026-12-24T18:00:00+01:00"; without an offset it is read in `timezone`) - `every_s`: every N seconds, at least 900 (15 minutes) - `cron`: 5 fields (minute hour day-of-month month day-of-week) read in `timezone`, e.g. "0 9 * * 1-5" = 09:00 local on weekdays, daylight saving included; its runs must be at least 15 minutes apart → 201 {"id","name","text","buttons","kind": "at|every|cron","at","every_s","cron", "timezone","status": "active","paused_reason": null,"next_run_at" (UTC), "next_run_local" (in `timezone`),"last_run_at","last_message_id","last_error", "refused_streak","run_count","created_at","registered","note"} 422: `at_in_past`, `interval_too_short`, `invalid_cron`, `invalid_schedule` (not exactly one of at/every_s/cron), `invalid_timezone`, `name_taken`; an unknown field (e.g. `to`) is refused too: v1 sends to the number itself only, never to team members. 402 plan_limit (limit `schedules`) past the plan's `entitlements.schedules` (active and paused schedules count; a one-time schedule that ran does not). GET https://pingwa.dev/v1/schedules → {"schedules": [...], "limit"}: active, paused and done ones (a one-time schedule that ran is kept 30 days). Each also has `over_plan_limit`: after a downgrade only the number's oldest `limit` active schedules run; the others stay (true here), their runs are skipped with `last_error` "plan_limit" (not a refusal: no streak, no pause) and they run again by themselves when the plan goes back up. PATCH https://pingwa.dev/v1/schedules/ {"paused": true|false}: pause; resume (the next run is the first one after now, the refused streak restarts at 0). DELETE https://pingwa.dev/v1/schedules/ → {"deleted": true}. 404 schedule_not_found. Each run is a normal send through the same path as /v1/notify. A scheduled message usually arrives OUTSIDE the 24 hour window, so it is sent as a template and counts toward the monthly quota and the daily cap like any send; every guard applies (the duplicate-message guard included: a run at least 15 minutes after the last one is never refused for repeating itself, but the same text sent 3 times by you in the 10 minutes before a run refuses that run). A run refused by a limit sends nothing, is recorded (`last_error` = the error code, `refused_streak`) and is not retried: the schedule waits for its next run; 3 refusals in a row pause it (`status` "paused", `paused_reason` "refused"). One message per run, also when the worker restarts; a run missed while the service was down is sent once, late, not as a burst, and a late run is not followed at once: the next run is the first one at least about 15 minutes after it (runs in between are skipped). Runs are counted by the scheduler's own per-minute send-rate counter, separate from your API calls' counter. A schedule belongs to the NUMBER, not to the key that created it: revoking that key does not stop it (list it with GET /v1/schedules and delete it). From the phone: `schedules` lists them, `cancel ` deletes one (unless it answers a pending ask: typed as one of that ask's options, or quoting an ask). ## Missed check-ins (alert when a job did NOT report) The worst failure of a backup or a cron job is silence: it does not run, so it sends no alert. A check is a dead man's switch: the job pings a URL each time it ran; when a ping is later than expected plus a grace time, pingwa sends ONE alert ("Check backup-nas did not report. Expected at 2026-03-28 03:00 (Europe/Warsaw).") and, when the job reports again, ONE "is back" message. Not one alert per minute: one per outage. POST https://pingwa.dev/v1/checks (Bearer key, scope `manage`: the URL is a credential) with `name` (letters, digits, . _ -; up to 40; unique per number, case-insensitive), EXACTLY ONE of `every_s` (the job runs at least every N seconds, at least 300) or `cron` (5 fields read in `timezone`, runs at least 5 minutes apart), optional `timezone` (IANA; default: the zone of the phone's country, else UTC; the alert shows the expected time in it), optional `grace_s` (60 to 604800, default 3600: how late a ping may be before the alert), optional `to` ("me" default, "team", or member ids/names: as `to` on /v1/notify) → 201 {"url": "https://pingwa.dev/c/ck_<32 chars>", "fail_url": "/fail", "id", "name", "url_hint", "kind": "every|cron", "every_s", "cron", "timezone", "grace_s", "paused": false, "state": "new", "last_ping_at", "next_due_at" (UTC), "next_due_local", "alert_after", "alerted_at", "last_error", "to", "created_at", "note"}. The URL is shown ONCE (only its hash is stored); store it where the job runs. 422: `interval_too_short`, `invalid_cron`, `invalid_check` (not exactly one of every_s/cron), `invalid_timezone`, `invalid_grace`, `name_taken`, `unknown_recipient`. 402 plan_limit (limit `checks`) past the plan's `entitlements.checks` (paused ones count). GET https://pingwa.dev/v1/checks → {"checks": [...], "limit"}: `url_hint` ("…/c/ck_…") instead of the URL; `state`: "new" (no ping yet), "up", "late", "failed"; `over_plan_limit`: after a downgrade only the oldest `limit` unpaused checks alert, the others record pings and their alerts are dropped (`last_error` "plan_limit"). PATCH https://pingwa.dev/v1/checks/ {"paused": true|false}: a paused check records pings and sends nothing; resume expects the next ping one period after now. DELETE https://pingwa.dev/v1/checks/ → {"deleted": true}. 404 check_not_found. The ping URL needs no header and ignores the body: GET, POST or HEAD `` = the job ran; `/fail` = the job failed (one alert at once, none more while it stays failed). → 200 text/plain "ok". 404 (one body for an unknown, deleted or malformed key) and 429 past 10 pings a minute per URL (Retry-After; nothing changes). A ping sends nothing and costs nothing. The recipe reports the job's own exit status: if ; then curl -fsS -m 10 ; else curl -fsS -m 10 /fail; fi and the same as one crontab line: 0 3 * * * if /opt/backup.sh; then curl -fsS -m 10 ; else curl -fsS -m 10 /fail; fi NO alert before the first ping: a new check waits for its job to report once, then watches it. Expected time: `every_s` after the last ping, or the cron expression's next time after the last ping (in `timezone`, daylight saving included); the alert goes out within about a minute after expected time + `grace_s`. An alert and the "back" message are normal sends through the same path as /v1/notify (source "check"): usually outside the 24 hour window, so a template, counting toward the quota and the daily cap; every guard applies. One refused (quota, daily cap...) sends nothing, is recorded in `last_error` and is not retried; the check still moves on. A refused alert never counts toward the account's runaway pause. One check sends at most 6 messages (alerts and "back") per UTC day; past that nothing more is sent until midnight UTC (`last_error` "check_messages_per_day"), so a leaked URL flapping between `/fail` and ping cannot drain the quota. `alerted_at` is set only when an alert was accepted: no "back" follows a refused alert, and a `/fail` after a refused late alert is reported. A late check that reports before its alert went out sends nothing at all. A check belongs to the NUMBER, not to the key that created it. No MCP tool or CLI command yet: use the REST API. ## Actions (buttons in WhatsApp that call your URL) An action is a named button the human taps in WhatsApp to trigger something of theirs (open the garage, restart a service, start a backup). The human writes `menu` (reserved, like `keys`) and gets this number's actions as buttons: up to 3 as reply buttons, 4 to 10 as a list, more than 10 as 9 rows and a "More" row. A tap sends ONE signed POST to the action's `target_url`; the human gets the result back in the chat. No public address? Leave `target_url` out and run `pingwa listen` (below: "Actions without a public address"). Only the number's own owner sees and runs them. Endpoints (Bearer key with the `manage` scope; another number's id is a 404): ``` curl -X POST https://pingwa.dev/v1/actions \ -H "Authorization: Bearer pw_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"label": "Open garage", "target_url": "https://your-host.example/garage", "confirm": true}' ``` → 201 {"id","label","target_url","confirm","reply_ok","active":true,"created_at", "secret":"whsec_..."}. The `secret` is shown ONCE here and never again: store it, it signs every POST of this action. - `label`: 1-20 characters (the button's text, WhatsApp's limit), one line, unique among the number's actions ignoring case → else 409 label_taken. - `target_url`: public HTTPS, as for webhooks → else 422 invalid_target_url. Optional: without it the action is delivered to a listener (pull, see below). - `confirm` (default false): ask "Run