---
title: 'Update Loyalty Rule Chain'
description: 'Update a loyalty rule chain'
openapi: POST /api/loyalty/rule_chains/{loyaltyRuleChainId}
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://docs.snagsolutions.io/llms.txt). Append `.md` to any page URL for its markdown version.

`POST /api/loyalty/rule_chains/{loyaltyRuleChainId}` — path parameters: `loyaltyRuleChainId`; query parameters: `organizationId`, `websiteId`

`POST https://admin.snagsolutions.io/api/loyalty/rule_chains/{loyaltyRuleChainId}`

Update a loyalty rule chain

## Authentication

- `apiKeyAuth` — apiKey in header: `X-API-KEY`

## Path parameters

- `loyaltyRuleChainId` (string, required)

## Query parameters

- `organizationId` (string, required)
- `websiteId` (string, required)

## Request body

- Content type: `application/json`
  - request body (object)
    - `name` (string, required)
    - `loyaltyRuleId` (string, uuid, required) — Unique identifier for the loyalty rule
    - `operatorType` (string, one of: AND, OR, default: "AND") — Type of the condition. AND if all conditions must be met, OR if any condition can be met.
    - `loyaltyConditions` (array, required) — Array of conditions for the rule chain
      - `items` (object)
        - `type` (string, one of: rule, rules, points, badge, badges) — The type of rule
        - `description` (string) — The description of the rule
        - `amount` (number) — The amount of the rule
        - `repeatCount` (number) — The number of times the rule should be repeated to fulfill the condition
        - `requiredCount` (number) — The number of rules that need to be fulfilled to satisfy the condition
        - `loyaltyRuleChainId` (string, uuid) — UUID of the loyalty rule chain (optional, converted to lowercase)
        - `loyaltyRuleIds` (array) — Array of UUIDs of the rules (optional, converted to lowercase)
          - `items` (string, uuid)
        - `loyaltyRuleGroupIds` (array) — Array of UUIDs of the rule group (optional, converted to lowercase)
          - `items` (string, uuid)
        - `loyaltyLeaderboardViewIds` (array) — Array of UUIDs of the Loyalty Leaderboard (optional, converted to lowercase)
          - `items` (string, uuid)
        - `loyaltyCurrencyIds` (array) — Array of UUIDs of the currency (optional, converted to lowercase)
          - `items` (string, uuid)
        - `loyaltyBadgeIds` (array) — Array of UUIDs of the badge (optional, converted to lowercase)
          - `items` (string, uuid)
        - `csvUrl` (string, uri) — URL of the CSV file (optional)

## Response 200

200
  - response (object)
    - `data` (object, required)

## Response 403

403
  - response (object) — Schema for forbidden response
    - `message` (string, required) — Error message


---

📦 **OpenAPI specs:** Every OpenAPI specification referenced by this documentation is available as a single download — https://docs.snagsolutions.io/api-specs.zip
