ZapHook API
Base URL: https://api.zaphook.cloud
Auth: Authorization: Bearer zph_...
Setup
node scripts/configure.mjs --api-key "zph_..." --base-url "https://api.zaphook.cloud"
Non-interactive. Config saved to ~/.zaphook/config.json.
If flags are omitted, falls back to interactive prompts (human use only).
Channels
Create Channel
RULE: Before collecting ANY data, first ask the user: manual or coexistence? If the user doesn't understand a term, read references/glossary.md. For channel type comparison and required fields, read references/channel-types.md. If the user needs help finding credentials, read references/how-to-get-credentials.md.
Manual: --name, --waba-id, --phone-number-id, --whatsapp-access-token [--webhook-secret] Coexistence: all above + --verify-token (required)
# Canal Manual (ZapHook como único BSP)
node scripts/create-channel.mjs --type manual --name "Meu Canal" --waba-id "WABAid" --phone-number-id "PhoneID" --whatsapp-access-token "token"
# Canal Coexistência (manter BSP atual + ZapHook)
node scripts/create-channel.mjs --type coexistence --name "Meu Canal" --waba-id "WABAid" --phone-number-id "PhoneID" --whatsapp-access-token "token" --verify-token "vt_xxx"
POST /api/public/v1/channels
List Channels
node scripts/list-channels.mjs [--type standard|coexistence|all] [--active true|false] [--name "search"]
GET /api/public/v1/channels
Get Channel
node scripts/get-channel.mjs --channel-id <uuid>
GET /api/public/v1/channels/{channel_id}
Update Channel
node scripts/update-channel.mjs --channel-id <uuid> [--name "New Name"] [--active true|false] [--webhook-secret "secret"]
PUT /api/public/v1/channels/{channel_id}
Delete Channel
node scripts/delete-channel.mjs --channel-id <uuid>
DELETE /api/public/v1/channels/{channel_id}
Channel Health (WABA Status)
node scripts/channel-status.mjs --channel-id <uuid>
GET /api/public/v1/channels/{channel_id}/status Returns: quality_rating, messaging_limit_tier, status, verified_name, platform_type
Destinations
List Destinations
node scripts/list-destinations.mjs --channel-id <uuid>
GET /api/public/v1/channels/{channel_id}/destinations
Create Destination
node scripts/create-destination.mjs --channel-id <uuid> --name "CRM" --url "https://..." [--method POST] [--timeout 30]
POST /api/public/v1/channels/{channel_id}/destinations
Update Destination
node scripts/update-destination.mjs --channel-id <uuid> --dest-id <uuid> [--name "New"] [--active true|false]
PUT /api/public/v1/channels/{channel_id}/destinations/{dest_id}
Delete Destination
node scripts/delete-destination.mjs --channel-id <uuid> --dest-id <uuid>
DELETE /api/public/v1/channels/{channel_id}/destinations/{dest_id}
Response Format
Success:
{ "data": { ... }, "meta": { "request_id": "uuid", "timestamp": "ISO8601" } }
Error:
{ "error": { "code": "INVALID_API_KEY", "message": "...", "details": null } }
Errors
Common: 401 (invalid key), 404 (not found), 422 (validation), 429 (rate limit). For details and suggestions, read references/error-codes.md.
Related skills
whatsapp-messaging— Send messages, templates, mediaobserve-whatsapp— Monitor events, logs, health checks