Rate this page:

Running the Sample App with the sample backend

The TwilioAuth SDK has been deprecated. This means that while we will continue to provide maintenance support for existing customers and their usage, we discourage new customers and new usage, as we may shut it down entirely in the future. We strongly recommend using the Verify Push SDK instead, which currently supports the Push channel, and will be enhanced to support the TOTP channel in the future.

For instructions on how to get the AUTHY_API_KEY please read this tutorial

Step 1: Download the sample app



Step 2: Deploy the sample backend application

We recommend deploying for free with Heroku. You can learn more about how to do that in the Heroku documentation

Download or clone the sample backend here:

Deploy Sample Backend


Setup your AUTHY_API_KEY as a Heroku config variable. You can do this via the CLI or in the Heroku dashboard.

Deploy Sample Backend

Step 4: Obtain the USER_AUTHY_ID

Next, we'll create an Authy user.

curl -XPOST " \
-H "X-Authy-API-Key: d57d919d11e6b221c9bf6f7c882028f9" \
-d user[email]="" \
-d user[cellphone]="317-338-9302" \
-d user[country_code]="54"

Step 5: Configure sample app


Follow the instructions to setup the Sample App. Start the application from XCode and in the simulator you'll be able to enter your USER_AUTHY_ID from step #5 and your sample backend URL from step #2.


In the sample app, enter the USER_AUTHY_ID from step #5 and your sample backend URL from step #2

Step 6: Create an approval request

curl "$USER_AUTHY_ID/approval_requests" \
-H "X-Authy-API-Key: $AUTHY_API_KEY" \
-d message="Login requested for a CapTrade Bank account." \
-d details[username]="Bill Smith" \
-d details[location]="California, USA" \
-d details[Account]="981266321" \
-d hidden_details[transaction_num]="TR139872562346" \
-d seconds_to_expire=1200

More info about creating approval requests

You can also use the sample API scripts available here to create a new approval request.

To check the status of the approval request you can use the sample API script available here. Don't forget to update your environment variables when using the sample API scripts.

Step 7: Sync request to device

If you have configured Twilio to handle the push notification, it will prompt the user to open the app and in turn the SDK will sync the request.

Otherwise, to manually sync the requests to the sample app, refresh the screen. Then, you will be able to Approve or Deny the request in the sample app:

Twilio Auth SDK iOS Push Authentication Request

Step 8: Disabling specific devices from authentication

To delete a specific device you can use the sample API scripts available here

To obtain the :device_id call the getDeviceId method of the sdk


If you find any issues while following this guide please file us an issue in the respective Github project:

Android issues on

iOS issues on

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.


        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more