# REST Resource: projects.rulesets

- [Resource: Ruleset](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Ruleset)
  - [JSON representation](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Ruleset.SCHEMA_REPRESENTATION)
- [Source](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Source)
  - [JSON representation](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Source.SCHEMA_REPRESENTATION)
- [File](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#File)
  - [JSON representation](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#File.SCHEMA_REPRESENTATION)
- [Metadata](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Metadata)
  - [JSON representation](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Metadata.SCHEMA_REPRESENTATION)
- [Methods](https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#METHODS_SUMMARY)

## Resource: Ruleset

`Ruleset` is an immutable copy of `Source` with a globally unique identifier and a creation time.

| JSON representation ||
|---|---|
| ``` { "name": string, "source": { object (`https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Source`) }, "createTime": string, "metadata": { object (`https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Metadata`) }, "attachment_point": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Name of the `Ruleset`. The ruleset_id is auto generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}` |
| `source` | ``object (`https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Source`)`` `Source` for the `Ruleset`. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time the `Ruleset` was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `metadata` | ``object (`https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#Metadata`)`` Output only. The metadata for this ruleset. |
| `attachment_point` | `string` 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/<project number>/databases/<uuid> ` ` ` |

## Source

`Source` is one or more `File` messages comprising a logical set of rules.

| JSON representation ||
|---|---|
| ``` { "files": [ { object (`https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#File`) } ] } ``` |

| Fields ||
|---|---|
| `files[]` | ``object (`https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets#File`)`` `File` set constituting the `Source` bundle. |

## File

`File` containing source content.

| JSON representation ||
|---|---|
| ``` { "content": string, "name": string, "fingerprint": string } ``` |

| Fields ||
|---|---|
| `content` | `string` Rules language statements. Use `\n` for line breaks. |
| `name` | `string` File name. |
| `fingerprint` | `string (https://developers.google.com/discovery/v1/type-format format)` Fingerprint (e.g. github sha) associated with the `File`. A base64-encoded string. |

## Metadata

Metadata for a Ruleset.

| JSON representation ||
|---|---|
| ``` { "services": [ string ] } ``` |

| Fields ||
|---|---|
| `services[]` | `string` Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these. |

| ## Methods ||
|---|---|
| ### `https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets/create` | Create a `Ruleset` from `Source`. |
| ### `https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets/delete` | Delete a `Ruleset` by resource name. |
| ### `https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets/get` | Get a `Ruleset` by name including the full `Source` contents. |
| ### `https://firebase.google.com/docs/reference/rules/rest/v1/projects.rulesets/list` | List `Ruleset` metadata only and optionally filter the results by `Ruleset` name. |