Skip to Content
iAdvizeDocs

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.

POST
/api/v1/sites/provision

Authorization

ApiKeyAuth
headerAuthorizationBearer <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).

Request Body

application/json
  1. body
url*string

The storefront address, such as shop.example.com or https://shop.example.com. One address per call.

Length1 <= length <= 2048
publish?boolean

Also switch the hosted page on once the agent is live, and return its link. false when absent.

Response Body

The organization already had a site and an agent on this address: nothing was created.

application/json
  1. response
data*
Example Request
curl -X POST 'https://example.com/api/v1/sites/provision' \  -H 'Content-Type: application/json' \  -d '{  "url": "https://demo-storefront.example.com",  "publish": true}'
Example Response
{  "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"  }}