Verify API

Phone number verification built for developers

  • Request phone verification

    Reduce fraudulent activity by validating that a user account is associated with a real person who has access to a valid phone number.

    View Docs
    • Curl
    • Node
    • .NET (C#)
    # $AUTHY_API_FORMAT is either “xml” or “json”
    # $USER_PHONE example:  5551234567
    # $COUNTRY_CODE example: 1
    # $VERIFY_CODE is the token received via SMS or Voice
    # $VIA is either “sms” or “voice”
    
    curl -X POST "https://api.authy.com/protected/$AUTHY_API_FORMAT/phones/verification/start?via=$VIA&country_code=$USER_COUNTRY&phone_number=$USER_PHONE" \
    -H "X-Authy-API-Key: $AUTHY_API_KEY"
    
    // npm install authy
    var authy = require('authy')('APIKEY');
    
    authy.phones().verification_start('111-111-1111', '1', { via: 'sms', locale: 'en', code_length: '6' }, function(err, res) {
      //
    });
    public static async Task StartPhoneVerificationAsync()
      {
        // Create client
        var client = new HttpClient();
    
        var requestContent = new FormUrlEncodedContent(new[] {
          new KeyValuePair("via", "sms"),
          new KeyValuePair("phone_number", "5558675309"),
          new KeyValuePair("country_code", "1"),
        });
    
        // https://api.authy.com/protected/$AUTHY_API_FORMAT/phones/verification/start?via=$VIA&country_code=$USER_COUNTRY&phone_number=$USER_PHONE
        HttpResponseMessage response = await client.PostAsync(
          "https://api.authy.com/protected/json/phones/verification/start?api_key=" + AuthyAPIKey,
          requestContent);
    
        // Get the response content.
        HttpContent responseContent = response.Content;
    
        // Get the stream of the content.
        using (var reader = new StreamReader(await responseContent.ReadAsStreamAsync()))
          {
            // Write the output.
            Console.WriteLine(await reader.ReadToEndAsync());
          }
        }
  • Verify the phone verification code

    Reduce fraudulent activity by validating that a user account is associated with a real person who has access to a valid phone number.

    View Docs
    • Curl
    • Node
    • .NET (C#)
    # $AUTHY_API_FORMAT is either “xml” or “json”
    # $USER_PHONE example:  5551234567
    # $COUNTRY_CODE example: 1
    # $VERIFY_CODE is the token received via SMS or Voice
    
    curl "https://api.authy.com/protected/$AUTHY_API_FORMAT/phones/verification/check?phone_number=$USER_PHONE&country_code=$USER_COUNTRY&verification_code=$VERIFY_CODE" \
    -H "X-Authy-API-Key: $AUTHY_API_KEY"
    // npm install authy
    var authy = require('authy')('APIKEY');
    
    authy.phones().verification_check('111-111-1111', '1', '0000', function (err, res) {
     //
    });
    public static async Task VerifyPhoneAsync()
      {
        // Create client
        var client = new HttpClient();
    
        // Add authentication header
        client.DefaultRequestHeaders.Add("X-Authy-API-Key", AuthyAPIKey);
    
        // https://api.authy.com/protected/$AUTHY_API_FORMAT/phones/verification/check?phone_number=$USER_PHONE&country_code=$USER_COUNTRY&verification_code=$VERIFY_CODE
        HttpResponseMessage response = await client.GetAsync(
          "https://api.authy.com/protected/json/phones/verification/check?phone_number=5558675309&country_code=1&verification_code=3043");
    
        // Get the response content.
        HttpContent responseContent = response.Content;
    
        // Get the stream of the content.
        using (var reader = new StreamReader(await responseContent.ReadAsStreamAsync()))
          {
            // Write the output.
            Console.WriteLine(await reader.ReadToEndAsync());
          }
        }
The Twilio advantage
  • Communicate reliably

    Experience a 99.95% uptime SLA made possible with automated failover and zero maintenance windows.

  • Operate at scale

    Extend the same app you write once to new markets with configurable features for localization and compliance.

  • Many channels

    Use the same platform you know for voice, SMS, video, chat, two-factor authentication, and more.

  • No shenanigans

    Get to market faster with pay-as-you-go pricing, free support, and the freedom to scale up or down without contracts.