Rules

Create, update, delete, and preview feed transformation rules that modify your product data before it's published.

List rules

GET /v1/rules

Returns all feed transformation rules, ordered by position. Optionally filter by rule type.

Required scope: read_rules

Parameters

ParameterTypeDescription
rule_typestringFilter 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

FieldTypeDescription
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

StatusCodeDescription
422no_feedNo feed has been configured for this shop.

Get a rule

GET /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

StatusCodeDescription
404resource_not_foundNo rule found with the given ID.

Create a rule

POST /v1/rules

Creates a new feed transformation rule.

Required scope: write_rules

Parameters

ParameterTypeRequiredDescription
ruleobjectYesThe 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

StatusCodeDescription
422no_feedNo feed has been configured for this shop.
422rule_invalidThe rule definition is invalid. Check the error message for details.

Update a rule

PATCH /v1/rules/:id

Updates an existing rule.

Required scope: write_rules

Parameters

ParameterTypeRequiredDescription
ruleobjectYesThe 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

StatusCodeDescription
404resource_not_foundNo rule found with the given ID.
422rule_invalidThe rule definition is invalid.

Delete a rule

DELETE /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

StatusCodeDescription
404resource_not_foundNo rule found with the given ID.

Activate a rule

POST /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

POST /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

POST /v1/rules/reorder

Sets the execution order for rules. Rules run in the order specified.

Required scope: write_rules

Parameters

ParameterTypeRequiredDescription
rule_idsstring[]YesOrdered array of rule IDs.
rule_typestringNoRule 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

StatusCodeDescription
422invalid_paramrule_ids must be a non-empty array.
422no_feedNo feed has been configured for this shop.

Preview a rule

POST /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

ParameterTypeRequiredDescription
ruleobjectYesThe 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

StatusCodeDescription
422no_feedNo feed has been configured for this shop.
422rule_invalidThe rule definition is invalid.
500preview_failedAn error occurred while running the preview.