Webhooks
Set them up in Settings → Integrations → Webhooks: choose the URL (public https) and the events. Each event arrives as a POST like this:
POST https://tu-servidor.com/whasalia
Content-Type: application/json
User-Agent: Whasalia-Webhooks/1.0
X-Whasalia-Event: message.received
X-Whasalia-Delivery: 6f1c… (id de la entrega / delivery id)
X-Whasalia-Signature: t=1792512000,v1=5d2a…
{
"id": "evt_8b0f…", (mismo en reintentos / same on retries)
"type": "message.received",
"created_at": "2026-10-26T15:00:00.000Z",
"workspace_id": "…",
"data": {
"message": { "id": "…", "conversation_id": "…", "direction": "inbound", "type": "text", "text": "Hola", … },
"contact": { "id": "…", "name": "Ana Torres", "phone": "+51987654321", … }
}
}Verify the signature
Each endpoint has a secret (whsec_…) shown when you create or rotate it. The X-Whasalia-Signature header carries t (Unix seconds) and v1 = HMAC-SHA256 of the text <t>.<body> with that secret. Compute it over the body exactly as received and reject signatures older than 5 minutes. Node.js example:
import crypto from 'node:crypto'
// rawBody: the request body exactly as received (string), before JSON.parse
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')))
const t = Number(parts.t)
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false // older than 5 min
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
const given = Buffer.from(parts.v1 ?? '', 'hex')
return given.length === 32 && crypto.timingSafeEqual(given, Buffer.from(expected, 'hex'))
}
// verify(rawBody, req.headers['x-whasalia-signature'], process.env.WHASALIA_WEBHOOK_SECRET)Responses and retries
Answer with a 2xx status within 10 seconds (redirects count as failures). On failure we retry after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h, with the same event id: use it to avoid processing twice. After 20 failures in a row the endpoint is disabled and admins are notified. The screen shows every delivery with its response and lets you resend it.
Events
data carries the resources with the same fields as the API (message, contact, order…).
| Event | data | Description |
|---|
message.received | message, contact | A customer wrote. |
message.sent | message, contact | A message went out (team, AI, flow or API). |
conversation.created | conversation, contact | New conversation. |
conversation.assigned | conversation, assigned_user, previous_assigned_user_id | Assigned to someone else. |
conversation.resolved | conversation, resolved_by_user_id | It was closed. |
contact.created | contact | New contact. |
contact.updated | contact, changed | A contact changed (changed lists the fields). |
order.created | order | New order. |
order.status_changed | order, previous_status | The order’s status changed. |
order.paid | order, previous_payment_status | The order was marked as paid. |
booking.created | booking, contact | New booking. |
booking.status_changed | booking, previous_status | The booking’s status changed. |
lead.qualified | lead, contact | The AI qualified a lead (real estate). |
deal.stage_changed | deal, from_stage, to_stage, pipeline | A deal changed stage. |
ping | message, endpoint_id | The “Send test” button. |
MCP connector
The MCP connector lets an AI assistant (Claude, ChatGPT, Cursor, Claude Code…) work in your business: it reads the inbox, replies to your customers and builds rules, automations and flows. It connects to this address:
https://whasalia.com/api/mcp
How to connect it
- Claude (web or desktop): Settings → Connectors → Add custom connector. Paste the address and press Connect; “Connect to Whasalia” opens to sign in, pick the business and allow access.
- ChatGPT: Settings → Apps & connectors → Create (with developer mode on). Paste the address and pick OAuth.
- Claude Code: run this command, then
/mcp to sign in.
claude mcp add --transport http whasalia https://whasalia.com/api/mcp
Cursor and other MCP clients: add an HTTP server with the address. Sign-in happens on its own (OAuth with dynamic registration).
{
"mcpServers": {
"whasalia": { "url": "https://whasalia.com/api/mcp" }
}
}Without sign-in (n8n, scripts, servers): create an API key with the mcp scope in Settings → Integrations and send it as Authorization: Bearer. It works as the person who created the key, with their role.
{
"mcpServers": {
"whasalia": {
"url": "https://whasalia.com/api/mcp",
"headers": { "Authorization": "Bearer wsl_live_…" }
}
}
}Permissions: each person's own
Each team member connects their own and signs in with their Whasalia account. The assistant works with their role (owner, admin or agent) and the business's active modules: it only gets the tools that person can use in the panel. If their role changes or they leave the business, access changes or ends at once.
Credits
Reading and configuring are free. Each message sent with reply_to_conversation uses 1 credit; whatever already uses credits in Whasalia (AI replies, follow-ups, reminders, comment replies) keeps using them even if you created it from the connector. Without credits the send is refused with out_of_credits.
Tools
Read
| Tool | Minimum role | Description |
|---|
get_business | Agent | The connected business, your role, the active modules and (admins) the credits. |
list_conversations | Agent | Inbox conversations; filter by status, channel, assignee or contact. |
get_conversation | Agent | One conversation with its channel, contact and status. |
list_messages | Agent | Messages of a conversation (no internal notes). |
list_contacts | Agent | Search contacts by text, phone or email. |
get_contact | Agent | One contact with its tags. |
list_tags | Agent | The business's tags. |
list_members | Agent | Team members (to assign conversations). |
list_agents | Agent | AI agents, their setup and the channels they answer. |
list_faqs | Agent | FAQs the agents use. |
list_automations | Agent | Automations and whether they are on. |
get_automation | Agent | One automation with its steps. |
list_flows | Agent | Conversation flows and their status. |
get_flow | Agent | One flow with all its nodes. |
list_quick_replies | Agent | The team's quick replies. |
list_comment_rules | Agent | Automatic comment replies. |
list_whatsapp_templates | Agent | WhatsApp templates with their status and the AI rule of each button. |
list_bookings | Agent | Appointments and bookings.Needs the Bookings module |
list_orders | Agent | Store orders.Needs the Orders module |
list_products | Agent | Catalog products.Needs the Products module |
list_pipelines | Agent | Sales pipelines and their stages. |
list_deals | Agent | Sales deals. |
list_tasks | Agent | Team tasks. |
get_report | Agent | Metrics for a period (an agent sees their own report, as in the panel). |
how_to_build | Agent | Guide to triggers, steps and nodes so the AI can build automations and flows. |
Inbox and contacts
| Tool | Minimum role | Description |
|---|
reply_to_conversation | Agent | Sends text, a file or a template to the customer. 1 credit per message; free text only within WhatsApp’s 24 h.1 credit per message |
update_conversation | Agent | Status, priority, assignee, team or AI agent; pause or resume the AI. |
create_contact | Agent | Creates a contact. |
update_contact | Agent | Changes name, phone, email or company. |
tag_contact | Agent | Adds a tag (creates it if missing). |
untag_contact | Agent | Removes a tag. |
create_quick_reply | Agent | Creates a quick reply (shared only if you are an admin). |
AI agents and rules
| Tool | Minimum role | Description |
|---|
create_agent | Admin | Creates an AI agent. |
update_agent | Admin | Changes an agent's rules, tone, messages or knowledge (can be undone). |
create_faq | Admin | Creates a FAQ. |
update_faq | Admin | Changes a FAQ. |
set_template_button_rules | Admin | What the AI does when each template button is pressed. |
create_comment_rule | Admin | Automatic reply to Instagram or Facebook comments. |
create_automation | Admin | Creates an automation (trigger + steps), on or off. |
set_automation_active | Admin | Turns an automation on or off. |
create_flow | Admin | Creates a flow with its nodes and, if you want, publishes it. |
set_flow_status | Admin | Publishes, drafts or archives a flow. |
CRM
| Tool | Minimum role | Description |
|---|
create_task | Agent | Creates a task. |
create_deal | Agent | Creates a deal in a pipeline. |
update_deal | Agent | Moves stage, changes value or marks won or lost. |
Safety and log
Customer messages reach the assistant flagged as data, never as instructions. Everything the connector does is listed in Settings → MCP connector: each person sees their own and admins see everything, with Undo for changes to agents, FAQs, rules, automations and flows, and Disconnect to end access. It can't touch billing, members, channels or broadcasts.
OAuth for developers
Whasalia is its own OAuth 2.1 server: /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server documents, dynamic client registration (/api/oauth/register) or client metadata documents, PKCE S256 required, 1-hour access tokens and rotating refresh tokens (60 days). Without a token, /api/mcp answers 401 with WWW-Authenticate pointing to those documents.
Missing something in the API? Write to us