# Create a rule **POST /groups/{groupId}/apps/{appId}/services/{serviceId}/rules** Create a [data access rule](https://www.mongodb.com/zh-cn/docs/atlas/app-services/rules). ## Servers - The root API resource and starting point for the App Services API.: https://services.cloud.mongodb.com/api/admin/v3.0 (The root API resource and starting point for the App Services API.) ## Authentication methods - Token auth ## Parameters ### Path parameters - **groupId** (string) An Atlas [Project/Group ID](https://docs.atlas.mongodb.com/tutorial/manage-projects/). - **appId** (string) The ObjectID of your application. [The App Services API Project and Application IDs section](#section/Project-and-Application-IDs) demonstrates how to find this value. - **serviceId** (string) The unique `_id` value of a service. ### Body: application/json (object) The rule to create. - **_id** (string) The rule's unique ObjectId identifier. - **roles** (array[object]) A list of data access roles. - **filters** (array[object]) A list of filters for incoming operations. - **database** (string) The name of a database in the linked data source. - **collection** (string) The name of a collection in the specified `database`. ## Responses ### 201 Successfully created. #### Body: application/json (object) - **_id** (string) - **name** (string) ### 409 There is already a rule with the given `name`. [Powered by Bump.sh](https://bump.sh)