MongoDB Custom Database Roles API

Returns, adds, edits, and removes custom database user privilege roles. Use custom roles to specify custom sets of actions that the MongoDB Cloud built-in roles can't describe. You define custom roles at the project level, for all clusters in the project. This resource supports a subset of MongoDB privilege actions. You can create a subset of custom role actions. To create a wider list of custom role actions, use the MongoDB Cloud user interface. Custom roles must include actions that all project's clusters support, and that are compatible with each MongoDB version that your project's clusters use. For example, if your project has MongoDB 4.2 clusters, you can't create custom roles that use actions introduced in MongoDB 4.4.

GitHub OpenAPI
Business capability
Identity & Access Management BC-620.20

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/atlas/v2/groups/{groupId}/customDBRoles/roles List custom database roles in a project · Return All Custom Roles in One Project #
Ask an LLM
“What custom database roles exist in my MongoDB Cloud project?”
“Can I see every custom role defined for one project?”
Tell an agent
List all custom database roles in project {groupId}.
Show every custom role for project {groupId}.
POST /api/atlas/v2/groups/{groupId}/customDBRoles/roles Create a custom database role · Create One Custom Role #
Ask an LLM
“How do I define a new custom role with specific actions?”
“Can a custom role inherit built-in roles?”
Tell an agent
Create custom role {roleName} in project {groupId} with actions {actions}.
Add a custom role {roleName} to project {groupId} inheriting roles {inheritedRoles}.
DELETE /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} Remove a custom database role · Remove One Custom Role from One Project #
Ask an LLM
“How do I delete a custom role from a project?”
“Can I remove a custom role that child roles depend on?”
Tell an agent destructive · confirm first
Delete custom role {roleName} from project {groupId}.
Remove the custom role {roleName} in project {groupId}.
GET /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} Get one custom database role · Return One Custom Role in One Project #
Ask an LLM
“What actions does a specific custom role grant?”
“Can I look up a custom role by name in a project?”
Tell an agent
Get custom role {roleName} in project {groupId}.
Show the actions granted by custom role {roleName} in project {groupId}.
PATCH /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} Update a custom database role · Update One Custom Role in One Project #
Ask an LLM
“Can I change the actions a custom role grants?”
“Is it possible to add inherited roles to an existing custom role?”
Tell an agent
Update custom role {roleName} in project {groupId} to grant actions {actions}.
Change existing custom role {roleName} in project {groupId} to inherit roles {inheritedRoles}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mongodb:mongodb-custom-database-roles-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mongodb-custom-database-roles-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mongodb Custom Database Roles API
  version: '2.0'
  license:
    name: CC BY-NC-SA 3.0 US
    url: https://creativecommons.org/licenses/by-nc-sa/3.0/us/
  termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions
  x-refined-note:
  - x-xgen-sha differs across the merged source definitions and was not carried
  description: 'Operations tagged Custom Database Roles across 2 of this provider''s published API definitions: mongodb-atlas-openapi.yaml, mongodb-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://cloud.mongodb.com
security:
- ServiceAccounts: []
- DigestAuth: []
tags:


# --- truncated at 32 KB (35 KB total) ---
# Full source: https://artifacts.apis.io/mongodb/openapi/mongodb-custom-database-roles-api-openapi.yml