Setup in Kapso
Configure WhatsApp in your Kapso project
Configuring WhatsApp in Kapso
After obtaining the necessary credentials from Meta, you need to configure them in Kapso and set up the webhook connection. This process involves both project-level and agent-level configurations.
Project-Level Configuration
WhatsApp connection details are managed at the Project level within Kapso. This allows a single project to potentially connect to multiple different WhatsApp phone numbers or business accounts if needed.
Go to WhatsApp Configurations
Access the “WhatsApp Configurations” area within your Kapso Project
sidebar
Manage Configurations
Here you can view existing configurations, edit them, or create new ones
Create/Edit Configuration
When adding or editing a configuration, you will need to provide:
- A recognizable Name for this specific configuration within Kapso (e.g., “Support Line”, “Sales Number”)
- The Phone Number ID obtained from Meta
- The WhatsApp Business Account (WABA) ID obtained from Meta
- The Permanent System User Access Token obtained from Meta
- A Custom Verify Token: You will define a unique, secret string here. This token acts like a password that Meta will use when sending messages to your Kapso webhook URL, ensuring the requests are legitimate. Copy this token immediately after creating it, as you will need to enter it into the Meta webhook settings
- Webhook Endpoint (Optional): If you want to receive webhook events from WhatsApp in your own application, you can specify your endpoint URL here. Kapso will act as a proxy, forwarding WhatsApp events to your specified endpoint
Save
Save the configuration details in Kapso
Each saved configuration represents a specific WhatsApp phone number linked to your project.
Setting Up the Webhook in Meta
This step tells Meta where to send incoming WhatsApp messages and events so Kapso can receive them.
Go to Meta Developer Portal
Go to your App settings within the Meta Developer Portal
Find Webhooks
Locate the “Webhook” configuration section for the “WhatsApp Business API” product associated with your App
Configure Webhook
Callback URL: Use Kapso Webhook Callback URL https://meta-webhooks.kapso.ai/whatsapp
Verify Token: Paste the Webhook Verify Token that you copied from Kapso
Subscribe to Events
You need to subscribe to specific events. Ensure you subscribe at least to the messages
event field. This ensures Kapso receives notifications for incoming user messages
Verify and Save
Click the “Verify and Save” button in Meta. Meta will send a test request to the Callback URL with the Verify Token. If Kapso receives it correctly (which it should if the URL and Token are correct), the webhook will be verified and saved
Kapso acts as a proxy between Meta and your application. When WhatsApp sends events to Kapso, if you’ve configured a webhook endpoint in your WhatsApp configuration, Kapso will forward these events to your specified endpoint while also processing them within the Kapso platform.
Agent-Level Configuration
After setting up a WhatsApp Configuration at the project level, you need to associate specific agents with it:
Go to Agent Settings
Go to the Agent
settings page
Go to WhatsApp Settings
Find the WhatsApp configuration area for the agent (often a dedicated tab or section)
Link Configuration
Select the WhatsApp Configuration you created at the project level
Set as Primary (Optional)
You might designate this configuration as the “primary” one for the agent, meaning this agent will be responsible for handling inbound messages received on the associated phone number. If you want this agent to process all incoming messages, you must set it as the primary agent
Save
Save the agent’s WhatsApp association
Your Kapso agent should now be connected to WhatsApp, ready to process incoming messages according to the Agent Execution Flow and send responses based on your graph logic.
Next Steps
WhatsApp Templates
Learn how to sync and use WhatsApp message templates