Developer API

API documentation

Connect Whasalia with n8n, Make, Zapier, your ERP or your own code: read and create contacts, send messages, manage orders and bookings, and get every event as it happens with webhooks.

Introduction

It's a JSON REST API. Every route hangs from this address and only answers over HTTPS:

https://whasalia.com/api/v1
  • Send Content-Type: application/json on POST and PATCH. Responses carry the resource in data.
  • Ids are UUIDs. Phones use international format (+51987654321).
  • Date-times are ISO 8601 in UTC. Booking dates and times use the business's time zone.
  • Each key belongs to one business and only sees and changes that business's data.

Authentication

Create a key in Settings → Integrations → API keys (admins only) and send it in the Authorization header of every request. GET /me tests the connection:

curl https://whasalia.com/api/v1/me \
  -H "Authorization: Bearer $WHASALIA_API_KEY"

The key is shown only once. Keep it as a secret on your server (never in a public web page or app). If it leaks, revoke it on the same screen and create another: it stops working instantly.

Scopes

When you create the key you choose what it can do. read reads everything, write reads and writes everything; the others grant read and write on a single resource. Use only the ones the integration needs.

ScopeAccess
readRead everything (every GET).
writeRead and write everything.
contactsContacts and tags.
conversationsRead conversations and messages.
messages:sendSend messages.
catalogProduct catalog.
ordersOrders.
bookingsBookings.
crmDeals, tasks, pipelines and team.
mcpUse the MCP connector (/api/mcp) as the person who created the key, with the permissions of their role. Not included in `write`.

Errors

Errors answer with the HTTP status and always the same shape. details (when present) points to the field or carries useful data, like alternative times.

{ "error": { "code": "insufficient_scope", "message": "This API key lacks the required scope (orders | write)." } }
HTTPCodeDescription
400invalid_request, invalid_cursor, invalid_limit, invalid_dateData is missing or malformed.
401unauthorized, key_revoked, key_expiredMissing, invalid, revoked or expired key.
403insufficient_scopeThe key lacks the required scope.
404not_foundIt doesn’t exist in your business.
402out_of_creditsNo credits left to send messages.
409contact_exists, closed…Conflicts with the current state.
422invalid_reference, slot_unavailable, window_closed…The data is valid but can’t be applied.
429rate_limitedToo many requests; honor Retry-After.
500internal_errorOur error; retry later.

Pagination

Lists return up to limit items (25 by default, 100 max), newest first, and a next_cursor. For the next page repeat the request with cursor=<next_cursor>; when it's null there are no more.

curl "https://whasalia.com/api/v1/contacts?limit=100&cursor=WyIyMDI2LTEwLTIw…" \
  -H "Authorization: Bearer $WHASALIA_API_KEY"

Rate limits

Each key can make 120 requests per minute. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; above it you get 429 with Retry-After in seconds. Attempts with invalid keys are also limited per IP.

Account

GET/me

The key’s business (id, name, currency, time zone) and its scopes. Use it to test the connection.

{
  "data": {
    "workspace": { "id": "…", "name": "Barbería Demo", "industry": "barbershop", "currency": "PEN", "timezone": "America/Lima", "locale": "es" },
    "api_key": { "id": "…", "name": "n8n producción", "scopes": ["contacts", "messages:send"] }
  }
}

Contacts and tags

GET/contactscontacts

Lists contacts, newest first.

Query parameters

FieldTypeDescription
qstringSearches by name.
phonestringLooks up by phone, with or without country code (not paginated).
emailstringExact email.
tag_iduuidOnly those with that tag.
updated_sinceISO 8601Only those changed since that date (for syncing).
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.
{
  "data": [
    {
      "id": "…", "name": "Ana Torres", "phone": "+51987654321", "email": "ana@example.com", "company": null,
      "avatar_url": null, "tags": [{ "id": "…", "name": "VIP", "color": "#22c55e" }],
      "created_at": "2026-10-20T15:04:05.123Z", "updated_at": "2026-10-21T09:00:00.000Z"
    }
  ],
  "next_cursor": "WyIyMDI2LTEwLTIw…"
}

