---
title: "POST /v1/{+name}/rulesets"
method: POST
path: "/v1/{+name}/rulesets"
tags: ["projects"]
---

# POST /v1/{+name}/rulesets

`POST /v1/{+name}/rulesets`

Create a `Ruleset` from `Source`. The `Ruleset` is given a unique generated name which is returned to the caller. `Source` containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of `Source` issues, use TestRuleset.

## Path parameters

- `name` string, required

## Request body

- Ruleset — `Ruleset` is an immutable copy of `Source` with a globally unique identifier and a creation time.
  - `source` Source — `Source` is one or more `File` messages comprising a logical set of rules.
    - `files` File[] — Required. `File` set constituting the `Source` bundle.
      - `name` string — Required. File name.
      - `content` string — Required. Textual Content.
      - `fingerprint` string, byte — Fingerprint (e.g. github sha) associated with the `File`.
  - `metadata` Metadata — Metadata for a Ruleset.
    - `services` string[] — Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
  - `name` string — Output only. Name of the `Ruleset`. The ruleset_id is auto generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}`
  - `attachmentPoint` string — Immutable. Intended resource to which this Ruleset should be released. May be left blank to signify the resource associated with the default release. Expected format: firestore.googleapis.com/projects//databases/
  - `createTime` string, google-datetime — Output only. Time the `Ruleset` was created.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/firebaserules.md) · [All operations](https://skmtc.dev/google/apis/firebaserules/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/firebaserules/revisions/d3ce1431eabc/schema)
