Launch
Launch
Generate single-use Mini App launch URL from operator backend.
Path
POST /api/operator/launch
Required scope: launch:write
Request body
{
"external_user_id": "operator-user-123",
"display_name": "Rina",
"locale": "id",
"product": "polyflight",
"metadata": {}
| Field | Type | Requirement | Notes |
|---|---|---|---|
external_user_id | string | Required | Non-empty, stable ID in the operator system. |
display_name | string | Optional | Stored as the latest display-name snapshot. |
locale | string | Optional | Stored as the user's locale preference. Use a Mini App-supported locale such as en, id, es, or zh-CN. |
metadata | object | Optional | Merged into ordinary operator-user metadata. metadata.simulator is ignored and cannot change wallet routing. |
product | opinion or polyflight | Optional | Defaults to opinion. polyflight requires Polyflight to be enabled for the authenticated operator. |
host | string | Optional | Environment-specific launch host. Omit unless the Provider assigned one. |
Optional host
host is the active domain or subdomain allowed for Mini App operations. The allowed value can differ between deployment environments.
Unless your Provider explicitly assigns a host, omit this field. OpenPoly will resolve the active allowed host for the authenticated operator and current environment. Sending a host that is not active and allowed for that operator returns INVALID_OPERATOR_HOST.
Response
{
"product": "polyflight",
"enabled_products": ["opinion", "polyflight"],
"redirect_path": "/polyflight",
"launch_url": "https://your-launch-host/polyflight?token=...",
"expires_at": "2026-06-18T00:01:00.000Z",
"operator_user": {
"id": 1,
"external_user_id": "operator-user-123",
"status": "active"
}
}
The product-aware launch/session contract exposes selected product, operator enabled_products, and validated redirect_path. Polyflight is fixed to /polyflight. Opinion normally uses /; only server-generated legacy portfolio Trade links preserve /markets/{encoded-slug}. Missing, invalid, or absolute redirect metadata falls back to /. Clients must follow the returned path and never construct one from caller-controlled metadata.
Contract rules
- Launch token is single-use.
- Token TTL is runtime-configured, defaults to 60 seconds, and is never shorter than 30 seconds.
external_user_idmust be stable per operator user.- Operator user is upserted on launch request.
- If
hostis provided, it must match an active host configured for the authenticated operator. - Repeated launch calls may issue new launch tokens for same operator user.
- Omitting
productpreserves the existing Opinion launch. - A disabled
polyflightlaunch is rejected; it never falls back to Opinion. - Simulator classification is managed only by dedicated simulator-user APIs and is preserved across launches; never attempt to enable it through launch metadata.
Integration rules
- Call this endpoint only from operator backend.
- Redirect or hand off returned
launch_urlto operator client. - Never generate or inspect launch token on client.
