Custom MongoDB Roles


Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. The resource and corresponding endpoints use the term groups.

Base URL:

The customDBRoles resource lets you retrieve, create and modify the custom MongoDB roles in your cluster. Use custom MongoDB roles to specify custom sets of actions which cannot be described by the built-in Atlas database user privileges.


The available privilege actions for custom MongoDB roles support a subset of MongoDB commands. See Unsupported Commands in M10+ Clusters for more information.

Atlas audits the creation, deletion, and updates of custom MongoDB roles in the project’s Activity Feed. To view the project’s Activity Feed, click Alerts in the left navigation pane and select the All Activity tab. For more information on the project Activity Feed, see View All Activity.

The customDBRoles resource requires your Project ID.

Method Endpoint Description
GET /api/atlas/v1.0/groups/{GROUP-ID}/customDBRoles/roles Get all custom MongoDB roles in the project.
GET /api/atlas/v1.0/groups/{GROUP-ID}/customDBRoles/roles/{ROLE-NAME} Get the custom MongoDB role named {ROLE-NAME}.
POST /api/atlas/v1.0/groups/{GROUP-ID}/customDBRoles/roles Create a new custom MongoDB role in the project.
PATCH /api/atlas/v1.0/groups/{GROUP-ID}/customDBRoles/roles/{ROLE-NAME} Update a custom MongoDB role in the project.
DELETE /api/atlas/v1.0/groups/{GROUP-ID}/customDBRoles/{ROLE-NAME} Delete a custom MongoDB role from the project.