Commands
Every API operation has a command, and a guard fails CI when one does not.
All 57 operations have a command. The table below is generated from the CLI's coverage table joined against the route contract, so it cannot describe a command that does not exist, and a new endpoint appears here as soon as it is covered.
Two guards keep that true: ops/check-cli-in-sync.mjs checks both directions — every operation is
claimed, and every claimed command resolves in the real command tree — and compat/cli.test.ts
runs the compiled binary against a live stack, because a coverage table can say groups leave
without that command going anywhere near the leave endpoint.
Selecting a session
Session-scoped commands act on the session you pinned:
wapi use 3 # pin it
wapi send --to +51... --text "hi"
wapi groups list --session 5 # or override per callAccount-scoped commands take a session id as a positional argument instead
(wapi sessions connect 3), because they act on a session rather than through it.
The escape hatch
wapi api GET /api/status
wapi api POST /api/send-message --data '{"to":"+51...","text":"hi"}'Reaches anything without a command yet, attaching the right credential by reading the route's declared scope. It deliberately counts for nothing in the coverage table — if the escape hatch counted, the guard would pass on day one and forever, and there would be no pressure to build the surface beside it.
Every command
| Command | Method | Path | Credential |
|---|---|---|---|
| wapi audit get | GET | /api/audit-logs/{auditLog} | PAT |
| wapi audit list | GET | /api/audit-logs | PAT |
| wapi contacts block | POST | /api/contacts/{contactPhoneNumber}/block | session key |
| wapi contacts get | GET | /api/contacts/{contactPhoneNumber} | session key |
| wapi contacts list | GET | /api/contacts | session key |
| wapi contacts picture | GET | /api/contacts/{contactPhoneNumber}/picture | session key |
| wapi contacts save | PUT | /api/contacts | session key |
| wapi contacts unblock | POST | /api/contacts/{contactPhoneNumber}/unblock | session key |
| wapi dispatches | GET | /api/dispatches | session key |
| wapi groups by-invite | GET | /api/groups/invite/{inviteCode} | session key |
| wapi groups create | POST | /api/groups | session key |
| wapi groups invite-link | GET | /api/groups/{groupJid}/invite-link | session key |
| wapi groups join | POST | /api/groups/invite/accept | session key |
| wapi groups leave | POST | /api/groups/{groupId}/leave | session key |
| wapi groups list | GET | /api/groups | session key |
| wapi groups metadata | GET | /api/groups/{groupJid}/metadata | session key |
| wapi groups participants add | POST | /api/groups/{groupJid}/participants/add | session key |
| wapi groups participants list | GET | /api/groups/{groupJid}/participants | session key |
| wapi groups participants remove | POST | /api/groups/{groupJid}/participants/remove | session key |
| wapi groups participants update | PUT | /api/groups/{groupId}/participants/update | session key |
| wapi groups picture | GET | /api/groups/{groupJid}/picture | session key |
| wapi groups settings | PUT | /api/groups/{groupJid}/settings | session key |
| wapi lid from-phone | GET | /api/lid-from-pn/{pn} | session key |
| wapi lid to-phone | GET | /api/pn-from-lid/{lid} | session key |
| wapi media decrypt | POST | /api/decrypt-media | session key |
| wapi media upload | POST | /api/upload | session key |
| wapi messages delete | DELETE | /api/messages/{msgId} | session key |
| wapi messages edit | PUT | /api/messages/{msgId} | session key |
| wapi messages info | GET | /api/messages/{msgId}/info | session key |
| wapi messages resend | POST | /api/messages/{message}/resend | session key |
| wapi messages send | POST | /api/send-message | session key |
| wapi on-whatsapp | GET | /api/on-whatsapp/{contact_identifier} | session key |
| wapi presence | POST | /api/send-presence-update | session key |
| wapi react | POST | /api/messages/react | session key |
| wapi read | POST | /api/messages/read | session key |
| wapi sandbox create | POST | /api/sandbox/sessions | PAT |
| wapi sandbox inbound | POST | /api/sandbox/inbound | session key |
| wapi sandbox scan | POST | /api/sandbox/scan | session key |
| wapi sandbox thread | GET | /api/sandbox/thread | session key |
| wapi sessions connect | POST | /api/whatsapp-sessions/{whatsappSession}/connect | PAT |
| wapi sessions create | POST | /api/whatsapp-sessions | PAT |
| wapi sessions delete | DELETE | /api/whatsapp-sessions/{whatsappSession} | PAT |
| wapi sessions disconnect | POST | /api/whatsapp-sessions/{whatsappSession}/disconnect | PAT |
| wapi sessions get | GET | /api/whatsapp-sessions/{whatsappSession} | PAT |
| wapi sessions list | GET | /api/whatsapp-sessions | PAT |
| wapi sessions logs activity | GET | /api/whatsapp-sessions/{whatsappSession}/session-logs | PAT |
| wapi sessions logs messages | GET | /api/whatsapp-sessions/{whatsappSession}/message-logs | PAT |
| wapi sessions qr | GET | /api/whatsapp-sessions/{whatsappSession}/qrcode | PAT |
| wapi sessions regenerate-key | POST | /api/whatsapp-sessions/{whatsappSession}/regenerate-key | PAT |
| wapi sessions restart | POST | /api/whatsapp-sessions/{whatsappSession}/restart | PAT |
| wapi sessions update | PUT | /api/whatsapp-sessions/{whatsappSession} | PAT |
| wapi status | GET | /api/status | session key |
| wapi tokens create | POST | /api/tokens | PAT |
| wapi tokens list | GET | /api/tokens | PAT |
| wapi tokens revoke | DELETE | /api/tokens/{token} | PAT |
| wapi user | GET | /api/user | session key |
| wapi username | GET | /api/fetch-username/{contact_identifier} | session key |
57 commands, generated from the CLI’s coverage table.