session_token string and lives for a maximum of 10 minutes. Your app uses this token to open Telegram, poll for the result, and ultimately retrieve the signed proof that confirms the user’s identity.
Session lifecycle
Created
Your server (or frontend, for public-access projects) calls
POST /api/v1/generate/public with your project_id. Bondify creates a new session and returns a session_token and a Telegram deeplink.Pending
Your app opens the deeplink, which launches Telegram and directs the user to the Bondify bot. The bot presents a confirmation message. The session status is
pending while you wait.Terminal
The session reaches one of three terminal outcomes:
- The user taps ✅ Confirm → status becomes
confirmed - The user taps ❌ Cancel → status becomes
cancelled - 10 minutes elapse with no action → status becomes
expired
confirmed and the proof is consumed by a verifyProof() call, the status moves to used.Session statuses
| Status | Description | What to do next |
|---|---|---|
pending | Waiting for user action in Telegram | Continue polling every 2 seconds |
confirmed | User tapped ✅ Confirm | Stop polling, verify the proof, create your app session |
cancelled | User tapped ❌ Cancel | Stop polling, show “You declined the request” |
expired | 10-minute timeout reached | Stop polling, offer the user a chance to try again |
used | Proof already consumed by verifyProof() | Stop polling, generate a new session for the next attempt |
Polling guidance
PollPOST /api/v1/verify/public every 2 seconds, passing the session_token. Stop polling as soon as you receive any terminal status (confirmed, cancelled, expired, or used).
Sessions are single-use. Once a session reaches
confirmed and you call verifyProof(), Bondify marks it as used. Any subsequent poll will return { "status": "used" }. Always generate a fresh session for each new login attempt.The Session object
When you poll and the status isconfirmed, the response includes the full session data:
| Field | Type | Description |
|---|---|---|
id | string | Unique session identifier |
project_id | string | The project this session belongs to |
project_name | string | The display name of the project that owns this session |
telegram_id | string | The user’s Telegram account ID — only populated on confirmed |
telegram_name | string | The user’s Telegram display name — only populated on confirmed |
telegram_username | string | The user’s @handle — only populated on confirmed; empty string if the user has no username |
status | string | Current status: pending, confirmed, cancelled, expired, or used |
created_at | string | ISO 8601 timestamp of session creation |
confirmed_at | string | null | ISO 8601 timestamp of confirmation; null until the user confirms |
Next steps
Authentication Flow
See the complete end-to-end flow — from session creation through proof verification.
Security
Learn how Bondify’s signed proofs prevent fake and replayed auth events.