Phone Verification Flow
Why this exists
Section titled “Why this exists”POST /v1/send is blocked until a linked user has phone_verification_status = verified.
- Verification session starts automatically after
/start <token>or manually viaPOST /v1/phone-verification/start. - Gateway sends Telegram keyboard button with
request_contact: true. - User shares contact.
- Gateway validates self-contact (
contact.user_id == from.id). - Phone is normalized, hashed with pepper, encrypted with AES-GCM, and persisted.
- Status transitions to
verified, session KV key is deleted.
Status values
Section titled “Status values”unverified: no valid verification.pending: verification requested and awaiting contact-share.verified: verification complete.
Tenant uniqueness rule
Section titled “Tenant uniqueness rule”Within one developer_id, a phone hash can only map to one app_user_id.