Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Integrating the SDK using the sample backend

For instructions on how to get the AUTHY_API_KEY please check this

1.Install the iOS/Android SDK


  • Add the pod to your Podfile
target 'YourTarget' do
    pod 'TwilioAuth'
  • Run the following command in your terminal
pod install
  • Or download the framework here

In the Build Phases tab of the project editor, click the + button at the top and select “New Run Script Phase”. Enter the following code into the script text field:

bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioAuth.framework/"


  • Add the dependency to your app/build.gradle file
compile 'com.twilio:auth:+'

2.Deploy the sample backend application

Deploy Sample Backend

3.Add AUTHY_API_KEY as a config variable as follows:

Deploy Sample Backend

4.Obtain the USER_AUTHY_ID

curl "" \
-d user[email]="" \
-d user[cellphone]="317-338-9302" \
-d user[country_code]="54"

More info on enabling 2FA

5.In your app obtain the registration token from the sample backend


6.Create an approval request

curl "" \
-d api_key="AUTHY_API_KEY" \
-d message="Your approval request message" 

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.

7.Approve/Deny request

To get more info about what you can do with the SDK: Quick Reference

8.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 inconveniences while following this guide please file us an issue

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 browsing the Twilio tag on Stack Overflow.