MongoDB Resource Policies API

Configure and manage Atlas Resource Policies within your organization.

Operations 7

GET /api/atlas/v2/orgs/{orgId}/nonCompliantResources Return All Non-Compliant Resources #
GET /api/atlas/v2/orgs/{orgId}/resourcePolicies Return All Atlas Resource Policies #
POST /api/atlas/v2/orgs/{orgId}/resourcePolicies Create One Atlas Resource Policy #
DELETE /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId} Delete One Atlas Resource Policy #
GET /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId} Return One Atlas Resource Policy #
PATCH /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId} Update One Atlas Resource Policy #
POST /api/atlas/v2/orgs/{orgId}/resourcePolicies:validate Validate One Atlas Resource Policy #

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-resource-policies-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-resource-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: "The MongoDB Atlas Administration API allows developers to manage all components in MongoDB Atlas.\n\nThe Atlas Administration API supports OAuth2 Service Accounts and HTTP Digest-based API keys. Service accounts are the recommended authentication method and API keys are considered a legacy option.\n\nTo authenticate with a Service Account, first exchange its client ID and secret for an access token using the OAuth 2.0 Client Credentials flow. Atlas provides a token endpoint at `POST https://cloud.mongodb.com/api/oauth/token`, which returns a Bearer token that is reusable and valid for 1 hour (3600 seconds).\n\nFor example, to [return a list of your organizations](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listorgs) with [cURL](https://en.wikipedia.org/wiki/CURL), first generate an access token and then use that token to call the same Atlas Administration API endpoint shown in the current example:\n\n```\nACCESS_TOKEN=$(curl -fsS --request POST https://cloud.mongodb.com/api/oauth/token \\\n  --header \"Authorization: Basic $(printf '%s' \"${CLIENT_ID}:${CLIENT_SECRET}\" | base64 | tr -d '\\n')\" \\\n  --header \"Content-Type: application/x-www-form-urlencoded\" \\\n  --header \"Accept: application/json\" \\\n  --data \"grant_type=client_credentials\" | jq -r '.access_token')\n\ncurl --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/orgs?pretty=true\"\n```\n\nIf your organization requires an IP access list for the Atlas Administration API, the token can be created from any IP address, but the API call that uses the token must originate from an allowed IP.\n\nTo learn more, see [Get Started with the Atlas Administration API](https://www.mongodb.com/docs/atlas/configure-api-access/). For support, see [MongoDB Support](https://www.mongodb.com/support/get-started).\n\nYou can also explore the various endpoints available through the Atlas Administration API in MongoDB's [Postman workspace](https://www.postman.com/mongodb-devrel/workspace/mongodb-atlas-administration-apis/) (requires a Postman account)."
  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 Access Tracking Resource Policies API
  version: '2.0'
  x-xgen-sha: 3d70e065843c008b9871ea7836c98c9de6f202f9
servers:
- url: https://cloud.mongodb.com
security:
- ServiceAccounts: []
- DigestAuth: []
tags:
- description: Configure and manage Atlas Resource Policies within your organization.
  name: Resource Policies
