Set a site up from its storefront address
Sets a site up from one storefront address, as the dashboard's site step does: the store is read, its name, platform, language and market domains detected, its Shopify catalog connected when the store runs on Shopify, and an agent created and put live. The site analysis and the sitemap import then run in the background: follow the analysis with `analysisState` on `GET /api/v1/sites/{siteId}`. Nobody is emailed when it ends. An address the organization already has a site and an agent on returns that site with `200`, creates nothing, and puts that agent live if no agent answers on the site. With `publish`, the hosted page is also switched on and its link returned. The call can take close to a minute. Needs the terms of service accepted in the dashboard. Every object it creates is attributed to the API key in the audit log.
ApiKeyAuthAuthorizationBearer <token>A WorkOS org-scoped API key, created from the dashboard's organization settings page. Identifies the tenant every read and write is scoped to. Missing, malformed, unknown, revoked, expired, or non-organization-owned keys all return 401 (no distinction, so the response can't be used to probe which keys or org ids exist).
application/json- body
url*stringThe storefront address, such as shop.example.com or https://shop.example.com. One address per call.
1 <= length <= 2048publish?booleanAlso switch the hosted page on once the agent is live, and return its link. false when absent.
The organization already had a site and an agent on this address: nothing was created.
application/json- response
data*curl -X POST 'https://example.com/api/v1/sites/provision' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://demo-storefront.example.com", "publish": true}'{ "data": { "status": "provisioned", "site": { "font": "string", "customFont": { "name": "string", "files": [ { "id": "string", "weight": 0, "style": "normal", "format": "woff2", "byteSize": 0, "sourceUrl": "string", "url": "string" } ] }, "widgetsUseBrandFont": true, "resumeButton": { "position": "left", "offsetBottom": 0, "offsetSide": 0, "offsetBottomNarrow": 0, "offsetSideNarrow": 0, "zIndex": 0, "zIndexNarrow": 0, "colors": { "background": "string", "icon": "string", "border": "string" }, "icon": "sparkle", "size": "sm", "radius": "none", "shadow": "none" }, "id": "string", "name": "string", "platform": "shopify", "url": "string", "siteInformation": "string", "toneOfVoice": "string", "vertical": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "autoGenerateStarters": true, "startersSelfImprovementEnabled": true, "pageViewCountingEnabled": true, "storefrontCartCountingEnabled": true, "storefrontOrderCountingEnabled": true, "orderAttributionWindowHours": 1, "displayedPrice": { "mode": "auto", "inEffect": true, "differsAt": "2019-08-24T14:15:22Z" }, "autoReadPages": true, "autoReadMinViews": 0, "readVariantPages": true, "tagMonitoringEnabled": true, "webTagEnabled": true, "panelColors": { "panel": { "background": "string" }, "actions": { "fill": "string", "text": "string", "hover": "string", "border": "string" }, "visitor": { "fill": "string", "text": "string" }, "highlights": { "fill": "string", "text": "string" }, "assistant": { "text": "string" }, "links": { "color": "string" }, "suggestions": { "fill": "string", "text": "string", "border": "string", "hover": "string" }, "secondary": { "fill": "string", "text": "string", "border": "string", "hover": "string" } }, "panelCorners": { "visitor": "full", "suggestions": "full" }, "panelPosition": "left", "panelBackdrop": true, "panelCloseOnOutsideClick": true, "panelZIndex": 2147483000, "panelZIndexNarrow": 2147483000, "hostedPage": { "enabled": true, "link": "string" }, "defaultAgentId": "string", "analysisState": "running" }, "agentId": "string", "catalogConnector": true, "catalogProducts": true, "publication": "published" }}Get a site's storefront activity
Returns when the site last received an add-to-cart and an order from its storefront as server receive times. Each time is `null` until the first one arrives. A time that stops moving points to a channel that stopped sending. Answers for any site, whatever its platform or connectors. Read-only; the counts are in the add-to-cart counts and the Sales report.
Switch a site's hosted page on or off
Publishes or takes down the site's hosted page (the AI Storefront), with the rules of the dashboard. Switching on needs a default agent that is live. Taking the page down keeps the site's key, so the same link works again once switched back on. Attributed to the API key in the audit log.