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>"' \
--jsonResponse
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
| Name | Type | Description |
|---|---|---|
propertyId | string (uuid) | A property_id from properties.list. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
feed_scope | string | No | Which feed of the property: a feed id, or all for the property-wide settings. Omitted: the property’s default scope. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
product_segment | object | Yes | Where the supplemental feed writes the product segment. |
product_segment.enabled | boolean | Yes | Whether the feed carries the product segment. |
product_segment.target_custom_label | enum | Yes | The 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_priority | object | Yes | Where the supplemental feed writes the category priority. |
category_priority.enabled | boolean | Yes | Whether the feed carries the category priority. |
category_priority.target_custom_label | enum | Yes | The 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_override | boolean | No | Write to a custom label that already holds product values from your own feed. |
custom_fields | any | No | Extra 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"
}| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A path, query or body value does not match this page. details.issues lists each location, path and message. |
| 401 | invalid_token | The token is missing, expired or revoked: sign in again (productmetrics login). The WWW-Authenticate header says why. |
| 403 | insufficient_scope | The token lacks the write scope (details.required_scope): sign in again and allow it. |
| 404 | not_found | An id in the path does not exist, or the signed-in person cannot open it. |
| 409 | settings_conflict | 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. |
| 429 | rate_limited | More than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry. |