Integration Flow
Launch session model
Launch token redemption and session establishment.
Launch session model
Launch is server-to-server first, browser second.
Launch flow
- operator backend calls
POST /api/operator/launch - OpenPoly resolves the allowed host and verifies the selected product is enabled (
opinionwhen omitted) - OpenPoly upserts the operator user by
external_user_id - OpenPoly creates the host-bound launch token hash and expiry
- OpenPoly returns
launch_url - operator redirects user to
launch_url - Mini App redeems token and establishes session
- browser URL drops one-time token after redemption
Token properties
- default TTL:
60seconds - minimum TTL:
30seconds - single-use
- stored hash-only
- repeated launch calls can mint new token for same operator user
- redemption atomically claims the token and creates one session; concurrent requests cannot create multiple sessions from one token
- an expired or already-used token returns
401 INVALID_LAUNCH_TOKEN, including when it expires or is consumed after the initial lookup - if session creation fails, the token claim rolls back; unexpected database failures remain server errors
- after a rejected redemption, request a fresh launch URL from the operator backend rather than replaying the same token
Host binding
Launch host must match operator-allowed host resolution.
Inputs:
- requested
hostfrom launch API body, if provided - operator host mapping
- environment fallback host
Result:
- launch URL points to allowed host only
- wrong-host token usage must fail
- a requested host must be an active domain registered for this operator; without one, the default active domain is preferred before the environment fallback
Session semantics
After token redemption:
- browser gets Mini App session cookie
- browser gets CSRF cookie
- operator backend is no longer in request path for ordinary in-app navigation
- product enablement is rechecked during redemption; a previously minted URL does not bypass a product disable
Session is for Mini App client. Operator API key stays server-side only.
Operator user model
external_user_idunique per operator- user is upserted on launch
- simultaneous launches for the same operator and
external_user_idreuse one linked user; identity creation is serialized before the first lookup - display name and locale can be snapshotted
- metadata can be attached from operator backend
- caller metadata cannot turn a normal user into a simulator user; simulator routing is provisioned through staging tools
Operator responsibilities
- create launch from trusted backend only
- never mint launch from browser
- use stable
external_user_id - keep redirect flow short enough that token does not expire
