Skip to main content
Surge’s verification API sends a six-digit code to a phone number and then checks the code the user provides. It handles code generation, delivery, retry limits, and expiration. You don’t manage any of that yourself. But the biggest benefit to using Surge Verifications is that codes are sent through our registered numbers, so you don’t need to register a campaign, toll-free number, or sender ID to be able to send verification codes.

How it works

Verification is a two-step flow:
  1. Create a verification: Surge sends a six-digit code to the number
  2. Check the code: Surge validates the code the user entered

1. Send the code

The user receives a text like: “Your verification code is 847291. It expires in 10 minutes.”

2. Check the code

When the user submits the code in your UI, send it to Surge for verification:
The response includes a result field indicating whether the verification succeeded:

Limits

  • Expiration: 10 minutes from creation. After that, the verification moves to expired status and all check attempts return expired.
  • Max attempts: 3 incorrect guesses per verification. After 3 incorrect attempts, the verification moves to exhausted status. Create a new verification and prompt the user to resend the code.

Result values

Look up a verification in the dashboard

To see what happened to a code, open Verifications in the account’s navigation in the dashboard at hq.surge.app. The list shows each verification for the account with its status: Pending, Verified, Expired, or Attempt limit (the exhausted status). Filter by status, or search by the full phone number including its country code or by the verification ID from the API response. Select a verification to open its details:
  • SMS delivery: when Surge sent the code, its delivery status, and the failure reason if delivery failed
  • Code attempts: the outcome and time of each code check, out of the 3 allowed
  • The carrier for US numbers, or the country for other numbers

Putting it together

A complete flow in Python:
For deliverability quirks and edge cases, see Usage patterns.