Firebase Rules API

Creates and manages rules that determine when a Firebase Security Rules-enabled service should permit a request.

This reference documentation applies to managing Firebase Security Rules for Cloud Firestore and Cloud Storage for Firebase. For information about managing Firebase Realtime Database Security Rules, seeManaging Firebase Realtime Database Rules using REST.

For a description of the tools you can use to manage your Security Rules, including this REST API, seeManage and deploy Firebase Security Rules.

You can try out calling a Security Rules REST API method on live data using the embedded API Explorer. This API Explorer allows you to see the API request and response without leaving the API's reference documentation.

Find the embedded explorer in the side-panel of each method's reference page (click any method in the tables below).

Overview

Firebase Security Rules is comprised of a language and an API. Developers write rules in the language, publish them via the API, and then submit requests to Firebase Security Rules-enabled services. Services evaluate requests using the provided ruleset and determine whether the requests should be permitted.

The following terms are used in this reference documentation.

Service: firebaserules.googleapis.com

To call this service, we recommend that you use the Google-providedclient libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

Discovery document

ADiscovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:

Service endpoint

Aservice endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

  • https://firebaserules.googleapis.com

REST Resource:v1.projects

Methods
testPOST /v1/{name=projects/**}:test
TestSource for syntactic and semantic correctness.

REST Resource:v1.projects.releases

Methods
createPOST /v1/{name=projects/*}/releases
Create aRelease.
deleteDELETE /v1/{name=projects/*/releases/**}
Delete aRelease by resource name.
getGET /v1/{name=projects/*/releases/**}
Get aRelease by name.
getExecutableGET /v1/{name=projects/*/releases/**}:getExecutable
Get theRelease executable to use when enforcing rules.
listGET /v1/{name=projects/*}/releases
List theRelease values for a project.
patchPATCH /v1/{name=projects/*/releases/**}
Update aRelease via PATCH.

REST Resource:v1.projects.rulesets

Methods
createPOST /v1/{name=projects/*}/rulesets
Create aRuleset fromSource.
deleteDELETE /v1/{name=projects/*/rulesets/*}
Delete aRuleset by resource name.
getGET /v1/{name=projects/*/rulesets/*}
Get aRuleset by name including the fullSource contents.
listGET /v1/{name=projects/*}/rulesets
ListRuleset metadata only and optionally filter the results byRuleset name.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-11-11 UTC.