OTPBase

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.

  1. 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.

  2. 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_token like dvt_.... Save it — you will not see it again.

  3. 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_at is optional. A successful ingest returns 202 Accepted.

  4. The code appears on /codes within a few seconds.

Build the Shortcut

You only need one action.

  1. Open the Shortcuts app and create a new shortcut.
  2. Add a Get Contents of URL action and configure it:
    • URL: https://otpbase.com/api/mobile/ingest
    • Method: POST
    • Headers: add Authorization with value Bearer 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)

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.

  1. In Shortcuts, go to the Automation tab and tap +.
  2. Choose When I get a Message (or Message as the trigger).
  3. Set it to run your shortcut and pass the message through.
  4. 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
هل أجاب هذا عن سؤالك؟ مراسلة الدعم