paths:
  /api/atlas/v2/orgs/{orgId}/nonCompliantResources:
    get:
      description: Return all non-compliant resources for an organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: getOrgNonCompliantResources
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      responses:
        '200':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                items:
                  $ref: '#/components/schemas/ApiAtlasNonCompliantResourceView'
                type: array
              x-xgen-version: '2024-08-05'
          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'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Return All Non-Compliant Resources
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies getNonCompliantResources --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.GetOrgNonCompliantResourcesApiParams{}\n\tsdkResp, httpResp, err := client.ResourcePoliciesApi.\n\t\tGetOrgNonCompliantResourcesWithParams(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/orgs/{orgId}/nonCompliantResources?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/orgs/{orgId}/nonCompliantResources?pretty=true\""
      x-rolesRequirements:
      - Organization Member
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/getOrgNonCompliantResources
      x-xgen-operation-id-override: getNonCompliantResources
  /api/atlas/v2/orgs/{orgId}/resourcePolicies:
    get:
      description: Return all Atlas Resource Policies for the organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: listOrgResourcePolicies
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      responses:
        '200':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                items:
                  $ref: '#/components/schemas/ApiAtlasResourcePolicyView'
                type: array
              x-xgen-version: '2024-08-05'
          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'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Return All Atlas Resource Policies
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies listOrgResourcePolicies --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.ListOrgResourcePoliciesApiParams{}\n\tsdkResp, httpResp, err := client.ResourcePoliciesApi.\n\t\tListOrgResourcePoliciesWithParams(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/orgs/{orgId}/resourcePolicies?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/orgs/{orgId}/resourcePolicies?pretty=true\""
      x-rolesRequirements:
      - Organization Member
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/listOrgResourcePolicies
    post:
      description: Create one Atlas Resource Policy for an organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: createOrgResourcePolicy
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      requestBody:
        content:
          application/vnd.atlas.2024-08-05+json:
            schema:
              $ref: '#/components/schemas/ApiAtlasResourcePolicyCreateView'
            x-xgen-version: '2024-08-05'
        description: Atlas Resource Policy to create.
        required: true
      responses:
        '201':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasResourcePolicyView'
              x-xgen-version: '2024-08-05'
          description: Created
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '400':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasInvalidResourcePolicyCreateErrorView'
              x-xgen-version: '2024-08-05'
          description: Bad request.
        '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: Create One Atlas Resource Policy
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies createOrgResourcePolicy --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.CreateOrgResourcePolicyApiParams{}\n\tsdkResp, httpResp, err := client.ResourcePoliciesApi.\n\t\tCreateOrgResourcePolicyWithParams(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/orgs/{orgId}/resourcePolicies\" \\\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/orgs/{orgId}/resourcePolicies\" \\\n  -d '{ <Payload> }'"
      x-rolesRequirements:
      - Organization Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/createOrgResourcePolicy
  /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}:
    delete:
      description: Delete one Atlas Resource Policy for an organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: deleteOrgResourcePolicy
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      - description: Unique 24-hexadecimal digit string that identifies an atlas resource policy.
        in: path
        name: resourcePolicyId
        required: true
        schema:
          description: Unique 24-hexadecimal character string that identifies the atlas resource policy.
          example: 32b6e34b3d91647abb20e7b8
          pattern: ^([a-f0-9]{24})$
          readOnly: true
          type: string
      responses:
        '200':
          content:
            application/vnd.atlas.2024-08-05+json:
              x-xgen-version: '2024-08-05'
          description: This endpoint does not return a response body.
          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'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Delete One Atlas Resource Policy
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies deleteOrgResourcePolicy --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.DeleteOrgResourcePolicyApiParams{}\n\thttpResp, err := client.ResourcePoliciesApi.\n\t\tDeleteOrgResourcePolicyWithParams(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/orgs/{orgId}/resourcePolicies/{resourcePolicyId}\""
      - 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/orgs/{orgId}/resourcePolicies/{resourcePolicyId}\""
      x-rolesRequirements:
      - Organization Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/deleteOrgResourcePolicy
    get:
      description: Return one Atlas Resource Policy for an organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: getOrgResourcePolicy
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      - description: Unique 24-hexadecimal digit string that identifies an atlas resource policy.
        in: path
        name: resourcePolicyId
        required: true
        schema:
          description: Unique 24-hexadecimal character string that identifies the atlas resource policy.
          example: 32b6e34b3d91647abb20e7b8
          pattern: ^([a-f0-9]{24})$
          readOnly: true
          type: string
      responses:
        '200':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasResourcePolicyView'
              x-xgen-version: '2024-08-05'
          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'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          $ref: '#/components/responses/internalServerError'
      summary: Return One Atlas Resource Policy
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies getOrgResourcePolicy --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.GetOrgResourcePolicyApiParams{}\n\tsdkResp, httpResp, err := client.ResourcePoliciesApi.\n\t\tGetOrgResourcePolicyWithParams(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/orgs/{orgId}/resourcePolicies/{resourcePolicyId}?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/orgs/{orgId}/resourcePolicies/{resourcePolicyId}?pretty=true\""
      x-rolesRequirements:
      - Organization Member
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/getOrgResourcePolicy
    patch:
      description: Update one Atlas Resource Policy for an organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: updateOrgResourcePolicy
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      - description: Unique 24-hexadecimal digit string that identifies an atlas resource policy.
        in: path
        name: resourcePolicyId
        required: true
        schema:
          description: Unique 24-hexadecimal character string that identifies the atlas resource policy.
          example: 32b6e34b3d91647abb20e7b8
          pattern: ^([a-f0-9]{24})$
          readOnly: true
          type: string
      requestBody:
        content:
          application/vnd.atlas.2024-08-05+json:
            schema:
              $ref: '#/components/schemas/ApiAtlasResourcePolicyEditView'
            x-xgen-version: '2024-08-05'
        description: Atlas Resource Policy to update.
        required: true
      responses:
        '200':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasResourcePolicyView'
              x-xgen-version: '2024-08-05'
          description: Ok
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '400':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasInvalidResourcePolicyCreateErrorView'
              x-xgen-version: '2024-08-05'
          description: Bad request.
        '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: Update One Atlas Resource Policy
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies updateOrgResourcePolicy --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.UpdateOrgResourcePolicyApiParams{}\n\tsdkResp, httpResp, err := client.ResourcePoliciesApi.\n\t\tUpdateOrgResourcePolicyWithParams(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/orgs/{orgId}/resourcePolicies/{resourcePolicyId}\" \\\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/orgs/{orgId}/resourcePolicies/{resourcePolicyId}\" \\\n  -d '{ <Payload> }'"
      x-rolesRequirements:
      - Organization Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/updateOrgResourcePolicy
  /api/atlas/v2/orgs/{orgId}/resourcePolicies:validate:
    post:
      description: Validate one Atlas Resource Policy for an organization.
      externalDocs:
        description: Atlas Resource Policies
        url: https://dochub.mongodb.org/core/atlas-resource-policies
      operationId: validateOrgResourcePolicies
      parameters:
      - $ref: '#/components/parameters/envelope'
      - $ref: '#/components/parameters/pretty'
      - $ref: '#/components/parameters/orgId'
      requestBody:
        content:
          application/vnd.atlas.2024-08-05+json:
            schema:
              $ref: '#/components/schemas/ApiAtlasResourcePolicyCreateView'
            x-xgen-version: '2024-08-05'
        description: Atlas Resource Policy to create.
        required: true
      responses:
        '200':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasResourcePolicyView'
              x-xgen-version: '2024-08-05'
          description: Ok
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/HeaderRateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/HeaderRateLimitRemaining'
        '400':
          content:
            application/vnd.atlas.2024-08-05+json:
              schema:
                $ref: '#/components/schemas/ApiAtlasInvalidResourcePolicyCreateErrorView'
              x-xgen-version: '2024-08-05'
          description: Bad request.
        '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: Validate One Atlas Resource Policy
      tags:
      - Resource Policies
      x-codeSamples:
      - lang: cURL
        label: Atlas CLI
        source: atlas api resourcePolicies validateResourcePolicies --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.ValidateOrgResourcePoliciesApiParams{}\n\tsdkResp, httpResp, err := client.ResourcePoliciesApi.\n\t\tValidateOrgResourcePoliciesWithParams(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/orgs/{orgId}/resourcePolicies:validate\" \\\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/orgs/{orgId}/resourcePolicies:validate\" \\\n  -d '{ <Payload> }'"
      x-rolesRequirements:
      - Organization Owner
      x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/validateOrgResourcePolicies
      x-xgen-operation-id-override: validateResourcePolicies
components:
  schemas:
    ApiAtlasResourcePolicyMetadataView:
      properties:
        policiesCausingNonCompliance:
          description: List of policies that are in conflict with the current state of the resource.
          items:
            $ref: '#/components/schemas/ApiAtlasPolicyMetadataView'
          readOnly: true
          type: array
        resourcePolicyId:
          description: Unique 24-hexadecimal character string that identifies the atlas resource policy.
          example: 32b6e34b3d91647abb20e7b8
          pattern: ^([a-f0-9]{24})$
          readOnly: true
          type: string
        resourcePolicyName:
          description: Human-readable label that describes the atlas resource policy.
          readOnly: true
          type: string
      type: object
    ApiAtlasInvalidPolicyErrorDetailView:
      properties:
        detail:
          description: A string that provides a detailed description of a validation error.
          readOnly: true
          type: string
      type: object
    ApiAtlasPolicyMetadataView:
      properties:
        policyId:
          description: Unique 24-hexadecimal character string that identifies the policy.
          example: 32b6e34b3d91647abb20e7b8
          pattern: ^([a-f0-9]{24})$
          readOnly: true
          type: string
      type: object
    ApiAtlasResourcePolicyCreateView:
      properties:
        description:
          description: Description of the atlas resource policy.
          type: string
        name:
          description: Human-readable label that describes the atlas resource policy.
          type: string
        policies:
          description: List of policies that make up the atlas resource policy.
          items:
            $ref: '#/components/schemas/ApiAtlasPolicyCreateView'
          type: array
      required:
      - name
      - policies
      type: object
    ApiAtlasInvalidResourcePolicyCreateErrorView:
      properties:
        errorType:
          description: Human-readable label that displays the type of an error.
          enum:
          - POLICY_PARSING_ERROR
          - POLICY_HAS_FAILED_VALIDATIONS
          - POLICY_HAS_INVALID_PRINCIPAL
          - POLICY_HAS_BODY_EXCEEDING_MAX_SIZE
          - POLICY_HAS_UNEXPECTED_ENTITIES
          type: string
        invalidPolicies:
          description: List of invalid policies containing details of their validation errors.
          items:
            $ref: '#/components/schemas/ApiAtlasInvalidPolicyView'
          readOnly: true
          type: array
      type: object
    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
    ApiAtlasPolicyView:
      properties:
        body:
          description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language.
          example: "  forbid (\n    principal,\n    action == cloud::Action::\"cluster.createEdit\",\n    resource\n  ) when {\n   context.cluster.regions.contains(cloud::region::\"aws:us-east-1\")\n  };\n"
          readOnly: true
          type: string
        id:
          description: Unique 24-hexadecimal character string that identifies the policy.
          example: 32b6e34b3d91647abb20e7b8
          pattern: ^([a-f0-9]{24})$
          readOnly: true
          type: string
      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
    ApiAtlasResourcePolicyEditView:
      properties:
        description:
          description: Description of the atlas resource policy.
          type: string
        name:
          description: Human-readable label that describes the atlas resource policy.
          type: string
        policies:
          description: List of policies tha

# --- truncated at 32 KB (42 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/mongodb/refs/heads/main/openapi/mongodb-resource-policies-api-openapi.yml