Skip to content

WhatsApp custom chatbot: an AI agent on your own systems

Connections, URLs, Knowledge, Webhooks and Agents, with a full worked example: Maple Street Dental's booking assistant.

On this page

How the custom chatbot works

In the custom chatbot (Mode 3) our AI runs an agent you describe in plain words. It reads and writes data only through the URLs you give it, quotes only the documents you attach, and sends results to your webhooks. It is fully automatic: staff do not take over, and chats are read only in the Inbox. Price: $29 a month or $290 a year per number, with 30 million AI tokens a month included.

You set up five things, in this order: Connections (logins), URLs (addresses the agent may call), Knowledge (documents), Webhooks (where results go) and the Agent. The worked example below is Maple Street Dental, a family clinic in Portland, Oregon, whose agent books, moves and cancels appointments through the SaleFlowPoint company agent API.

WhatsApp > Agents with the Booking assistant
WhatsApp > Agents for Maple Street Dental.

1. Connections: the saved login

WhatsApp > Connections holds the logins your agents use. The secret is encrypted and never shown again after you save it. Login types: no login, API key in a header, API key in the address, user name and password, bearer token, and OAuth 2 client credentials (Business Central, Dynamics, most ERPs).

FieldExample value
NameSaleFlowPoint agent API
Login typeBearer token
Tokensfp_live_... (an API key from WhatsApp > API and webhooks)
API hostapi.example-shop.com

Click Test connection to check it. A connection used by a live agent or by a URL cannot be deleted.

The Connections page with the SaleFlowPoint agent API connection
The saved login. The host shown is an example.

2. URLs: what the agent may call

WhatsApp > URLs lists your systems' addresses. For each one you write what it does in plain words (the AI reads it), pick the method and connection, and list its inputs. Each input is Filled by one of:

  • The AI fills it from the chat, for example a date the customer gives.
  • The customer's phone: always the WhatsApp number that is writing. The AI cannot change it, so nobody can read or move another customer's booking.
  • A fixed value, for example the branch id.
  • A saved detail from the agent's Details to collect.

When to use: at chat start, when the customer gives a value, when needed during the chat, or at chat end. A URL that changes data (POST, PUT, PATCH, DELETE) has Ask the customer "yes" before calling it ticked by default. Timeout 1 to 20 seconds, retries 0 to 2, an optional waiting text sent if a call takes over 3 seconds, and fields to keep from the reply (up to 4 KB). You can also paste a cURL command or an OpenAPI 3 file to fill the form; secrets are left out.

Maple Street Dental's eight URLs, all on the connection above:

NameMethod and pathWhenInputsYes first
list_servicesGET /servicesWhen neededNoneNo
list_dentistsGET /staffWhen neededservice_id (AI), branch_id (fixed value)No
open_slotsGET /slotsWhen neededservice_id, date (YYYY-MM-DD), staff_ref (optional), all AI; waiting text "Checking the diary..."No
bookPOST /bookingsWhen neededcustomer_phone (the customer's phone), customer_name, service_id, starts_at, staff_ref, notes (AI, in the body)Yes
my_bookingsGET /bookingsAt chat startcustomer_phone (the customer's phone)No
find_my_bookingsGET /bookingsWhen neededcustomer_phone (the customer's phone)No
reschedulePOST /bookings/{{booking_id}}/rescheduleWhen neededbooking_id (AI, in the path), customer_phone, starts_atYes
cancelPOST /bookings/{{booking_id}}/cancelWhen neededbooking_id (AI, in the path), customer_phone, reason (optional)Yes

The paths sit under https://api.example-shop.com/api/v1/agent-api. Because my_bookings runs at chat start, its answer is ready before the first reply; the description calls it start.my_bookings.

The URLs page listing Maple Street Dental's eight URLs
WhatsApp > URLs: the eight addresses, with "asks the customer first" on the ones that change data.
The book URL open in the form: name, what it does, method POST, connection, address and the first inputs
Editing the book URL: customer_phone is filled by the customer's phone and goes in the body.
The bottom of the book URL form: fields to keep, ask the customer yes first, timeout and Save URL
The end of the same form: "Ask the customer yes" is ticked because booking changes data.

3. Knowledge: documents the agent may quote

WhatsApp > Knowledge holds files and web pages: an FAQ, a price list, a returns policy. Add each once and attach it to any agent. The AI reads each document once; that reading uses AI tokens from the number you pick. Limits: 20 documents per agent, 5 MB per file, 50 MB per company, 256 KB per web page.

Maple Street Dental's FAQ says: open Monday to Friday, 8 AM to 5 PM; 1820 SE Maple Street, Portland, Oregon, with free parking; Delta Dental, Cigna, Aetna and MetLife PPO plans accepted; new patients arrive 15 minutes early; 24 hours' notice to cancel, or a missed appointment may be charged 50 dollars.

The Knowledge page with an uploaded FAQ document
WhatsApp > Knowledge.

4. Webhooks: where results go

WhatsApp > Webhooks holds addresses in your systems that receive chat events. Each has its own signing secret (shown once) and an optional saved login. When can be a task being done (an outcome) or other chat events. Send can be limited by a condition: only when a detail is saved, only when a detail is empty, or only when a detail compares to a value.

FieldExample value
NameFront desk alert
WhenA task is done (outcome): booking_made
Addresshttps://frontdesk.maplestreetdental.example/hooks/whatsapp
SendOnly when a detail compares: patient_type is new

Requests carry X-Signature: t=<unix seconds>,v1=<hex> (HMAC-SHA256 of t + "." + raw body), with X-SFP-Event and a unique X-SFP-Event-Id. Send a test event posts one signed sample marked test: true.

The Webhooks page with one webhook, Sales team inbox, waiting for the task quote_created
WhatsApp > Webhooks, from another demo company: one webhook sends each finished quote to the sales team (address shown as an example).

5. The agent

WhatsApp > Agents > Create agent, then fill each section. Maple Street Dental's Booking assistant:

SectionExample value
Agent nameBooking assistant
Description (up to 8,000 characters)You are the WhatsApp booking assistant of Maple Street Dental, a family dental clinic in Portland, Oregon. You help patients see services and prices, find open times, book, reschedule and cancel their own appointments... To book: ask one question at a time - which service, which day, any preferred dentist, then the patient's full name, the reason for the visit and whether they are new or returning.
GreetingHi, this is Maple Street Dental. I can book, move or cancel an appointment, or answer questions. How can I help?
URLs it may callThe eight URLs above
Details to collectpatient_name (text, required), visit_reason (text, required), patient_type (choice: new, returning)
Tasks (outcomes)booking_made: a booking was made after the patient said yes; booking_changed: a booking was moved or cancelled
Knowledge baseThe clinic FAQ
WebhooksFront desk alert
After the chatsummary (text): one-line summary for the front desk; needs_callback (yes/no)
End the chat after30 quiet minutes (5 to 1,440)
The agent page with the Instructions section: name, description and greeting
The Booking assistant: Instructions.

Details to collect are what the agent asks the customer for. Tick Remember on a detail to keep it for that customer's next chat; it is removed after 90 days unused. The Memory panel can forget one customer by their number (for example +1 503 555 0199).

Details to collect: patient_name, visit_reason and patient_type
Details to collect.

Tasks (outcomes) are jobs the agent finishes, such as booking_made. A webhook can wait for a task.

Steps are optional: a fixed order for the chat. Without steps the agent follows the description freely. Step types: Talk, Collect details, Call a URL, Send a message, Check, Task done, Hand to a person and End. Arrows choose the next step: otherwise, a detail is saved or empty, a detail compares to a value, a URL answered or failed, the customer said yes or no. The canvas shows the steps as a map.

After the chat: fields the AI fills from each finished chat, shown in Chats and results. Call log lists URL calls and webhook posts, with values masked, kept for 90 days.

Every part of the agent page

The agent page has three columns. On the left, the Agent sections (Instructions, Steps, URLs it may call, Details to collect, Tasks (outcomes)) with a count beside each one that has items, then the Activity sections (Chats and results, Call log), and under them Live version, Newest build and Last built (None or Never until the first build). In the middle, the section you picked. On the right, Agent settings: folding panels, each with a short summary beside its name. Knowledge base and Webhooks start open.

The top bar has Versions, Test chat, Save, Build agent, Activate version (when the newest build is not live) and Pause or Resume (once a version is live). A change shows Unsaved changes; Build agent waits until you save.

Instructions

What the agent does, in plain words. Save, then Build to use your changes.

FieldLimitMaple Street Dental
Agent nameBooking assistant
Description (up to 8,000 characters)8,000 charactersYou are the WhatsApp booking assistant of Maple Street Dental, a family dental clinic in Portland, Oregon...
Greeting (first reply)500 charactersHi, this is Maple Street Dental. I can book, move or cancel an appointment, or answer questions. How can I help?
When your system does not answer500 charactersSorry, our system is busy right now. A member of the team will reply shortly.
When a question is out of scope500 charactersI can help with appointments and clinic questions. For anything else the team will reply.

Left empty, When your system does not answer gives a build warning, and customers get the standard text "Sorry, I can't help with that right now. Please try again a little later."

The Instructions panel with the agent name, description, greeting, fallback and out-of-scope texts
Instructions: Maple Street Dental's Booking assistant.

Steps

Optional: a fixed order for the chat. Without steps the agent follows the description freely. Click Use steps to start. Up to 50 steps, each with up to 10 arrows to the next step. The step types and arrows are explained under The agent. Maple Street Dental uses no steps, so the count is empty.

The Steps panel with the Use steps button
Steps: none yet, so the agent follows the description.

URLs it may call

Tick the URLs this agent may use; each shows its name, method and description. You add or change URLs on WhatsApp > URLs. Up to 20 URLs per agent, and at most 10 URL calls for one customer message. Maple Street Dental ticks all eight (count 8).

The URLs it may call panel with Maple Street Dental's URLs ticked
URLs it may call: list_services, open_slots, book and the others.

Details to collect

What the agent asks the customer for. Each detail has Name, Type (text, number, date, phone, email, list or choice), What it is (up to 200 characters), Required and Remember, and a Remove button; Add a detail adds one. Up to 30 details. A name is lower-case letters, digits and underscores, starts with a letter, and is used once.

  • Remember keeps the detail for that customer's next chat; it is removed after 90 days unused.
  • If a detail is Required and no webhook waits for collected details, the build gives a warning.
  • For a choice detail a Choices box appears: type the choices one per line or with commas between, up to 20, each up to 60 characters. Blank and repeated choices are dropped. With none, too many or one too long, the box shows the problem and Save stops with it.
  • Maple Street Dental (count 3): patient_name (text, required), visit_reason (text, required), patient_type (choice: new or returning, required). None is marked Remember.
Details to collect: patient_name, visit_reason and patient_type
Details to collect, with Required and Remember on each row.

Worked example: details and results guide.

Tasks (outcomes)

Jobs the agent finishes, such as order placed. A webhook can wait for a task. Each task has Name and When it is done (up to 200 characters); Add a task adds one. Up to 10 tasks, with names in the same form as details. Maple Street Dental (count 2): booking_made, "A booking was made after the patient said yes"; booking_changed, "A booking was moved or cancelled".

Tasks (outcomes): booking_made and booking_changed
Tasks (outcomes).

Knowledge base

Summary: N attached. The documents this agent may quote, each with the number of agents that use it; Not read marks one the AI could not read. ✕ detaches one, + Attach from Knowledge then Attach adds one from your central Knowledge, and Manage Knowledge opens WhatsApp > Knowledge. Build again to use the change. Limits: 20 documents per agent, 5 MB per file, 50 MB per company, 256 KB per web page. Maple Street Dental attaches its clinic FAQ (1 attached).

The Knowledge base panel with the clinic FAQ attached
Knowledge base: 1 attached.

Worked example: knowledge base guide.

Webhooks

Summary: N attached. The webhooks this agent sends to, each with its name and what it waits for, for example "Task done: booking_made". ✕ detaches one, + Attach from Webhooks then Attach adds one, and Manage Webhooks opens WhatsApp > Webhooks. Up to 10 webhooks per agent and 50 for the company. Maple Street Dental attaches Front desk alert (1 attached).

The Webhooks panel with Front desk alert waiting for booking_made
Webhooks: 1 attached.

Worked example: webhooks guide.

After the chat

Summary: N fields. When a chat ends, the AI fills these in, for example the issue or whether it was solved. Each uses this number's AI tokens. Up to 10. Each field has Name, Type (text, number, yes or no, choice), What it is and, for a choice, Choices (comma between) (up to 20; a choice field needs them). Add a field adds one.

The AI reads the last 60 messages of the chat (up to 12,000 characters). The answers appear in Chats and results and go to any webhook waiting for After-chat fields filled. Maple Street Dental (2 fields): summary (text), "One-line summary for the front desk"; needs_callback (yes or no), "Does the front desk need to call back?".

After the chat with the summary and needs_callback fields
After the chat: 2 fields.

Memory

Summary: on when any detail is marked Remember, otherwise off. On, details marked Remember are kept for each customer for 90 days after their last chat. Forget a customer (WhatsApp number with country code) with Forget removes what is kept for one number, for example +1 503 555 0199; the answer is "Forgotten." or "Nothing was remembered for that number." Maple Street Dental remembers nothing, so it shows off.

The Memory panel, off, with the Forget a customer box
Memory: off, because no detail is marked Remember.

Privacy

Summary: Optional, or Link set once you add one. Privacy policy link (optional), up to 500 characters. It is optional: leaving it empty gives no warning. If you give one, it must start with https://, or the build stops with "The privacy policy link must start with https://, or leave it empty." With a link set, the agent adds one line under the first reply each customer gets: "How we use your details: " and your link. It is sent once per customer (a later chat does not repeat it), and the line is added by SaleFlowPoint, not written by the AI, so the link is always exactly the one you typed. The test chat shows it on its first reply and in the trace. Maple Street Dental leaves it empty.

The Privacy panel with the optional privacy policy link
Privacy: Optional.

Chat settings

Summary: ends after N min. End the chat after this many quiet minutes (5-1,440): 30 by default. A chat that goes quiet for that long ends, timed from the customer's last message, and a chat-ended event goes to any webhook waiting for it; the next message starts a new chat. After the chat fields are filled when a chat ends. Maple Street Dental uses 30 (ends after 30 min).

Chat settings: end the chat after 30 quiet minutes
Chat settings: ends after 30 min.

Customer files

Summary: read or off. Read photos, PDFs and voice notes customers send lets this agent open what a customer sends: photos up to 5 MB, PDFs up to 10 MB and 10 pages, voice notes up to 5 minutes. It is saved at once (no Build needed). Each reading uses this number's AI tokens. Files are kept privately for 30 days, then deleted. Off, nothing is downloaded and the agent asks the customer to type it instead. New agents start with it off; agents made before this setting existed have it on, so they work as before.

WhatsApp number

Summary: the number's label, or its phone number, or none. This agent answers on picks one of your numbers, or No number yet. If the version is live but the number still uses API or Chatbot mode, the panel says so with a link: Switch it to Custom chatbot. Maple Street Dental answers on +1 503-555-0142 · Front desk.

The WhatsApp number panel with +1 503-555-0142 Front desk chosen
WhatsApp number: Front desk.

Worked example: connect a number to an agent.

Chats and results

What the AI filled in from each finished chat: the end time, then each field and its value (yes, no, or - when the chat did not say). With no After the chat fields it says "No after-chat fields set up. Add them under After the chat, then Build."; with fields but no finished chat yet, "No finished chats analysed yet." A Maple Street Dental row reads like: summary: Emily Carter booked a check-up and clean for Wednesday · needs_callback: no.

Chats and results with no finished chats analysed yet
Chats and results before the first finished chat.

Call log

URL calls and webhook posts. Values are masked; kept for 90 days. URL calls shows the time, method, host, status (or the error), time taken in ms, and test for test-chat calls. Webhook posts shows the time, the event and delivered, pending or failed, with the last error; Resend sends a post again (not while it is pending).

The Call log with URL calls to api.example-shop.com
Call log: test-chat calls to the agent API (host shown as an example).

Start again

In the test chat's header, ↺ (Start again) opens a fresh chat: the messages, a waiting yes, the details collected and the current step are cleared. Test memory for the test phone is kept, so it acts like the same customer coming back; Forget test memory clears that. ✕ closes the test chat. The header chip shows the version and dry run. The customer phone must be in +country format, for example +15035550199 (up to 16 characters).

The test chat with Start again in the header, dry run ticked and a test phone
The test chat, version 15, dry run, with Start again (↺) in the header.

Worked example: build and test chat guide.

The test chat

Click Build agent first: the build checks the agent and lists anything to fix (blockers) or accept (warnings). Then open Test and type as the customer. URLs use their test address; nothing is sent on WhatsApp and no tokens are charged.

  • Dry run (ticked by default): URLs that change data are not called; the trace shows what would be sent.
  • Customer phone: the test number in +country format, for example +15035550199. The customer's phone inputs use it.
  • The trace under each reply shows every URL called (with status and time), each write not sent but shown as a dry run until the yes, the documents used, the details saved and the step taken.
  • Test memory: details marked Remember are kept for the test phone; Forget test memory clears them.
  • Finish chat and analyse fills the After the chat fields, as a real chat would (it uses the agent number's tokens when it has one).
  • Start again opens a fresh chat.
The test chat with a patient asking for a check-up price and the agent's reply with the trace
A test chat: my_bookings runs at the start, list_services is called, and the agent answers "A check-up and clean is $145.00."

Example conversation: "Hi, how much is a check-up and clean?" - the agent calls list_services and answers with the price. "Do you have anything next Wednesday morning?" - it calls open_slots. "The first morning time please, any dentist. Emily Carter, routine check-up, returning patient" - it shows one summary and prepares book. "yes" - only then book runs, and the agent gives the booking id.

Going live

  1. Build agent. Fix every blocker and accept each warning.
  2. The first build is sent to SaleFlowPoint for a first check; the page shows Waiting for SaleFlowPoint's check.
  3. Activate the version. New chats use it at once; chats already open finish on theirs. Older versions can be activated again (Roll back).
  4. On WhatsApp > Numbers, switch the number to Custom chatbot and pick the agent under This agent answers on.

Pause on the agent stops every chat at once; customers get your fallback text. An agent that answers a number cannot be deleted: switch the number to another mode first.

AI usage and limits

Each custom chatbot number includes 30 million AI tokens per billing cycle. Above that, extra tokens are charged at the AI model's price plus 30%, up to the extra limit you set on WhatsApp > AI usage (the default limit is $0, so the agent pauses at the included amount). Reading Knowledge documents and Finish chat and analyse also count.

The company agent API

If you have no system of your own, the agent can use SaleFlowPoint's own data through the company agent API: branches, services, staff, open slots, bookings, products with stock, orders, invoices and payments. Use the same API key as the WhatsApp API. Every endpoint is in the agent API developer guide.

Worked examples

Next: Daily work · All WhatsApp guide pages

Try WhatsApp free for 7 days

Register your shop, connect a WhatsApp Business number and start the trial.

Loading SaleFlowPoint…