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.

Business capability
Identity & Access Management BC-620.20

Operations 5

GET /api/atlas/v2/groups/{groupId}/customDBRoles/roles Return All Custom Roles in One Project #
POST /api/atlas/v2/groups/{groupId}/customDBRoles/roles Create One Custom Role #
DELETE /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} Remove One Custom Role from One Project #
GET /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} Return One Custom Role in One Project #
PATCH /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} Update One Custom Role in One Project #

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-custom-database-roles-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. 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:
  description: The MongoDB Atlas Administration API allows developers to manage all components in MongoDB Atlas.
  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
  title: MongoDB Atlas Administration Custom Database Roles API
  version: '2.0'
  x-xgen-sha: 3d70e065843c008b9871ea7836c98c9de6f202f9
servers:
- url: https://cloud.mongodb.com
security:
- ServiceAccounts: []
- DigestAuth: []
tags:
- description: Returns, adds, edits, and removes custom database user privilege roles.
  name: Custom Database Roles
paths:
  /api/atlas/v2/groups/{groupId}/customDBRoles/roles:
    get:
      description: Returns all custom roles for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
      operationId: listGroupCustomDbRoleRoles
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/groupId'
      - $ref: '#/components/parameters/pretty'
      responses:
        '200':
          content:
            application/vnd.atlas.2023-01-01+json:
              schema:
                items:
                  $ref: '#/components/schemas/UserCustomDBRole'
                type: array
              x-xgen-version: '2023-01-01'
          description: OK
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Return All Custom Roles in One Project
      tags:
      - Custom Database Roles
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api customDatabaseRoles listCustomDbRoles --help
      - lang: go
        label: Go
        source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.ListGroupCustomDbRoleRolesApiParams{}\n\tsdkResp, httpResp, err := client.CustomDatabaseRolesApi.\n\t\tListGroupCustomDbRoleRolesWithParams(ctx, params).\n\t\tExecute()\n}\n"
      - lang: cURL
        label: curl (Service Accounts)
        source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles?pretty=true\""
      - lang: cURL
        label: curl (Digest)
        source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n  --digest --include \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles?pretty=true\""
      x-rolesRequirements:
      - Project Read Only
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/listGroupCustomDbRoleRoles
      x-xgen-operation-id-override: listCustomDbRoles
    post:
      description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role.
      operationId: createGroupCustomDbRoleRole
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/groupId'
      - $ref: '#/components/parameters/pretty'
      requestBody:
        content:
          application/vnd.atlas.2023-01-01+json:
            schema:
              $ref: '#/components/schemas/UserCustomDBRole'
        description: Creates one custom role in the specified project.
        required: true
      responses:
        '202':
          content:
            application/vnd.atlas.2023-01-01+json:
              schema:
                $ref: '#/components/schemas/UserCustomDBRole'
              x-xgen-version: '2023-01-01'
          description: Accepted
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '409':
          $ref: '#/components/responses/conflict'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Create One Custom Role
      tags:
      - Custom Database Roles
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api customDatabaseRoles createCustomDbRole --help
      - lang: go
        label: Go
        source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateGroupCustomDbRoleRoleApiParams{}\n\tsdkResp, httpResp, err := client.CustomDatabaseRolesApi.\n\t\tCreateGroupCustomDbRoleRoleWithParams(ctx, params).\n\t\tExecute()\n}\n"
      - lang: cURL
        label: curl (Service Accounts)
        source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  --header \"Content-Type: application/json\" \\\n  -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles\" \\\n  -d '{ <Payload> }'"
      - lang: cURL
        label: curl (Digest)
        source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n  --digest --include \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  --header \"Content-Type: application/json\" \\\n  -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles\" \\\n  -d '{ <Payload> }'"
      x-rolesRequirements:
      - Project Database Access Admin
      - Project Stream Processing Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/createGroupCustomDbRoleRole
      x-xgen-operation-id-override: createCustomDbRole
  /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}:
    delete:
      description: Removes one custom role from the specified project. You can't remove a custom role that would leave one or more child roles with no parent roles or actions. You also can't remove a custom role that would leave one or more database users without roles. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role.
      operationId: deleteGroupCustomDbRoleRole
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/groupId'
      - $ref: '#/components/parameters/pretty'
      - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project.
        in: path
        name: roleName
        required: true
        schema:
          type: string
      responses:
        '204':
          content:
            application/vnd.atlas.2023-01-01+json:
              x-xgen-version: '2023-01-01'
          description: No Content
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '409':
          $ref: '#/components/responses/conflict'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Remove One Custom Role from One Project
      tags:
      - Custom Database Roles
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api customDatabaseRoles deleteCustomDbRole --help
      - lang: go
        label: Go
        source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteGroupCustomDbRoleRoleApiParams{}\n\thttpResp, err := client.CustomDatabaseRolesApi.\n\t\tDeleteGroupCustomDbRoleRoleWithParams(ctx, params).\n\t\tExecute()\n}\n"
      - lang: cURL
        label: curl (Service Accounts)
        source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}\""
      - lang: cURL
        label: curl (Digest)
        source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n  --digest --include \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}\""
      x-rolesRequirements:
      - Project Database Access Admin
      - Project Stream Processing Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/deleteGroupCustomDbRoleRole
      x-xgen-operation-id-override: deleteCustomDbRole
    get:
      description: Returns one custom role for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
      operationId: getGroupCustomDbRoleRole
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/groupId'
      - $ref: '#/components/parameters/pretty'
      - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project.
        in: path
        name: roleName
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.atlas.2023-01-01+json:
              schema:
                $ref: '#/components/schemas/UserCustomDBRole'
              x-xgen-version: '2023-01-01'
          description: OK
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Return One Custom Role in One Project
      tags:
      - Custom Database Roles
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api customDatabaseRoles getCustomDbRole --help
      - lang: go
        label: Go
        source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.GetGroupCustomDbRoleRoleApiParams{}\n\tsdkResp, httpResp, err := client.CustomDatabaseRolesApi.\n\t\tGetGroupCustomDbRoleRoleWithParams(ctx, params).\n\t\tExecute()\n}\n"
      - lang: cURL
        label: curl (Service Accounts)
        source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}?pretty=true\""
      - lang: cURL
        label: curl (Digest)
        source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n  --digest --include \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}?pretty=true\""
      x-rolesRequirements:
      - Project Read Only
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/getGroupCustomDbRoleRole
      x-xgen-operation-id-override: getCustomDbRole
    patch:
      description: Updates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Stream Processing Owner role, or the Project Database Access Admin role.
      operationId: updateGroupCustomDbRoleRole
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/groupId'
      - $ref: '#/components/parameters/pretty'
      - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project.
        in: path
        name: roleName
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/vnd.atlas.2023-01-01+json:
            schema:
              $ref: '#/components/schemas/UpdateCustomDBRole'
        description: Updates one custom role in the specified project.
        required: true
      responses:
        '200':
          content:
            application/vnd.atlas.2023-01-01+json:
              schema:
                $ref: '#/components/schemas/UserCustomDBRole'
              x-xgen-version: '2023-01-01'
          description: OK
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '409':
          $ref: '#/components/responses/conflict'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Update One Custom Role in One Project
      tags:
      - Custom Database Roles
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api customDatabaseRoles updateCustomDbRole --help
      - lang: go
        label: Go
        source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.UpdateGroupCustomDbRoleRoleApiParams{}\n\tsdkResp, httpResp, err := client.CustomDatabaseRolesApi.\n\t\tUpdateGroupCustomDbRoleRoleWithParams(ctx, params).\n\t\tExecute()\n}\n"
      - lang: cURL
        label: curl (Service Accounts)
        source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  --header \"Content-Type: application/json\" \\\n  -X PATCH \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}\" \\\n  -d '{ <Payload> }'"
      - lang: cURL
        label: curl (Digest)
        source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n  --digest --include \\\n  --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n  --header \"Content-Type: application/json\" \\\n  -X PATCH \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}\" \\\n  -d '{ <Payload> }'"
      x-rolesRequirements:
      - Project Database Access Admin
      - Project Stream Processing Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/updateGroupCustomDbRoleRole
      x-xgen-operation-id-override: updateCustomDbRole
