Set page types
Sets one type on up to 50 pages that detection left untyped (`unknown`, or no type) or that a member typed, or clears a type a member set with `pageType: null` (the page returns to no type when it is still Not read, and to `unknown` otherwise, a failed read included, as a failed first read leaves it). A page a read typed is skipped as `detected_type`, a page waiting to be read or being read as `reading`, a page whose type no member set (on a clear) as `not_member_typed`, and an id that is not a page of this site as `not_found`. A member's type has the source `member` and the confidence `likely`: it is the weakest evidence, so a later read that finds evidence replaces it, and a read that decides nothing keeps it. A type the storefront declares (`customData.pageType`) still wins, and shoppers see a change within about 15 minutes. No read and no generation starts: `withStarters` counts the changed pages that have starter questions, to generate again with `POST /sites/{siteId}/pages/generate` if needed.
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
pageIds*array<string>Up to 50 page ids (prefixed spg_).
1 <= items <= 50pageType*|The type for every page, or null to clear a type a member set.
"product""category""content""blog""home"nullThe pages whose type changed, and the ones left as they were.
application/json- response
data*curl -X POST 'https://example.com/api/v1/sites/string/pages/type' \ -H 'Content-Type: application/json' \ -d '{ "pageIds": [ "spg_01kvnwmagvf27rc9cze5rm9e1r" ], "pageType": "category"}'{ "data": { "changed": [ "spg_01kvnwmagvf27rc9cze5rm9e1r" ], "skipped": [ { "pageId": "spg_01kvnwmagwf27rc9d7zef4qksf", "reason": "detected_type" } ], "withStarters": 0, "withStartersIds": [] }}List a site's most viewed pages over the last 30 days
Returns the pages of the site with a view in the last 30 UTC days, most viewed first, at most 50. These are the figures of the Page views tab of the Engagement report and of the Views column of the Pages list. Views are counted on the host and the path, without the query string, so pages whose addresses differ only by their query string share one figure. A page on a market subdomain of the site's main host is counted apart from the same path on the main host. Each host and path is listed once, under the address of one of its pages (usually the one with no query string, when the site holds it). Pages with no view in the window are left out, and there is no paging, cursor or filter. The figures are computed once a day, so `meta.computedAt` says when they were last computed (`null` before the first computation). `meta.countingOn` is `false` while page-view counting is off for the site: `data` is then empty, and that is not the same as no page being viewed. Switch counting on under Settings, Site access.
List a site's starter questions
Returns the site's library in its own order, each question with the state and the 14-day performance the dashboard shows. The totals by state and by source count the whole library whatever the filters, and `meta.matching` counts the questions the filters leave. To see what a shopper is offered on a page, send `appliesToPath` and `appliesToLanguage` (and `appliesToPageType` when the page declares one). The list then holds the switched-on questions that match the page's targeting and have text in that language, in display order, at most three as on the storefront. A page that declares no type is offered the questions that target page types, as on the storefront. Filters combine with AND. `limit` is 1 to 100 (50 by default), and a cursor is bound to the filters and the sort it was issued for.