---
title: "Update endpoint for a ruleset, allowing for atomic changes to an entire ruleset."
method: POST
path: "/namespaces/{namespaceID}/ruleset/update"
tags: ["namespaces"]
---

# Update endpoint for a ruleset, allowing for atomic changes to an entire ruleset.

`POST /namespaces/{namespaceID}/ruleset/update`

## Path parameters

- `namespaceID` string, required

## Request body

- object
  - `rulesetChanges` RuleSetChanges
    - `mappingRuleChanges` MappingRuleChange[] — list of mapping rule changes
      - `op` 'add' | 'delete' | 'change' — type of operation on rule
      - `ruleID` string — ID of the rule, should be omitted for adds
      - `ruleData` MappingRule
        - `id` string
        - `name` string
        - `filter` string
        - `aggregation` string[]
        - `storagePolicies` string[]
        - `dropPolicy` integer
        - `cutoverMillis` integer
        - `lastUpdatedBy` string
        - `lastUpdatedAtMillis` integer
    - `rollupRuleChanges` RollupRuleChange[] — list of rollup rule changes
      - `op` 'add' | 'delete' | 'change' — type of operation on rule
      - `ruleID` string — ID of the rule, should be omitted for adds
      - `ruleData` RollupRule
        - `id` string
        - `name` string
        - `filter` string
        - `cutoverMillis` integer
        - `targets` RollupTarget[]
          - `pipeline` unknown[]
            - unknown
          - `storagePolicies` string[]
        - `lastUpdatedBy` string
        - `lastUpdatedAtMillis` integer
  - `rulesetVersion` integer

## Response `200`

The ruleset updates have been applied

- RuleSet
  - `id` string — The id of the namespace this ruleset belongs to.
  - `version` integer
  - `cutoverMillis` integer
  - `mappingRules` MappingRule[]
    - `id` string
    - `name` string
    - `filter` string
    - `aggregation` string[]
    - `storagePolicies` string[]
    - `dropPolicy` integer
    - `cutoverMillis` integer
    - `lastUpdatedBy` string
    - `lastUpdatedAtMillis` integer
  - `rollupRules` RollupRule[]
    - `id` string
    - `name` string
    - `filter` string
    - `cutoverMillis` integer
    - `targets` RollupTarget[]
      - `pipeline` unknown[]
        - unknown
      - `storagePolicies` string[]
    - `lastUpdatedBy` string
    - `lastUpdatedAtMillis` integer

## Other responses

- `404` — No such namespace
- `409` — Namespace already exists
- `500` — Something went horribly wrong

---

[API](https://skmtc.dev/m3db/apis/r2-api.md) · [All operations](https://skmtc.dev/m3db/apis/r2-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/m3db/r2-api/revisions/0e7f233d17fb/schema)