POST/contactscontacts

Creates a contact. If one with that phone exists it answers 409 contact_exists with its contact_id.

Body (JSON)

FieldTypeDescription
namestringName (max 200).
phonestringInternational format (+51987654321); normalized.
emailstringEmail.
companystringCompany.
tagsstring[]Tag names; created when missing.
curl -X POST https://whasalia.com/api/v1/contacts \
  -H "Authorization: Bearer $WHASALIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ana Torres","phone":"+51 987 654 321","tags":["Web"]}'

GET/contacts/{id}contacts

One contact with its tags.

PATCH/contacts/{id}contacts

Changes name, phone, email or company (send only what changes).

Body (JSON)

FieldTypeDescription
namestringName.
phonestring | nullPhone.
emailstring | nullEmail.
companystring | nullCompany.

GET/tagscontacts

All the business’s tags.

GET/contacts/{id}/tagscontacts

A contact’s tags.

POST/contacts/{id}/tagscontacts

Adds a tag by id, or by name (created when missing).

Body (JSON)

FieldTypeDescription
tag_iduuidExisting tag…
namestring…or its name.
color#rrggbbColor when created.

DELETE/contacts/{id}/tags/{tag_id}contacts

Removes the tag from the contact.

Conversations and messages

Reading needs the conversations scope; sending needs messages:send. The team’s internal notes never go out through the API.

GET/conversationsconversations

Lists conversations, most recently active first.

Query parameters

FieldTypeDescription
statusopen | pending | closedStatus.
channelwhatsapp | instagram | messenger | tiktok | webchatChannel.
assigneduuid | none | anyAssigned to that person, to nobody or to anyone.
contact_iduuidOf that contact.
updated_sinceISO 8601Only those changed since that date (for syncing).
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

GET/conversations/{id}conversations

One conversation with its channel and contact.

GET/conversations/{id}/messagesconversations

The conversation’s messages, newest first.

Query parameters

FieldTypeDescription
created_sinceISO 8601Only those after that date.
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

POST/conversations/{id}/messagesmessages:send

Sends a message to the customer on the conversation’s channel. Outside the reply window (24 h on WhatsApp) only an approved template goes out; otherwise it answers 422 window_closed. Each message sent uses 1 credit; without credits it answers 402 out_of_credits.

Body (JSON)

FieldTypeDescription
type*text | media | templateMessage type.
textstringFor text (max 4096).
media_typeimage | video | audio | documentFor media.
urlhttps URLFor media: public file.
caption, filenamestringOptional for media.
template_namestringFor template (WhatsApp only).
languagestringTemplate language; defaults to the saved template’s.
paramsstring[]Values for the body’s {{1}}, {{2}}…
curl -X POST https://whasalia.com/api/v1/conversations/{id}/messages \
  -H "Authorization: Bearer $WHASALIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"template","template_name":"pedido_listo","params":["Ana","#1042"]}'

Bookings

Dates and times are in the business’s time zone (GET /me). Service and staff ids are shown in the dashboard.

GET/bookingsbookings

Lists bookings.

Query parameters

FieldTypeDescription
date_from, date_toYYYY-MM-DDDate range.
statuspending | confirmed | completed | cancelled | no_showStatus.
staff_id, service_id, contact_iduuidFilters.
updated_sinceISO 8601Only those changed since that date (for syncing).
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

POST/bookingsbookings

Creates a booking. By default it checks availability like the AI agent (hours, staff agenda, Google Calendar); if the time is taken it answers 422 slot_unavailable with alternatives.

Body (JSON)

FieldTypeDescription
contact_id*uuidCustomer.
date*YYYY-MM-DDDay.
time*HH:MMTime (24 h).
service_id, staff_id, product_id, conversation_iduuidOptional.
customer_namestringName for the booking.
party_sizeintegerPeople (restaurants).
fieldsobjectExtra data the business asks for.
notesstringNotes.
check_availabilitybooleanfalse saves it as given (manual entry).
duration_minutes, statusinteger, pending | confirmedOnly with check_availability: false.

