If you have built a bot for Telegram, Slack or Discord, the pattern is familiar: register an app, get a token, subscribe to a message event, reply. Every platform ships this. iMessage does not. There is no bot registration, no token, no event subscription, and no Apple-run webhook.
That gap has become much more visible in the last two years, because the obvious place to put a conversational AI agent is the app people already have open. So the question gets asked constantly, and the answer has not changed.
What a bot needs, and where it has to come from
Strip a messaging bot down and it needs exactly four things. On Telegram, all four come from Telegram. On iMessage, all four have to come from somewhere else.
| Bot needs | Telegram gives you | On iMessage it comes from |
|---|---|---|
| An identity to send as | A bot account with an @handle | A phone number on a real Apple ID, held by your provider or your Mac |
| A way to send | sendMessage HTTP method | The provider's REST or gRPC send endpoint |
| A way to receive | Long polling or a webhook | The provider's inbound webhook, or a bridge watching the local chat database |
| Delivery signal | Message object with an id | Provider delivery events — coverage varies a lot by vendor |
Inbound is where vendors differ most
Sending is easy and everyone does it. Receiving replies reliably — with ordering, deduplication and retries — is the part that separates a serious provider from a demo. Check webhook support explicitly on the providers page and read error handling and retries before you design around it.
The shape of an iMessage bot that works
Once you have a provider, the loop is conventional. This is the whole thing — an inbound webhook, your logic, an outbound send.
// Illustrative. Field names differ per vendor — check their live docs.import express from "express"; const app = express();app.use(express.json()); app.post("/webhook/imessage", async (req, res) => { // 1. Acknowledge fast. Providers retry on a slow or failed response, // and a duplicate reply is worse than a late one. res.sendStatus(200); const { from, text, message_id } = req.body; // 2. Deduplicate. At-least-once delivery means you WILL see repeats. if (await seen(message_id)) return; await remember(message_id); // 3. Your actual logic. const reply = await answer(text); // 4. Send. Every vendor has some version of this call. await fetch("https://api.example-provider.com/v1/messages", { method: "POST", headers: { Authorization: `Bearer ${process.env.IMESSAGE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ to: from, text: reply }), });}); app.listen(3000);Note what is doing the work here: acknowledging before processing, and deduplicating on the provider's message id. Both are consequences of at-least-once delivery, which every provider in this category uses. Skip them and your bot will double-reply in production even though it never did in testing.
If the bot is an AI agent
Most people asking this question in 2026 are putting an LLM behind the webhook. That works, and several providers now position themselves specifically at agent builders — Photon and Linq both lead with it. Two things change when the responder is a model rather than a state machine.
- Latency becomes a product decision. A model that takes eight seconds to answer reads as a person who wandered off. Send a typing indicator if your provider supports one, and set a hard timeout with a graceful fallback message.
- The model will eventually say something you would not. A blue bubble carries the implication of a person at your business. Put a real content filter and an escalation path in front of it, not just a system prompt. AI agents and customer texts covers this properly.
For the language-specific starting points, see Node.js and Python.
Related questions
- Can I build an iMessage bot?
- Yes, but not with an Apple API. You build it against a hosted iMessage provider's webhook and send endpoint, or against a self-hosted bridge running on a Mac you control.
- Why does iMessage have no bot API when Telegram and Slack do?
- Because iMessage is a retention feature for iPhone rather than a developer platform. A bot API would let anyone send a blue bubble, which would remove the scarcity that makes the blue bubble meaningful.
Still deciding?
Compare the services that can actually send this on the providers page, see what each one costs, or read the step-by-step guides.