TEASEDocs
API ReferencePages & Publish

Mint a preview token (audience simulator)

Returns a short-lived signed token that renders the draft page in the same-origin preview frame, simulating an exact audience: country, device, OS, hour of day, language, one cover-rotation arm, or one exact segment. Open public_url joined with frame_path, carrying the token, to render the simulated page. With no claims a legacy whole-draft token is minted. Owner-only — creator keys cannot mint preview tokens.

Authorization

bearerAuth
AuthorizationBearer <token>

Your al_live_<prefix>_<secret> API key. Mint and manage keys in the dashboard.

In: header

Query Parameters

domain?string

Registered hostname to preview.

Lengthlength <= 255
force_country?string

Simulate a visitor country (ISO 3166-1 alpha-2, upper-case).

Match^[A-Z]{2}$
force_device?string

Simulate the device class.

Value in

  • "mobile"
  • "desktop"
force_os?string

Simulate the OS bucket used by segment/button conditions.

Value in

  • "ios"
  • "android"
  • "windows"
  • "macos"
  • "other"
force_hour?integer

Simulate the hour of day for time conditions (the weekday stays real).

Range0 <= value <= 23
force_lang?string

Simulate a 2-letter visitor language.

Match^[a-z]{2}$
force_bg_arm?string

Pin one cover-rotation arm: 'local' (the domain's own background) or a background-library asset id — previews a rotation/A-B domain cover by cover.

Match^(local|\d{1,18})$
force_segment?string

Render exactly this segment id, skipping the geo classifier — works for any segment, including a countryless default catch-all. The id must exist in the draft snapshot (unknown ids are ignored); a block segment still previews as its 403 page.

Match^[A-Za-z0-9_-]{1,64}$

Response Body

application/json

application/json

GET
/api/admin/preview-token
curl -X GET "https://example.com/api/admin/preview-token"
{  "token": "pv1.eyJ…",  "public_url": "https://links.creator.com",  "frame_path": "/preview-frame/"}
{  "detail": {    "code": "domain_not_found",    "message": "Домен не найден"  }}