GET/bookings/{id}bookings

One booking.

PATCH/bookings/{id}bookings

Changes the status or the notes.

Body (JSON)

FieldTypeDescription
statuspending | confirmed | completed | cancelled | no_showNew status.
notesstringNotes.

Catalog

GET/productscatalog

Lists products with their variants.

Query parameters

FieldTypeDescription
qstringSearches by name.
skustringExact SKU.
activetrue | falseActive or inactive.
category_iduuidCategory.
updated_sinceISO 8601Only those changed since that date (for syncing).
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

POST/productscatalog

Creates a product. The same fields edit it with PATCH.

Body (JSON)

FieldTypeDescription
name*stringName.
descriptionstringDescription.
price, compare_at_pricenumberPrice and previous price, in the business’s currency.
skustringCode.
track_stock, stockboolean, integerStock tracking.
imagesstring[]Image URLs (max 20).
tagsstring[]Tags.
category_iduuidCategory.
attributesobjectIndustry attributes (e.g. m², bedrooms).
is_active, is_featuredbooleanVisible and featured.

GET/products/{id}catalog

One product.

PATCH/products/{id}catalog

Edits a product (send only what changes).

Orders

GET/ordersorders

Lists orders with their lines.

Query parameters

FieldTypeDescription
statuspending | confirmed | preparing | ready | shipped | delivered | cancelledStatus.
payment_statusunpaid | awaiting_proof | proof_received | paid | refundedPayment.
contact_iduuidCustomer.
created_sinceISO 8601Created since that date.
updated_sinceISO 8601Only those changed since that date (for syncing).
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

POST/ordersorders

Creates an order with catalog products; prices come from the catalog.

Body (JSON)

FieldTypeDescription
contact_id*uuidCustomer.
fulfillment*pickup | delivery | dine_inFulfillment.
items*[{product_id, variant_id?, quantity}]1 to 100 lines.
address, address_referencestringRequired for delivery.
notesstringNotes.

GET/orders/{id}orders

One order.

PATCH/orders/{id}orders

Changes the status or marks the order as paid. The customer gets a message in their chat unless you send notify: false.

Body (JSON)

FieldTypeDescription
statusconfirmed | preparing | ready | shipped | delivered | cancelledNew status.
reasonstringReason (e.g. when cancelling).
payment_statuspaidMarks the payment.
notifybooleanNotify the customer (default yes).

CRM: deals, tasks and team

GET/pipelinescrm

Pipelines with their stages (ids for deals).

GET/memberscrm

Active team members: user_id for tasks, profile_id for deals.

GET/dealscrm

Lists deals.

Query parameters

FieldTypeDescription
pipeline_id, stage_id, contact_iduuidFilters.
statusopen | won | lostStatus.
updated_sinceISO 8601Only those changed since that date (for syncing).
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

POST/dealscrm

Creates a deal (without stage_id it enters the first stage).

Body (JSON)

FieldTypeDescription
pipeline_id*uuidPipeline.
title*stringTitle.
stage_iduuidPipeline stage.
value, currencynumber, ISO 4217Amount.
contact_id, conversation_iduuidLinks.
assigned_touuidprofile_id from GET /members.
expected_close_dateYYYY-MM-DDExpected close.
notesstringNotes.

GET/deals/{id}crm

One deal.

PATCH/deals/{id}crm

Edits the deal, moves it to another stage or closes it.

Body (JSON)

FieldTypeDescription
stage_iduuidAnother stage of the same pipeline.
statusopen | won | lostlost requires lost_reason.
title, value, currency, contact_id, conversation_id, assigned_to, notes, expected_close_date—As when creating.

GET/taskscrm

Lists tasks.

Query parameters

FieldTypeDescription
statusopen | done | cancelledStatus.
assignee_user_id, contact_id, deal_id, conversation_iduuidFilters.
limitinteger1 to 100 (default 25).
cursorstringThe next_cursor of the previous page.

