---
title: 'Restore Loyalty Rule Edit'
description: 'Restore a loyalty rule from a rule edit'
openapi: POST /api/loyalty/rule_edits/{id}/restore
---

> **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_edits/{id}/restore` — path parameters: `id`

`POST https://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore`

Restore a loyalty rule from a rule edit

## Authentication

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

## Path parameters

- `id` (string, required)

## Request body

- Content type: `application/json`
  - request body (object)

## Response 200

200
  - response
    - (allOf)
      - value (object)
        - `id` (string, uuid, required)
      - value (object)
        - `id` (string, uuid, required) — Unique identifier for the rule edit
        - `loyaltyRuleId` (string, uuid, required) — ID of the loyalty rule
        - `websiteId` (string, uuid, required) — Unique identifier for the website
        - `organizationId` (string, uuid, required) — Unique identifier for the organization
        - `editedByUserId` (string, uuid, required) — User ID of the user who made the edit
        - `editedAt` (string, date-time, required) — Timestamp of when the rule edit was made
        - `action` (string, required, one of: create, update, delete, restore) — Type of action that was made on the rule
        - `data` (object, required) — Data that was changed on the rule
          - `id` (string, uuid, required) — Unique identifier for the loyalty rule
          - `name` (string, required) — Name of the loyalty rule
          - `description` (string, required) — Description of the loyalty rule
          - `endTime` (string, required) — End time of the loyalty rule
          - `startTime` (string, required) — Start time of the loyalty rule
          - `rewardType` (string, required, one of: points, multiplier, badge, token) — Type of the reward
          - `organizationId` (string, uuid, required) — Unique identifier for the organization
          - `websiteId` (string, uuid, required) — Unique identifier for the website
          - `collectionAddress` (string) — Optional address of the collection
          - `type` (string, required) — Type of the loyalty rule
          - `frequency` (string, required) — Frequency of the loyalty rule
          - `amount` (number, required) — Amount associated with the loyalty rule
          - `createdAt` (string, date-time, required) — Timestamp when the loyalty rule was created
          - `updatedAt` (string, date-time, required) — Timestamp when the loyalty rule was last updated
          - `deletedAt` (string, date-time, required) — Timestamp when the loyalty rule was deleted (if applicable)
          - `mediaUrl` (string) — URL of the media associated with the loyalty rule
          - `metadata` (object) — Optional metadata for the loyalty rule
          - `dappDeployedWithin` (string, one of: daily, weekly, monthly) — Filter dApps by deployment age before ranking.
          - `dappDataWindow` (string, one of: daily, weekly, monthly) — Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.
          - `trackProgress` (boolean) — Flag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.
          - `progressType` (string, one of: counter, percentage) — How tracked progress is interpreted. "percentage" counts 0-100 and is shown as a percentage. "counter" counts up to the highest reward range end and is shown as a raw count.
        - `previousData` (object) — Previous data of the rule before the edit
          - `id` (string, uuid, required) — Unique identifier for the loyalty rule
          - `name` (string, required) — Name of the loyalty rule
          - `description` (string, required) — Description of the loyalty rule
          - `endTime` (string, required) — End time of the loyalty rule
          - `startTime` (string, required) — Start time of the loyalty rule
          - `rewardType` (string, required, one of: points, multiplier, badge, token) — Type of the reward
          - `organizationId` (string, uuid, required) — Unique identifier for the organization
          - `websiteId` (string, uuid, required) — Unique identifier for the website
          - `collectionAddress` (string) — Optional address of the collection
          - `type` (string, required) — Type of the loyalty rule
          - `frequency` (string, required) — Frequency of the loyalty rule
          - `amount` (number, required) — Amount associated with the loyalty rule
          - `createdAt` (string, date-time, required) — Timestamp when the loyalty rule was created
          - `updatedAt` (string, date-time, required) — Timestamp when the loyalty rule was last updated
          - `deletedAt` (string, date-time, required) — Timestamp when the loyalty rule was deleted (if applicable)
          - `mediaUrl` (string) — URL of the media associated with the loyalty rule
          - `metadata` (object) — Optional metadata for the loyalty rule
          - `dappDeployedWithin` (string, one of: daily, weekly, monthly) — Filter dApps by deployment age before ranking.
          - `dappDataWindow` (string, one of: daily, weekly, monthly) — Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.
          - `trackProgress` (boolean) — Flag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.
          - `progressType` (string, one of: counter, percentage) — How tracked progress is interpreted. "percentage" counts 0-100 and is shown as a percentage. "counter" counts up to the highest reward range end and is shown as a raw count.
        - `comment` (string) — Comment that was made on the edit

## 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
