# Is There an iPhone SMS API? Getting Texts on iOS

> No, iOS has no public API that lets an app read your texts. Here’s what Apple allows instead, and how to get iPhone SMS into your own code as JSON.

Last updated: 2026-10-23
Canonical HTML page: https://www.fwrdsms.com/blog/iphone-sms-api
Published: 2026-10-16

No, there’s no public iPhone SMS API: iOS doesn’t let an app read your text messages, or even know one arrived. The supported way in is a Message automation you build once in Apple’s Shortcuts app, which hands each matching text to an action. Fwrd is that action for developers: it posts each text from the iPhone to your own HTTPS webhook as JSON.

**What you need:** an iPhone on iOS 26 or later, the Shortcuts app (it’s already on your phone), and an HTTPS endpoint that accepts a JSON POST, such as your own server or a Zapier, Make or n8n webhook.

## Can an iOS app read SMS messages?

No. A third-party iOS app can’t read the Messages inbox, and it isn’t told when a text arrives. Every way to get texts out of an iPhone goes through something the person sets up on purpose.

A [2017 reply on Apple’s Developer Forums](https://developer.apple.com/forums/thread/86268) puts it plainly: an app isn’t allowed to see SMS messages, or even that they arrived. In October 2025, an Apple engineer [said on the forums](https://developer.apple.com/forums/thread/804040) that macOS has no API for a user’s SMS messages either, so a Mac signed in to your Apple Account isn’t a back door.

## What about TelephonyMessagingKit?

TelephonyMessagingKit is real, but it’s only for apps that replace Messages as the default carrier messaging app, and only in the EU. It isn’t a way for an ordinary app to read your texts.

[Apple’s documentation](https://developer.apple.com/documentation/telephonymessagingkit) says the framework handles SMS, MMS and RCS on iPhone, but an app needs a special entitlement, works only once the person picks it as their default carrier messaging app, and the person needs an EU account with the device in the EU. For [texts in a script](https://www.fwrdsms.com/blog/sms-otp-codes-ci-automation-iphone), a database or an AI agent, it isn’t the tool.

## How do apps fill in SMS codes, then?

Through AutoFill, not by reading the message. iOS spots the one-time code in an incoming text and offers it above the keyboard; the app only receives the code when the person taps it.

Apple’s guide to [enabling Password AutoFill on a text input view](https://developer.apple.com/documentation/security/enabling-password-autofill-on-a-text-input-view) lists One-time code as a content type and says you can autocomplete security codes from SMS login flows. In UIKit that’s `textContentType = .oneTimeCode`. For a smoother login in your own app, that’s all you need.

## How do you get iPhone texts into your own code?

Build a Shortcuts Message automation and add Fwrd’s action, which posts each matching text from the iPhone to your endpoint as JSON. Apple’s [Message trigger](https://support.apple.com/guide/shortcuts/communication-triggers-apdd711f9dff/ios) runs when a message arrives from a sender you add, or containing a phrase you add.

These steps use Fwrd’s Webhook destination:

1. **Add a webhook in [Fwrd](https://apps.apple.com/app/apple-store/id6759069713?pt=128544281&ct=blog-sms-api&mt=8).** Open Fwrd, tap +, and choose Webhook. Paste your whole HTTPS address into the Configuration field, tap Send Test Message so your endpoint sees the fields, then save.

2. **Create a Message automation.** On iOS 27, open Shortcuts, tap Library, then Automation, then +. If you see Describe a shortcut, tap Edit. Tap Automation, then Message. On iOS 26, open the Automation tab, tap +, and choose Message.

3. **Choose which texts to send.** Choose Message Contains (on iOS 27, change Sender to Message), then type a word your texts contain, such as code. Or type a single space to send any text with one.

4. **Make it run without asking.** On iOS 27, tap the arrow beside the trigger and check that Confirm Before Run is off. Under ⓘ, then Privacy, check that Allow Running When Locked is on. On iOS 26, choose Run Immediately, then tap Next and Create New Shortcut.

5. **Add Fwrd’s action.** Search for Forward and add Fwrd’s Forward Message to All Destinations. Tap its Message field and choose Shortcut Input (on iOS 26, Shortcut Input, then Message). Tap back to save (Done on iOS 26).

6. **That’s it.** New texts that contain your word now reach your endpoint on their own, with the iPhone unlocked or locked.

### What does the JSON look like?

Fwrd sends each text to your webhook as a POST with `Content-Type: application/json`. By default the body holds the message exactly as it arrived, twice, because Mattermost and Rocket.Chat read `text`:

```json
{
  "content": "Your code is 482913",
  "text": "Your code is 482913"
}
```

There’s no timestamp. If you turn on Include Who Sent It in Fwrd’s Settings and choose Sender on Fwrd’s action in Shortcuts, the body also gets a `sender` field. Every attempt for the same text carries the same `Idempotency-Key` header, so you can drop repeats. Any 2xx answer within 15 seconds counts as delivered, and redirects are refused. The [webhook guide](https://www.fwrdsms.com/guides/webhook) covers the endpoint side in full.

## Your options, side by side

| Approach | Reads incoming texts? | Who can use it |
|---|---|---|
| A public SMS API | Doesn’t exist on iOS | Nobody |
| TelephonyMessagingKit | Yes, as the default messaging app | Carrier messaging apps, EU only |
| Password AutoFill | Only the code, when the person taps it | Any app’s login field |
| Shortcuts + Fwrd | Yes, texts matching your automation | Anyone on iOS 26 or later |

Fwrd does the plumbing for you:

- **No account.** Fwrd has no sign-in and no Fwrd server; each text goes from your iPhone straight to your URL.
- **Filters.** Each webhook can keep only texts with words you choose, texts that look like a verification code, or texts at certain hours.
- **Retries and secrets handled.** If a send times out, hits a 429 or 5xx, or loses its connection, Fwrd tries again, up to twice, and keeps your URL in the iPhone’s Keychain, not inside a shortcut.
- **Eight destinations.** The same action also covers Email, another phone or iMessage, WhatsApp, Discord, Slack, Microsoft Teams and Telegram.

## What an iPhone can’t do as an SMS gateway

An iPhone can’t act as an SMS gateway for your server. iOS has no API that lets a server send a text through it, so Fwrd is receive-only: texts come in on the iPhone and go out to your endpoint.

- **Sending from an API.** The gateway apps that send SMS from an API run on Android; [textbee.dev](https://textbee.dev) says in its FAQ that it currently works only on Android devices (checked 2026-10-16).
- **A rule is required.** The automation acts on texts with a word you pick, or from people in your Contacts. A single space catches any text with a space in it.
- **The phone stays on and online.** The iPhone that gets the texts must be on, with Wi-Fi or mobile data, when they arrive. After a restart, forwarding waits until you unlock it once.
- **Text only.** Pictures don’t come through, and replies still come from the iPhone itself.

## Questions people ask next

### Can I read old texts already on my iPhone?

No. The Message automation only runs for new texts that arrive after you set it up.

### Does it work with Zapier, Make or n8n?

Yes. Paste a Zapier catch hook, a Make custom webhook or an n8n Webhook node’s production URL into Fwrd’s Webhook destination, and each matching text starts your workflow. [Send iPhone texts to Zapier, Make or n8n](https://www.fwrdsms.com/iphone-sms-to-zapier-make-n8n) has the steps for each one.

### Do iMessages count?

Yes. The Message automation runs for messages that arrive in the Messages app, iMessages included, so a matching iMessage reaches your webhook the same way an SMS does.

### What does it cost?

Fwrd is free for 15 forwards a month, and a text counts once however many places it goes. Fwrd Pro removes the limit for $4.99 a month or $29.99 a year in the US.

## Keep reading

- [Forward iPhone SMS to a webhook](https://www.fwrdsms.com/iphone-sms-to-webhook)
- [How iPhone Shortcuts message automations work](https://www.fwrdsms.com/blog/iphone-shortcuts-message-automation)
