Skip to main content
This guide builds an AI agent that people text on iMessage, using the same code as on Telegram, plus the iMessage-specific parts: tapbacks, effects and the replies-only rule.
iMessage is live for replies only, on lines the Flow team connects to your app: the person always writes first, and your agent answers. It is not part of the sandbox. To get a line, ask the Flow team; build on the Telegram sandbox bot in the meantime, with the same code.
TypeScript

1. Get a line

  1. Sign in to the dashboard with GitHub and make a live key (fk_live_...) on the Keys page. See Going live.
  2. Ask the Flow team to connect an iMessage line to your app. iMessage lines are not self-serve: POST /v1/senders with "channel": "imessage" answers 501 not_implemented.
  3. With the live key, GET /v1/senders?channel=imessage lists the line. Its address.link, when set, is the line’s opt-in link: it opens Messages with the line and a prefilled text the person sends to start.
  4. Run the code above, text the line from an iPhone or Mac, and your agent answers.

2. Bubbles fit iMessage

People read iMessage as short lines. reply() uses shorter bubbles here (about 400 characters before it cuts at a sentence end) than on Telegram. See Streaming replies.

3. Tapbacks and effects

  • Reactions become tapbacks. iMessage has a fixed set, so with fallback: "auto" (which react() sets) Flow uses the closest tapback, or skips the reaction and says so in delivered_as.
  • Effects send text with an iMessage effect:
TypeScript
Effects are slam, loud, gentle, invisible_ink, echo, spotlight, balloons, confetti, love, lasers, fireworks and celebration. Which ones a line can send may vary, so keep fallback: "auto" (plain text) on.

4. No buttons: use the fallback

iMessage has no buttons. Send buttons content with fallback: "auto" and Flow sends numbered text instead. When the person answers “2”, you still receive a button_reply with the second button’s id, so your code is the same on every channel.
TypeScript

5. Replies only

iMessage lines are personal-style numbers, and iMessage watches closely for unwanted messages. Flow protects your line:
  • The person writes first. Flow’s iMessage lines are reply-only: starting a conversation with a new contact (POST /v1/messages) is refused with 403 permission. Someone who has written to the line before is an open conversation, and replies to them are not budgeted.
  • Get people to write with the opt-in link. When the line has one, the sender’s address.link opens Messages with the line and a prefilled text the person sends to start. Put it on your site, receipts or a QR code.
  • No cold outreach. Sending the same text to many people, or messages that get no reply, can throttle the line (sender_throttled).
See The send gate.

6. What iMessage supports

Use GET /v1/capabilities?conversation=conv_... for the live answer for a conversation.

7. Contacts

An iMessage contact’s address.handle is a phone number or an email address. Do not assume a phone number. Reply into the conversation the person started rather than addressing them by handle.