---
title: "Get all rules"
method: GET
path: "/groups/{groupId}/apps/{appId}/services/{serviceId}/rules"
tags: ["rules"]
---

# Get all rules

`GET /groups/{groupId}/apps/{appId}/services/{serviceId}/rules`

List all [data access rules](https://www.mongodb.com/docs/atlas/app-services/rules).

## Response `200`

Successfully listed.

- union[]
  - union
    - Rule — A data access rule that defines user roles and query filters for a collection in a linked data source.
      - `_id` string — The rule's unique ObjectId identifier.
      - `roles` object[] — A list of data access roles.
        - `document_filters` object
          - `read` union, required — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
            - object
            - boolean
          - `write` union, required — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
            - object
            - boolean
        - `name` string — The role's name.
        - `apply_when` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `read` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `write` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `insert` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `delete` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `search` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `fields` unknown
        - `additional_fields` FieldLevelPermissions — Read and write permissions for a field.
          - `read` union, required — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
            - object
            - boolean
          - `write` union, required — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
            - object
            - boolean
      - `filters` object[] — A list of filters for incoming operations.
        - `_id` string — The filter's unique ObjectId identifier.
        - `name` string — The filter's name.
        - `apply_when` union — A [rule expression](https://mongodb.com/docs/atlas/app-services/rules/expressions/).
          - object
          - boolean
        - `query` Query — A MongoDB query object.
        - `projection` Projection — A MongoDB projection object.
      - `database` string, required — The name of a database in the linked data source.
      - `collection` string, required — The name of a collection in the specified `database`.
    - ThirdPartyServiceRule — [Deprecated] A rule for a third-party service.
      - `name` string, required
      - `actions` string[]
      - `when` object, required

---

[API](https://skmtc.net/mongodb/apis/mongodb-atlas-app-services-admin-api.md) · [All operations](https://skmtc.net/mongodb/apis/mongodb-atlas-app-services-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mongodb/mongodb-atlas-app-services-admin-api/revisions/1365ab72bc03/schema)
