Skip to content
Guides6 min read

How to Turn Your API into a WhatsApp and iMessage Agent

A step-by-step guide to building agents on your own APIs: turn your endpoints and MCP servers into a hosted WhatsApp and iMessage agent in under 30 minutes.

Grainy silhouette of a person against a blurred orange and navy dusk sky

Your customers won't download another app or open your chat widget. They will text you.

Most companies already have what an agent needs: APIs for orders, bookings, and accounts, maybe an MCP server, and a help center. What's missing is everything between "a customer texted us" and "the right API call happened safely." That gap is why building agents usually takes months of infrastructure work before a single customer gets an answer.

This guide shows how to skip that part. In under 30 minutes you'll go from the APIs you already have to a hosted WhatsApp agent and iMessage agent your customers can text. You'll learn:

  • What an agent actually needs from your product
  • The five steps to launch one
  • How to keep it safe when it can change real data
  • What to check before you go live

What your agent needs from your product

An agent is only as useful as what it can do. Before you build anything, write down three things:

  1. The jobs. What do customers text you about most? For example: "Where's my order?", "Can I move my appointment?", "Upgrade my plan."
  2. The calls behind each job. Which endpoint answers it? GET /orders/:id, POST /bookings/:id/reschedule, PATCH /subscriptions/:id.
  3. The risky ones. Which calls change money, data, or commitments? Those need a person in the loop at first.

If you have that list, you've done most of the thinking.

Step 1: Describe the agent

Create an agent on Keiki and describe its job in plain language:

"You're the support agent for Acme. Answer order and delivery questions, reschedule bookings, and send billing disputes to the support team."

You can also start from a template. Add knowledge too: your help center, docs, and FAQs, so it can answer questions that don't need an API call.

Step 2: Turn your APIs into tools

This is the "Shopify for agents" part. You don't rewrite your product; you plug it in:

  • Webhooks. Point a tool at an endpoint you already run. Keiki calls it with structured arguments and passes the result back to the agent.
  • MCP servers. If you have an MCP server, connect it and its tools become the agent's tools.
  • Add-ons. Use marketplace add-ons for common jobs, so you don't build them.

Give each tool a clear name and description, like reschedule_booking: moves an existing booking to a new time. The agent picks tools based on those descriptions.

Step 3: Decide what needs a human

Letting an agent change real data is where most teams stall. Keiki makes it a setting, not a project.

By default a tool runs immediately. For anything risky, set the tool's approval to ask. The agent then proposes the call, a person approves or declines it, and only the stored call runs. Add a preview tool and the person sees exactly what will change before approving it. See governed actions.

A good rule for launch: reads are allowed and writes ask. Loosen it once you trust what you see.

Step 4: Know who's texting

A customer asking "where's my order?" should only see their own orders. With identity, each conversation carries who the customer is and what they're allowed to do. You set it up through the partner deployments API. Give each tool the scopes it requires, and Keiki checks them before the call runs. A tool with no required scopes stays open to everyone.

That check is not enough on its own. Webhook tools receive the caller's identity with each call, and your API should still verify that the order or account belongs to that caller, the same way it does for your app. Never trust an ID the model passes in.

Step 5: Launch your WhatsApp and iMessage agent

The agent is defined once. Channels are where you put it (see cloud agents):

  • WhatsApp for customers outside the US, including customers who message you from a WhatsApp username instead of a phone number.
  • iMessage for US customers. Buy a dedicated line in Keiki or connect one you already have. With the iMessage Apps add-on, the agent can open a booking page or checkout as a card in the thread, with no iOS app required.
  • Slack, Telegram, and email use the same agent, tools, and rules. SMS/RCS and phone calls are in early access.

Before you go live

Hosting is the easy part. Running it reliably is what matters. Before you share the number, check these:

  • Test the real jobs. Text the agent the five things customers ask most. Then text it the way people really do: three messages in a row, a typo, "actually, make it Saturday." Keiki groups bursts into one turn and picks up new messages mid-answer, but check that your tools handle the result.
  • Read the traces. Every turn shows what the agent read, which tools it called with which arguments, and what it cost. If an answer is wrong, the trace tells you whether the cause was the prompt, the tool, or your API.
  • Replay before you change it. Replay past conversations against a new prompt before you ship it, so a fix for one case doesn't break five others.
  • Plan the handoff. Decide which conversations go to a person, and make sure that person gets the full context.

Already built your own agent?

You don't have to start over. Keep your model loop in your app with the external harness, and Keiki handles channels, delivery, history, and logs.

FAQ

Do I need to change my API? Usually not. If your app can call it, the agent can too. What helps most is a clear name and description for each tool.

Where does the agent run? On Keiki. You don't run servers, queues, or webhooks for the agent itself. Your APIs stay where they are.

What if the agent does something wrong? Start with writes set to ask, review traces daily for the first week, and turn on autonomy one tool at a time.

How long does it really take? Describing the agent, connecting your tools, and adding a channel takes under 30 minutes. Testing against real conversations is worth more time than that.

Turn your product into an agent

Start building on Keiki or pick an agent template. Connect one API, add a WhatsApp or iMessage line, and text it before lunch.