---
title: "Create a rollup rule with the given state"
method: POST
path: "/namespaces/{namespaceID}/rollup-rules"
tags: ["rollup-rules"]
---

# Create a rollup rule with the given state

`POST /namespaces/{namespaceID}/rollup-rules`

## Path parameters

- `namespaceID` string, required

## Request body

- RollupRule
  - `id` string
  - `name` string
  - `filter` string
  - `cutoverMillis` integer
  - `targets` RollupTarget[]
    - `pipeline` unknown[]
      - unknown
    - `storagePolicies` string[]
  - `lastUpdatedBy` string
  - `lastUpdatedAtMillis` integer

## Response `201`

Ruleset updated

- 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 or no such rule
- `409` — The ruleset got updated while you were looking at it.
- `500` — Something went horribly wrong

---

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