---
title: "Rule creation"
method: POST
path: "/v2/user/analytics/{storeId}/rules"
tags: ["Analytics - Rules"]
---

# Rule creation

`POST /v2/user/analytics/{storeId}/rules`

## Path parameters

- `storeId` string, guid, required

## Request body

- CreateRuleRequest
  - `optimisationActionName` 'reenable' | 'disable', required — The optimisation action
  - `ruleName` string, required — The name of the rule
  - `reportFilterId` string, guid, required — The report filter to use for the rule
  - `startUtcDate` string, date-time — The start validity utc date of the rule
  - `endUtcDate` string, date-time — The end validity utc date of the rule

## Response `204`

Rule created

## Other responses

- `400` — Period on filter cannot be custom or filter does not exist
- `401` — Store not allowed to use rules. Please upgrade your offer or contact us.
- `403` — Reached the maximum amount of rules allowed for your offer. Please upgrade your offer or contact us.
- `404` — Store or resource not found
- `default` — Occurs when something goes wrong

---

[API](https://skmtc.net/beezup/apis/beezup-merchant-api.md) · [All operations](https://skmtc.net/beezup/apis/beezup-merchant-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/beezup/beezup-merchant-api/versions/557b7feddf8a/schema)
