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

Putting it together

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