POST/taskscrm

Creates a task.

Body (JSON)

FieldTypeDescription
title*stringTitle.
descriptionstringDetails.
due_atISO 8601Due date.
prioritylow | normal | high | urgentPriority.
assignee_user_iduuiduser_id from GET /members.
contact_id, conversation_id, deal_iduuidLinks.

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…).

EventdataDescription
message.receivedmessage, contactA customer wrote.
message.sentmessage, contactA message went out (team, AI, flow or API).
conversation.createdconversation, contactNew conversation.
conversation.assignedconversation, assigned_user, previous_assigned_user_idAssigned to someone else.
conversation.resolvedconversation, resolved_by_user_idIt was closed.
contact.createdcontactNew contact.
contact.updatedcontact, changedA contact changed (changed lists the fields).
order.createdorderNew order.
order.status_changedorder, previous_statusThe order’s status changed.
order.paidorder, previous_payment_statusThe order was marked as paid.
booking.createdbooking, contactNew booking.
booking.status_changedbooking, previous_statusThe booking’s status changed.
lead.qualifiedlead, contactThe AI qualified a lead (real estate).
deal.stage_changeddeal, from_stage, to_stage, pipelineA deal changed stage.
pingmessage, endpoint_idThe “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

ToolMinimum roleDescription
get_businessAgentThe connected business, your role, the active modules and (admins) the credits.
list_conversationsAgentInbox conversations; filter by status, channel, assignee or contact.
get_conversationAgentOne conversation with its channel, contact and status.
list_messagesAgentMessages of a conversation (no internal notes).
list_contactsAgentSearch contacts by text, phone or email.
get_contactAgentOne contact with its tags.
list_tagsAgentThe business's tags.
list_membersAgentTeam members (to assign conversations).
list_agentsAgentAI agents, their setup and the channels they answer.
list_faqsAgentFAQs the agents use.
list_automationsAgentAutomations and whether they are on.
get_automationAgentOne automation with its steps.
list_flowsAgentConversation flows and their status.
get_flowAgentOne flow with all its nodes.
list_quick_repliesAgentThe team's quick replies.
list_comment_rulesAgentAutomatic comment replies.
list_whatsapp_templatesAgentWhatsApp templates with their status and the AI rule of each button.
list_bookingsAgentAppointments and bookings.Needs the Bookings module
list_ordersAgentStore orders.Needs the Orders module
list_productsAgentCatalog products.Needs the Products module
list_pipelinesAgentSales pipelines and their stages.
list_dealsAgentSales deals.
list_tasksAgentTeam tasks.
get_reportAgentMetrics for a period (an agent sees their own report, as in the panel).
how_to_buildAgentGuide to triggers, steps and nodes so the AI can build automations and flows.

Inbox and contacts

ToolMinimum roleDescription
reply_to_conversationAgentSends 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_conversationAgentStatus, priority, assignee, team or AI agent; pause or resume the AI.
create_contactAgentCreates a contact.
update_contactAgentChanges name, phone, email or company.
tag_contactAgentAdds a tag (creates it if missing).
untag_contactAgentRemoves a tag.
create_quick_replyAgentCreates a quick reply (shared only if you are an admin).

AI agents and rules

ToolMinimum roleDescription
create_agentAdminCreates an AI agent.
update_agentAdminChanges an agent's rules, tone, messages or knowledge (can be undone).
create_faqAdminCreates a FAQ.
update_faqAdminChanges a FAQ.
set_template_button_rulesAdminWhat the AI does when each template button is pressed.
create_comment_ruleAdminAutomatic reply to Instagram or Facebook comments.
create_automationAdminCreates an automation (trigger + steps), on or off.
set_automation_activeAdminTurns an automation on or off.
create_flowAdminCreates a flow with its nodes and, if you want, publishes it.
set_flow_statusAdminPublishes, drafts or archives a flow.

CRM

ToolMinimum roleDescription
create_taskAgentCreates a task.
create_dealAgentCreates a deal in a pipeline.
update_dealAgentMoves 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