Storefront
Answers the page's current published display, or its draft when a valid
?preview= token for the page is presented.
publishableKeyX-Sorai-Key<token>A store's publishable key, spk_….
id*stringuuidpreview?stringA signed, 1h draft preview token for this page.
preview_run?stringWith a valid preview token, shows the latest in-progress draft of
this AI run instead of the saved draft. Without one, or when the run has
nothing to show, the saved draft is returned as usual.
uuidpreview_display?stringWith a valid preview token, shows this version of the page instead
of the draft. Returns 404 when the version belongs to another page. Ignored
without a preview token, when preview_run is also sent, or when the value
is not a version ID.
uuidThe display.
application/jsonbody is present for mode=blocks; html/css/js for mode=html.
id*stringuuidpage_id*stringuuidversion*integermode*string"blocks""html"schema_version*integerbody?A PageDocument (mode=blocks): the page's block tree.
html?stringcss?stringjs?stringcurl -X GET 'https://api.sorai.ai/v1/public/pages/497f6eca-6276-4993-bfeb-53cbbbba6f08/display'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "page_id": "ef107761-0142-48fe-9dcd-5140d1ae58db", "version": 0, "mode": "blocks", "schema_version": 0, "body": { "schemaVersion": 1, "theme": { "colors": { "property1": "string", "property2": "string" }, "fontFamily": "string", "bodyFontFamily": "string", "headingWeight": "regular", "headingCase": "sentence", "headingTracking": "tight", "scale": "compact", "radius": "string", "blocks": { "paddingY": "none", "heroLayout": "split", "band": "tint" } }, "blocks": [ { "id": "string", "type": "hero", "props": { "layout": "split", "eyebrow": "string", "title": "string", "subtitle": "string", "primaryCta": { "label": "string", "action": { "kind": "checkout", "productId": "string", "priceId": "string" } }, "secondaryCta": { "label": "string", "action": { "kind": "checkout", "productId": "string", "priceId": "string" } }, "media": { "mediaId": "string", "alt": "string", "crop": { "x": 0, "y": 0 } }, "overlay": 0, "overlayColor": "string" }, "style": { "width": "container", "paddingY": "none", "background": "string", "textColor": "string", "align": "left", "shape": "flat" } } ] }, "html": "string", "css": "string", "js": "string"}