POST /api/v1/generate/public and open the deeplink in the user’s Telegram app, call this endpoint repeatedly to check whether the user has acted on the prompt. The endpoint is safe to call from a browser or mobile app — no Bearer token is required. Poll every 2 seconds and stop as soon as you receive a terminal status: confirmed, cancelled, expired, or used.
Endpoint
Authorization header is required.
Request body
Your Bondify project ID — the same value you passed to
generate/public.The
session_token returned by POST /api/v1/generate/public.Example request
Response by status
The shape of the response depends on the value ofstatus.
pending
The user has not yet interacted with the Telegram prompt. Keep polling.
confirmed
The user tapped Confirm in Telegram. Stop polling and log the user in. Always verify the proof JWT on your server using your project’s secret key before creating a session.
cancelled
The user tapped Cancel in Telegram. Stop polling and inform the user.
expired
The session was not acted upon within 10 minutes. Stop polling and offer the user a way to try again.
used
The session has already been successfully verified once. Stop polling and generate a fresh session if the user needs to authenticate again.
Response fields
The current state of the session. One of
"pending", "confirmed", "cancelled", "expired", or "used". A session transitions to "used" after it has already been successfully verified once — do not attempt to reuse it.The user’s numeric Telegram ID. Present only when
status is "confirmed".The user’s Telegram display name. Present only when
status is "confirmed".The user’s Telegram @handle, or
null if the user has not set a username. Present only when status is "confirmed".A signed JWT that encodes the user’s Telegram identity. Present only when
status is "confirmed". Verify this token server-side using your project’s secret key before trusting the identity and creating an application session.Polling example
The function below polls every 2 seconds with a 10-minute hard deadline. It returns the confirmed payload on success and throws on any terminal failure:Session status reference
| Status | Meaning | Recommended UI action |
|---|---|---|
pending | Waiting for user action in Telegram | Keep polling, show a loading indicator |
confirmed | User tapped ✅ Confirm | Stop polling, verify the proof, log the user in |
cancelled | User tapped ❌ Cancel | Stop polling, show “You declined the request” |
expired | Session not used within 10 minutes | Stop polling, offer a “Try again” option |
used | Session already consumed | Stop polling, generate a fresh session if needed |