A demo app showing how to use Twilio Lookup and Verify to gate user onboarding with phone intelligence checks.
flowchart LR
A([User submits signup form]) --> D{Line type any of landline / nonFixedVoIP / tollFree / pager}
D -- Yes --> R3[❌ Rejected]
D -- No --> F{Status = inactive<br/>or unreachable?}
F -- Yes --> R5[❌ Rejected]
F -- No --> I{Identity Match first & last name<br/>= exact_match or high_partial_match?}
I -- No --> R8[❌ Rejected]
I -- Yes --> J[Send OTP via Verify]
J --> K([User submits OTP code])
K --> N{status = approved?}
N -- No --> R12[❌ Rejected]
N -- Yes --> Z([✅ Approved])
-
Clone the repo and create a virtual environment:
python -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Copy
.env.exampleto.envand fill in your credentials:cp .env.example .env
-
Run the app:
python app.py
Open http://localhost:3000.
| Variable | Description |
|---|---|
TWILIO_ACCOUNT_SID |
Your Twilio Account SID |
TWILIO_AUTH_TOKEN |
Your Twilio Auth Token |
VERIFY_SERVICE_SID |
A Twilio Verify Service SID (VA...) |