Skip to content
Settings and rules

Preview segmentation strategy

Shows what draft strategy settings (mostly strategy_adjustments) would do, without saving them: the product and category overviews under the draft, how many products would move between segments compared with the published feed, and Stars that are out of stock.

POST /properties/{propertyId}/settings/strategy-preview

Scope read · Access Read only · Operation id settings.preview_strategy

Try it

productmetrics runs after productmetrics login; curl needs PM_TOKEN (see Authentication). Set $PROPERTY_ID first.

# body.json holds the JSON body from the curl example
productmetrics settings preview-strategy \
  --property-id $PROPERTY_ID \
  --body-file body.json \
  --json

Response

API response (200), shortened:

{
  "data": {
    "product_overview": {
      "summary": [
        { … }
      ],
      "preview": [
        { … }
      ]
    },
    "category_overview": {
      "overview_breakdown": [
        { … }
      ],
      "product_segment_breakdown": [
        { … }
      ]
      // … 1 more field
    }
  },
  "request_id": "req_01JY6BMXN0W01GAB7WDYKVEMGP"
}

CLI output: productmetrics settings preview-strategy --json prints { "ok": true, "data": …, "request_id": "…" } with the same data.

Before you call

Use it instead of settings.preview when the change is to the strategy; save the chosen draft with settings.update.

Path parameters

NameTypeDescription
propertyIdstring (uuid)A property_id from properties.list.

Query parameters

NameTypeRequiredDescription
feed_scopestringNoWhich feed of the property: a feed id, or all for the property-wide settings. Omitted: the property’s default scope.

Body

A draft of Product Segmentation settings, in the shape of labelizer_settings from settings.get. The preview reads category_col (string), min_clicks (number), data_range (as settings.get returns it), strategy_adjustments (object) and excluded_campaign_ids (numeric strings); other fields are ignored and missing ones use the defaults.

Errors

A failure answers with its HTTP status and { error: { code, message, details? }, request_id }. Branch on code (stable, lower_snake); show message to the person. The CLI prints the same error with "ok": false.

{
  "error": {
    "code": "insufficient_scope",
    "message": "This operation needs the read scope; connect again and allow it.",
    "details": {
      "required_scope": "read"
    }
  },
  "request_id": "req_01J1B34WHX58NK2HK55EVZA70D"
}
StatusCodeWhen
400invalid_requestA path, query or body value does not match this page. details.issues lists each location, path and message.
401invalid_tokenThe token is missing, expired or revoked: sign in again (productmetrics login). The WWW-Authenticate header says why.
403insufficient_scopeThe token lacks the read scope (details.required_scope): sign in again and allow it.
404not_foundAn id in the path does not exist, or the signed-in person cannot open it.
429rate_limitedMore than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry.

All Settings and rules operations