components:
  responses:
    notFound:
      content:
        application/json:
          example:
            detail: (This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS
            error: 404
            errorCode: RESOURCE_NOT_FOUND
            reason: Not Found
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Not Found.
    forbidden:
      content:
        application/json:
          example:
            detail: (This is just an example, the exception may not be related to this endpoint)
            error: 403
            errorCode: CANNOT_CHANGE_GROUP_NAME
            reason: Forbidden
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Forbidden.
    internalServerError:
      content:
        application/json:
          example:
            detail: (This is just an example, the exception may not be related to this endpoint)
            error: 500
            errorCode: UNEXPECTED_ERROR
            reason: Internal Server Error
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Internal Server Error.
    tooManyRequests:
      content:
        application/json:
          example:
            detail: (This is just an example, the exception may not be related to this endpoint)
            error: 429
            errorCode: RATE_LIMITED
            reason: Too Many Requests
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Too Many Requests.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/HeaderRateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/HeaderRateLimitRemaining'
        Retry-After:
          $ref: '#/components/headers/HeaderRetryAfter'
    conflict:
      content:
        application/json:
          example:
            detail: '(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554'
            error: 409
            errorCode: CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK
            reason: Conflict
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Conflict.
    unauthorized:
      content:
        application/json:
          example:
            detail: (This is just an example, the exception may not be related to this endpoint)
            error: 401
            errorCode: NOT_ORG_GROUP_CREATOR
            reason: Unauthorized
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Unauthorized.
    badRequest:
      content:
        application/json:
          example:
            detail: (This is just an example, the exception may not be related to this endpoint) No provider AWS exists.
            error: 400
            errorCode: VALIDATION_ERROR
            reason: Bad Request
          schema:
            $ref: '#/components/schemas/ApiError'
      description: Bad Request.
  schemas:
    ApiError:
      properties:
        badRequestDetail:
          $ref: '#/components/schemas/BadRequestDetail'
        detail:
          description: Describes the specific conditions or reasons that cause each type of error.
          type: string
        error:
          description: HTTP status code returned with this error.
          externalDocs:
            url: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
          format: int32
          readOnly: true
          type: integer
        errorCode:
          description: Application error code returned with this error.
          readOnly: true
          type: string
        parameters:
          description: Parameters used to give more information about the error.
          items:
            type: object
          readOnly: true
          type: array
        reason:
          description: Application error message returned with this error.
          readOnly: true
          type: string
      required:
      - error
      - errorCode
      type: object
    DatabaseInheritedRole:
      description: Role inherited from another context for this database user.
      externalDocs:
        description: Built-in MongoDB Roles
        url: https://docs.mongodb.com/manual/reference/built-in-roles/
      properties:
        db:
          description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user.
          type: string
        role:
          description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`.
          externalDocs:
            description: MongoDB Built-In Roles
            url: https://docs.mongodb.com/manual/reference/built-in-roles/
          type: string
      required:
      - db
      - role
      title: Inherited Role
      type: object
    FieldViolation:
      properties:
        description:
          description: A description of why the request element is bad.
          type: string
        field:
          description: A path that leads to a field in the request body.
          type: string
      required:
      - description
      - field
      type: object
    DatabasePermittedNamespaceResource:
      description: Namespace to which this database user has access.
      externalDocs:
        description: Cluster Resources
        url: https://docs.mongodb.com/manual/reference/resource-document/#cluster-resource
      properties:
        cluster:
          description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the `actions.resources.collection` and `actions.resources.db` parameters.
          type: boolean
        collection:
          description: 'Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don''t set this parameter, you grant the action to all collections in the database specified in the `actions.resources.db` parameter. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.'
          type: string
        db:
          description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.'
          type: string
      required:
      - cluster
      - collection
      - db
      title: Permitted Namespace
      type: object
    UpdateCustomDBRole:
      properties:
        actions:
          description: List of the individual privilege actions that the role grants.
          items:
            $ref: '#/components/schemas/DatabasePrivilegeAction'
          type: array
        inheritedRoles:
          description: List of the built-in roles that this custom role inherits.
          items:
            $ref: '#/components/schemas/DatabaseInheritedRole'
          type: array
          uniqueItems: true
      type: object
    DatabasePrivilegeAction:
      description: Privilege action that the role grants.
      properties:
        action:
          description: Human-readable label that identifies the privilege action.
          enum:
          - FIND
          - INSERT
          - REMOVE
          - UPDATE
          - BYPASS_DOCUMENT_VALIDATION
          - USE_UUID
          - KILL_OP
          - BYPASS_DEFAULT_MAX_TIME_MS
          - CREATE_COLLECTION
          - CREATE_INDEX
          - DROP_COLLECTION
          - ENABLE_PROFILER
          - KILL_ANY_CURSOR
          - CHANGE_STREAM
          - COLL_MOD
          - COMPACT
          - CONVERT_TO_CAPPED
          - DROP_DATABASE
          - DROP_INDEX
          - RE_INDEX
          - RENAME_COLLECTION_SAME_DB
          - SET_USER_WRITE_BLOCK
          - BYPASS_USER_WRITE_BLOCK
          - LIST_SESSIONS
          - KILL_ANY_SESSION
          - COLL_STATS
          - CONN_POOL_STATS
          - DB_HASH
          - DB_STATS
          - GET_CMD_LINE_OPTS
          - GET_LOG
          - GET_PARAMETER
          - GET_SHARD_MAP
          - HOST_INFO
          - IN_PROG
          - LIST_DATABASES
          - LIST_COLLECTIONS
          - LIST_INDEXES
          - LIST_SHARDS
          - NET_STAT
          - REPL_SET_GET_CONFIG
          - REPL_SET_GET_STATUS
          - SERVER_STATUS
          - VALIDATE
          - SHARDING_STATE
          - TOP
          - SQL_GET_SCHEMA
          - SQL_SET_SCHEMA
          - VIEW_ALL_HISTORY
          - OUT_TO_S3
          - OUT_TO_AZURE
          - OUT_TO_GCS
          - STORAGE_GET_CONFIG
          - STORAGE_SET_CONFIG
          - FLUSH_ROUTER_CONFIG
          - ENABLE_SHARDING
          - CHECK_METADATA_CONSISTENCY
          - MOVE_CHUNK
          - SPLIT_CHUNK
          - ANALYZE_SHARD_KEY
          - REFINE_COLLECTION_SHARD_KEY
          - CLEAR_JUMBO_FLAG
          - RESHARD_COLLECTION
          - SHARDED_DATA_DISTRIBUTION
          - GET_STREAM_PROCESSOR
          - CREATE_STREAM_PROCESSOR
          - PROCESS_STREAM_PROCESSOR
          - MODIFY_STREAM_PROCESSOR
          - START_STREAM_PROCESSOR
          - STOP_STREAM_PROCESSOR
          - DROP_STREAM_PROCESSOR
          - SAMPLE_STREAM_PROCESSOR
          - LIST_STREAM_PROCESSORS
          - LIST_CONNECTIONS
          - STREAM_PROCESSOR_STATS
          type: string
        resources:
          description: List of resources on which you grant the action.
          items:
            $ref: '#/components/schemas/DatabasePermittedNamespaceResource'
          type: array
      required:
      - action
      - resources
      title: Database Privilege Action
      type: object
    BadRequestDetail:
      description: Bad request detail.
      properties:
        fields:
          description: Describes all violations in a client request.
          items:
            $ref: '#/components/schemas/FieldViolation'
          type: array
      readOnly: true
      type: object
    UserCustomDBRole:
      properties:
        actions:
          description: List of the individual privilege actions that the role grants.
          items:
            $ref: '#/components/schemas/DatabasePrivilegeAction'
          type: array
        inheritedRoles:
          description: List of the built-in roles that this custom role inherits.
          items:
            $ref: '#/components/schemas/DatabaseInheritedRole'
          type: array
          uniqueItems: true
        roleName:
          description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project.
          type: string
      required:
      - roleName
      type: object
  parameters:
    groupId:
      description: 'Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.


        **NOTE**: 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.'
      in: path
      name: groupId
      required: true
      schema:
        example: 32b6e34b3d91647abb20e7b8
        pattern: ^([a-f0-9]{24})$
        type: string
    pretty:
      description: Flag that indicates whether the response body should be in the prettyprint format.
      in: query
      name: pretty
      schema:
        default: false
        externalDocs:
          description: Prettyprint
          url: https://en.wikipedia.org/wiki/Prettyprint
        type: boolean
    envelope:
      description: Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.
      in: query
      name: envelope
      schema:
        default: false
        type: boolean
  headers:
    HeaderRateLimitRemaining:
      description: The number of requests remaining in the current rate limit window before the limit is reached.
      schema:
        type: integer
    HeaderRateLimitLimit:
      description: The maximum number of requests that a user can make within a specific time window.
      schema:
        type: integer
    HeaderRetryAfter:
      description: The minimum time you should wait, in seconds, before retrying the API request. This header might be returned for 429 or 503 error responses.
      schema:
        type: integer
  securitySchemes:
    DigestAuth:
      scheme: digest
      type: http
    ServiceAccounts:
      description: Learn more about [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview).
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: https://cloud.mongodb.com/api/oauth/token
      type: oauth2
x-externalLinks:
- label: Back to Atlas Docs
  url: https://www.mongodb.com/docs/atlas/
- label: API Changelog
  url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog/
x-topics:
- content: The MongoDB Atlas Administration API is rate limited. To learn more about rate limiting, see the [Atlas Documentation on Rate Limiting](http://dochub.mongodb.org/core/atlas-api-rate-limit)
  title: Rate Limiting