Skip to content
Settings and rules

Save feed source settings

Saves which custom labels the supplemental feed writes the product segment and category priority to, and the custom fields.

PUT /properties/{propertyId}/feed/source-settings

Scope write · Access Changes data · Operation id feed_source_settings.update

Try it

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

productmetrics feed-source-settings update \
  --property-id $PROPERTY_ID \
  --product-segment '{"enabled":true,"target_custom_label":"custom_label_0"}' \
  --category-priority '{"enabled":true,"target_custom_label":"custom_label_0"}' \
  --if-match '"<settings_version>"' \
  --json

Response

API response (200):

{
  "data": {
    "product_segment": {
      "enabled": true,
      "target_custom_label": "custom_label_0"
    },
    "category_priority": {
      "enabled": true,
      "target_custom_label": "custom_label_0"
    },
    "force_override": true,
    "custom_fields": "custom_label_0",
    "preview": true,
    "configured": true,
    "settings_version": 1
  },
  "request_id": "req_01J36FGFJJ4B3K14DZ1TT43QTX"
}

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

Before you call

Read them with feed_source_settings.get first and send its settings_version as If-Match: "<settings_version>" (leave the header out only when it is null); a 409 settings_conflict means someone else saved in between: read again and retry. A label already holding product values is refused unless force_override is true. The change reaches the feed at the nightly run, or now with feed.generate. Needs an editor or admin and Product Segmentation subscription.

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

NameTypeRequiredDescription
product_segmentobjectYesWhere the supplemental feed writes the product segment.
product_segment.enabledbooleanYesWhether the feed carries the product segment.
product_segment.target_custom_labelenumYesThe custom label that carries it, for example custom_label_0. One of custom_label_0, custom_label_1, custom_label_2, custom_label_3, custom_label_4.
category_priorityobjectYesWhere the supplemental feed writes the category priority.
category_priority.enabledbooleanYesWhether the feed carries the category priority.
category_priority.target_custom_labelenumYesThe custom label that carries it, for example custom_label_1. One of custom_label_0, custom_label_1, custom_label_2, custom_label_3, custom_label_4.
force_overridebooleanNoWrite to a custom label that already holds product values from your own feed.
custom_fieldsanyNoExtra feed columns, as feed_source_settings.get returns them.

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 write scope; connect again and allow it.",
    "details": {
      "required_scope": "write"
    }
  },
  "request_id": "req_01JE744WDPZ3Q023AZSGXR5EYK"
}
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 write 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.
409settings_conflictRead them with feed_source_settings.get first and send its settings_version as If-Match: "<settings_version>" (leave the header out only when it is null); a 409 settings_conflict means someone else saved in between: read again and retry.
429rate_limitedMore than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry.

All Settings and rules operations