Blog

What is an iMessage API?

Is there an iMessage API?

There is no official iMessage API: Apple publishes no way for a server to send or receive iMessages. What this guide calls an iMessage API is a service that runs Macs signed in to Apple accounts, and puts an HTTP API in front of them.

Messages is an app on Apple hardware, so the way in is to drive that app on a Mac that is signed in to an Apple account. Mapier's lines work that way, and so does the open-source BlueBubbles server, whose docs say it relies on the macOS Messages app and must run within macOS. So the useful question is not whether an iMessage API exists. It is who runs the Mac, how well, and what the API in front of it promises.

We wrote about the constraint itself in why there is no official iMessage API. This guide is the practical side: how such an API works, what an agent can do with it, and what to check before you build on one.

How does an iMessage API work?

Underneath there are three layers. At the bottom is a Mac, signed in to an Apple account, with Messages running. One Apple account is one line: the phone number or address people see when your agent texts them. In the middle is an automation layer on that Mac, which sends what it is told to send and reports what arrives. On top is the API your application calls.

Your code never talks to the Mac. It sends a command over HTTPS, such as "send this text to this person", and the service answers that it has accepted the command. What happened next arrives later, as events: the message went out, it was delivered, it was read, the person replied. Those events come back on a stream your code keeps open, or as webhooks to your own server.

That split matters more than it first appears. A Mac can be slow, asleep or signed out, and an honest API says when it does not know whether a message went out rather than claiming it did. Mapier's docs, for example, list a status called ambiguous: the channel took the command but could not confirm what happened, so your code should treat it as unknown and not resend blindly.

One send, from its 202 to its receipts: accepted as queued, then succeeded on the stream, then delivered and read, each arriving as its own event.

What can an agent do over an iMessage API?

More than send text. Because the line is a real Apple account, an agent can use most of what a person does in Messages. What each provider exposes differs, so read its list rather than assume. As one example, Mapier's channel support table and the guides it links to list these on iMessage:

  • Text, with a quoted reply to an earlier message.
  • Photos and files, sent and received, and voice notes received.
  • Tapbacks and emoji reactions, added and taken back.
  • Group chats: start one, rename it, change who is in it, and leave it.
  • The line's own name and photo, offered in the conversation.
  • Typing indicators, read receipts, polls, link previews and send effects.
  • Edit and unsend, and a check of whether an address can receive iMessage at all.

What does a send look like?

A single HTTP request. This is the reply step of Mapier's quickstart, as the docs print it: a message into a conversation the agent already has open, with a key that makes a retry safe.

The answer is 202, which means accepted, not sent. The result follows on the stream as succeeded, and delivered and read arrive after it as their own events once you ask the stream for receipts. Send the same request again with the same Idempotency-Key and nothing goes out twice; leave the header off and every request is a new message.

curl

curl -X POST https://api.mapier.ai/v1/commands/message.send \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: first-reply" \
  -H "x-mapier-version: 2026-12-01" \
  -d '{
    "target": { "conversationId": "a000…0001" },
    "payload": { "kind": "text", "text": "Hi! This came from the Mapier API." }
  }'

What should you check before you choose one?

The sales pages all say iMessage. The differences are in the questions below, and most of them are answered in a provider's docs rather than on its home page.

Two of them decide the most. The first is what happens to a message for someone without iMessage. Some providers send it another way on their own: Sendblue's FAQ says it falls back to SMS, and Linq's docs say each send uses the richest of iMessage, RCS and SMS that the person supports. That reaches people on any phone, which fits better when your agent has to reach everyone, though Linq's own table shows SMS carrying no reactions, typing or read receipts. Both also document a check of whether an address is on iMessage before you send. A provider with no SMS fallback, such as Mapier Convo, leaves that choice to the check. The second is who owns the number: if it belongs to the provider, moving later means telling every contact a new one.

  • Who runs the Mac: the provider, or you on your own hardware.
  • How a line is set up, how long that takes, and who owns the number if you leave.
  • What happens when the person cannot receive iMessage: a fallback to SMS or RCS, a check before you send, or both.
  • Whether statuses settle on evidence, and what the API says when it cannot tell.
  • Whether a retry can send a message twice.
  • Whether group chats work, and which other channels sit behind the same API.
  • How opt-outs such as STOP are handled, and what the provider will not carry.
  • Whether there is a place to test before a real person receives anything.

Where does Mapier Convo fit?

Mapier Convo is the iMessage API we run. Its iMessage lines are on Mac minis we rebuild as blade servers and rack in data centres, so the Macs are ours to keep healthy and your application calls one HTTP API with no SDK to install. The same commands and events cover WhatsApp, through a WhatsApp Business number you connect with your own Meta app, once WhatsApp is turned on for your organization.

Some things it does not do, and it is better to know them first. Convo has no SMS or RCS fallback, and it never moves a message to another channel on its own: a reachability check tells you before you send whether an address is on iMessage. An iMessage line is a number that a person at Mapier sets up on request, and the number belongs to Mapier. Access is by approval, on a call with our team.

If you are weighing providers, our comparison of iMessage API providers sets them side by side, and how to give an AI agent an iMessage line walks through the setup. The plans are on Convo's pricing page.

A sketch of a project's lines: two iMessage numbers on Apple accounts signed in on Macs in our fleet, and a WhatsApp number connected through the team's own Meta app.

Questions

Does Apple offer an iMessage API?

No. Apple publishes no way for a server to send or receive iMessages. A service such as Mapier Convo runs Macs signed in to Apple accounts and puts its own API in front of them.

Do I need a Mac to use an iMessage API?

Not with a hosted provider such as Mapier Convo: it runs the Macs and you call its API over HTTPS. You need a Mac of your own, or a macOS virtual machine, if you host an open-source server such as BlueBubbles, whose docs say it must run within macOS.

Can an iMessage API send to Android phones?

Not over iMessage itself. Some providers fall back to SMS or RCS for those people, as Sendblue and Linq describe in their docs. Mapier Convo has no SMS or RCS fallback; it lets you check whether an address is on iMessage before you send.

Can an AI agent start the conversation?

On iMessage, yes: Mapier's docs say your agent may write first. On WhatsApp the first message has to be an approved template.

Is a 202 response a sent message?

No. It means the request was accepted. Whether the message went out arrives later as the command's result on the stream, and delivered and read follow as their own events when you ask for them.

Sources

Blog

Notes from Mapier