Pair an iPhone (Apple Shortcut)
This sets up your iPhone to forward incoming SMS into OTPBase automatically. You pair the phone once to get a device token, then build a one-action Shortcut that posts each message to the ingest endpoint.
Pair the phone
Pairing exchanges a short code for a long-lived device token (dvt_) that your phone uses to push codes in.
-
Sign in and open
/devices, then click Pair new device. You get an 8-character code (characters A–Z and 2–9 only), valid for 5 minutes. -
Your phone POSTs that code to the pairing endpoint (no auth):
POST https://otpbase.com/api/mobile/pair Content-Type: application/json {"code": "<8-char code>", "name": "iPhone"}The response includes a one-time
device_tokenlikedvt_.... Save it — you will not see it again. -
Your phone then POSTs each incoming SMS to the ingest endpoint, authenticated with that token:
POST https://otpbase.com/api/mobile/ingest Authorization: Bearer dvt_... Content-Type: application/json {"sender": "GitHub", "body": "Your code is 123456", "received_at": "2026-06-23T12:00:00Z"}received_atis optional. A successful ingest returns202 Accepted. -
The code appears on
/codeswithin a few seconds.
Build the Shortcut
You only need one action.
- Open the Shortcuts app and create a new shortcut.
- Add a Get Contents of URL action and configure it:
- URL:
https://otpbase.com/api/mobile/ingest - Method:
POST - Headers: add
Authorizationwith valueBearer dvt_...(paste the token from pairing) - Request Body:
JSON, with two fields:sender→ the message sender (Shortcut Input / sender)body→ the message text (Shortcut Input / content)
- URL:
The body the Shortcut sends should look like the ingest example above.
Wire up the SMS automation
The Shortcut runs by hand until you attach it to an automation.
- In Shortcuts, go to the Automation tab and tap +.
- Choose When I get a Message (or Message as the trigger).
- Set it to run your shortcut and pass the message through.
- Turn Ask Before Running off so it fires silently on every SMS.
Send a test
Have a service send you a code, or text yourself one. Within a few seconds it should appear on /codes. If it does not, check the table below.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
401 Unauthorized |
Wrong or blank token | Re-check the Authorization header reads Bearer dvt_... with the exact token from pairing |
Nothing on /codes |
Automation is asking before running, or wrong URL | Turn off Ask Before Running; confirm the URL is https://otpbase.com/api/mobile/ingest |
| Code not parsed | Partial message text | Send the full SMS body, not just a fragment — the parser needs the surrounding text |