Skip to main content
The upsert endpoint creates a new criteria set if the given ID does not exist, or fully replaces an existing one. The id in the request body must match the criteria_set_id in the path.

Endpoint

PUT /v1/discovery/products/criteria-sets/{criteria_set_id}
Requires an x-api-key header for authentication.

Path Parameters

criteria_set_id
string
required
The criteria set identifier to create or replace.

Request Body

Accepts an AffiliateDiscoveryCriteriaSetInput object — the same structure as the Create Criteria Set endpoint. The id field in the body must match the criteria_set_id path parameter.

Example Request

curl -X PUT https://rewardsbot-prod.liquidrewardsapi.com/v1/discovery/products/criteria-sets/summer-sale \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "summer-sale",
    "name": "Summer Sale — Updated",
    "criteria": [
      { "field": "on_sale", "operator": "=", "value": true },
      { "field": "final_price", "operator": "<=", "value": 75.00 }
    ]
  }'

Response

Returns the created or updated AffiliateDiscoveryCriteriaSet with HTTP 200 OK.

Error Responses

StatusDescription
403 ForbiddenMissing or invalid API key.
422 Unprocessable EntityPath and body IDs do not match, or other validation error.
503 Service UnavailableCriteria set storage not configured.