Files
optimclaw/channels/whatsapp/whatsapp.capabilities.json
Illia PolosukhinandClaude Opus 4.5 e6946172f7 Apply Telegram channel learnings to WhatsApp implementation
- Fix metadata flow: store sender_phone for response routing
- Add credential injection in headers (Bearer {WHATSAPP_ACCESS_TOKEN})
- Add secret_validated check for webhook defense in depth
- Add status message filtering to prevent loops
- Add proper WhatsApp API error response parsing
- Create whatsapp.capabilities.json with setup/secrets/rate limits
- Add docs/BUILDING_CHANNELS.md with patterns and examples

Also fix UTF-8 truncation bugs across codebase:
- wrapper.rs: content preview, response body, webhook body logging
- agent_loop.rs: params truncation for approval display
- shell.rs: truncate_for_error() helper

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-02-04 22:32:23 -08:00

54 lines
1.5 KiB
JSON

{
"type": "channel",
"name": "whatsapp",
"description": "WhatsApp Cloud API channel for receiving and responding to WhatsApp messages",
"setup": {
"required_secrets": [
{
"name": "whatsapp_access_token",
"prompt": "Enter your WhatsApp Cloud API access token (from Meta Developer Portal)",
"validation": "^[A-Za-z0-9_-]+$"
},
{
"name": "whatsapp_verify_token",
"prompt": "Webhook verify token (leave empty to auto-generate)",
"optional": true,
"auto_generate": { "length": 32 }
}
],
"validation_endpoint": "https://graph.facebook.com/v18.0/me?access_token={whatsapp_access_token}"
},
"capabilities": {
"http": {
"allowlist": [
{ "host": "graph.facebook.com", "path_prefix": "/" }
],
"rate_limit": {
"requests_per_minute": 80,
"requests_per_hour": 1000
}
},
"secrets": {
"allowed_names": ["whatsapp_*"]
},
"channel": {
"allowed_paths": ["/webhook/whatsapp"],
"allow_polling": false,
"workspace_prefix": "channels/whatsapp/",
"emit_rate_limit": {
"messages_per_minute": 100,
"messages_per_hour": 5000
},
"webhook": {
"secret_header": "X-Hub-Signature-256",
"secret_name": "whatsapp_verify_token",
"verify_token_param": "hub.verify_token"
}
}
},
"config": {
"api_version": "v18.0",
"reply_to_message": true
}
}