Rules
Create, update, delete, and preview feed transformation rules that modify your product data before it's published.
List rules
/v1/rules Returns all feed transformation rules, ordered by position. Optionally filter by rule type.
Required scope: read_rules
Parameters
| Parameter | Type | Description |
|---|---|---|
rule_type | string | Filter by rule type (optional). |
Request
curl https://app.simpleproductfeeds.com/v1/rules \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Response
{
"data": [
{
"id": "rule_42",
"object": "rule",
"rule_type": "set_value",
"rule": "Set brand to 'My Brand'",
"target_column": "brand",
"condition": "always",
"value": "My Brand",
"active": true,
"position": 1,
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-03-01T14:00:00Z"
},
{
"id": "rule_43",
"object": "rule",
"rule_type": "exclude",
"rule": "Exclude out of stock",
"target_column": null,
"condition": "inventory_quantity equals 0",
"value": null,
"active": true,
"position": 2,
"created_at": "2026-01-15T10:05:00Z",
"updated_at": "2026-03-01T14:00:00Z"
}
]
}
Rule response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier with rule_ prefix. |
object | string | Always "rule". |
rule_type | string | The type of transformation this rule performs. |
rule | string | Human-readable rule description. |
target_column | string | null | The feed column this rule targets, if applicable. |
condition | string | null | The condition that triggers this rule. |
value | any | null | The value used by the rule, if applicable. |
active | boolean | Whether the rule is currently active. |
position | integer | Execution order. Rules run in ascending position order. |
created_at | string | ISO 8601 timestamp when the rule was created. |
updated_at | string | ISO 8601 timestamp when the rule was last updated. |
Errors
| Status | Code | Description |
|---|---|---|
| 422 | no_feed | No feed has been configured for this shop. |
Get a rule
/v1/rules/:id Returns a single rule by ID.
Required scope: read_rules
Request
curl https://app.simpleproductfeeds.com/v1/rules/rule_42 \
-H "Authorization: Bearer spf_live_sk_your_key_here"
The rule_ prefix is optional.
Errors
| Status | Code | Description |
|---|---|---|
| 404 | resource_not_found | No rule found with the given ID. |
Create a rule
/v1/rules Creates a new feed transformation rule.
Required scope: write_rules
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
rule | object | Yes | The rule definition. Structure depends on the rule type. |
Request
curl -X POST https://app.simpleproductfeeds.com/v1/rules \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"rule": {"type": "set_value", "target": "brand", "value": "My Brand"}}'
Response
Returns the created rule object with status 201 Created.
Errors
| Status | Code | Description |
|---|---|---|
| 422 | no_feed | No feed has been configured for this shop. |
| 422 | rule_invalid | The rule definition is invalid. Check the error message for details. |
Update a rule
/v1/rules/:id Updates an existing rule.
Required scope: write_rules
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
rule | object | Yes | The updated rule definition. |
Request
curl -X PATCH https://app.simpleproductfeeds.com/v1/rules/rule_42 \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"rule": {"type": "set_value", "target": "brand", "value": "New Brand Name"}}'
Response
Returns the updated rule object.
Errors
| Status | Code | Description |
|---|---|---|
| 404 | resource_not_found | No rule found with the given ID. |
| 422 | rule_invalid | The rule definition is invalid. |
Delete a rule
/v1/rules/:id Permanently deletes a rule.
Required scope: write_rules
Request
curl -X DELETE https://app.simpleproductfeeds.com/v1/rules/rule_42 \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Returns 204 No Content on success.
Errors
| Status | Code | Description |
|---|---|---|
| 404 | resource_not_found | No rule found with the given ID. |
Activate a rule
/v1/rules/:id/activate Activates a deactivated rule so it runs during feed generation.
Required scope: write_rules
Request
curl -X POST https://app.simpleproductfeeds.com/v1/rules/rule_42/activate \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Response
Returns the updated rule object with active: true.
Deactivate a rule
/v1/rules/:id/deactivate Deactivates a rule without deleting it. Deactivated rules are skipped during feed generation.
Required scope: write_rules
Request
curl -X POST https://app.simpleproductfeeds.com/v1/rules/rule_42/deactivate \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Response
Returns the updated rule object with active: false.
Reorder rules
/v1/rules/reorder Sets the execution order for rules. Rules run in the order specified.
Required scope: write_rules
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
rule_ids | string[] | Yes | Ordered array of rule IDs. |
rule_type | string | No | Rule type to reorder within. |
Request
curl -X POST https://app.simpleproductfeeds.com/v1/rules/reorder \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"rule_ids": ["rule_43", "rule_42"]}'
Response
Returns the reordered list of rules.
Errors
| Status | Code | Description |
|---|---|---|
| 422 | invalid_param | rule_ids must be a non-empty array. |
| 422 | no_feed | No feed has been configured for this shop. |
Preview a rule
/v1/rules/preview Tests a rule definition against a sample of your products without saving it. Returns before/after comparisons for up to 10 products.
Required scope: write_rules
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
rule | object | Yes | The rule definition to preview. |
Request
curl -X POST https://app.simpleproductfeeds.com/v1/rules/preview \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"rule": {"type": "set_value", "target": "brand", "value": "My Brand"}}'
Response
{
"data": {
"results": [
{
"product_title": "Blue T-Shirt - Medium",
"excluded": false,
"changes": [
{
"field": "brand",
"before": "",
"after": "My Brand"
}
]
},
{
"product_title": "Red T-Shirt - Large",
"excluded": false,
"changes": [
{
"field": "brand",
"before": "Old Brand",
"after": "My Brand"
}
]
}
]
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 422 | no_feed | No feed has been configured for this shop. |
| 422 | rule_invalid | The rule definition is invalid. |
| 500 | preview_failed | An error occurred while running the preview. |