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.
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).
siteId*stringThe site id (prefixed site_). A site id that isn't yours is a 404, same as any other cross-tenant id.
application/json- body
enabled*booleantrue to publish the hosted page, false to take it down. Taking it down keeps the site's key, so the same link works again once switched back on.
The site, with its hosted page.
application/json- response
data*curl -X PUT 'https://example.com/api/v1/sites/string/hosted-page' \ -H 'Content-Type: application/json' \ -d '{ "enabled": true}'{ "data": { "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" }}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.
Get a site's setup tasks
Returns the setup tasks of a site and whether each is done: the agent answers on the site (`agent_answers`), a widget is live (`widget_live`), the tag was seen in the last 7 days (`tag_seen`), a catalog is connected or products were imported (`catalog`), a page was read (`page_read`), the site description is filled in (`description`), and a brand color or a logo is set (`brand`). Derived at each call, so a change shows at once. `total` is the length of `tasks`: new tasks may be added later, so read the list rather than assuming seven. Read-only, open to any key of the organization.