openapi: 3.0.1 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 Query Shape Insights API version: '2.0' x-xgen-sha: 3d70e065843c008b9871ea7836c98c9de6f202f9 servers: - url: https://cloud.mongodb.com security: - ServiceAccounts: [] - DigestAuth: [] tags: - name: Query Shape Insights paths: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapeInsights/summaries: get: description: Returns a list of query shape statistics summaries for a given cluster. Query shape statistics provide performance insights about MongoDB queries, helping users identify problematic query patterns and potential optimizations. operationId: listGroupClusterQueryShapeInsightSummaries parameters: - $ref: '#/components/parameters/groupId' - description: Human-readable label that identifies the cluster. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string - description: 'Date and time from which to retrieve query shape statistics. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). - If you don''t specify the **until** parameter, the endpoint returns data covering from the **since** value and the current time. - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours.' in: query name: since schema: format: int64 minimum: 1199145600000 type: integer - description: 'Date and time up until which to retrieve query shape statistics. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). - If you specify the **until** parameter, you must specify the **since** parameter. - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours.' in: query name: until schema: format: int64 minimum: 1199145600000 type: integer - description: Process IDs from which to retrieve query shape statistics. A `processId` is a combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. To include multiple `processId`, pass the parameter multiple times delimited with an ampersand (`&`) between each `processId`. in: query name: processIds schema: items: pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ type: string maxItems: 10 type: array style: form - description: 'Namespaces from which to retrieve query shape statistics. A namespace consists of one database and one collection resource written as `.`: `.`. To include multiple namespaces, pass the parameter multiple times delimited with an ampersand (`&`) between each namespace. Omit this parameter to return results for all namespaces.' in: query name: namespaces schema: items: type: string maxItems: 10 type: array style: form - description: Retrieve query shape statistics matching specified MongoDB commands. To include multiple commands, pass the parameter multiple times delimited with an ampersand (`&`) between each command. The currently supported parameters are find, distinct, and aggregate. Omit this parameter to return results for all supported commands. in: query name: commands schema: description: MongoDB commands from which to retrieve query statistics. To include multiple commands, pass the parameter multiple times delimited with an ampersand (`&`) between each command. Omit this parameter to return results for all supported commands. items: enum: - find - distinct - aggregate type: string maxItems: 3 type: array uniqueItems: true style: form - description: Maximum number of query statistic summaries to return. in: query name: nSummaries schema: default: 100 format: int64 maximum: 100 minimum: 1 type: integer - description: Query shape statistics data series to retrieve. A series represents a specific metric about query execution. To include multiple series, pass the parameter multiple times delimited with an ampersand (`&`) between each series. Omit this parameter to return results for all available series. in: query name: series schema: description: Query shape statistics data series to retrieve. A series represents a specific metric about query execution. To include multiple series, pass the parameter multiple times delimited with an ampersand (`&`) between each series. Omit this parameter to return results for all available series. items: enum: - TOTAL_EXECUTION_TIME - AVG_EXECUTION_TIME - EXECUTION_COUNT - KEYS_EXAMINED - DOCS_EXAMINED - DOCS_RETURNED - TOTAL_TIME_TO_RESPONSE - BYTES_READ - CPU_TIME - KEYS_EXAMINED_RETURNED - DOCS_EXAMINED_RETURNED - LAST_EXECUTION_TIME - P50_EXECUTION_TIME - P90_EXECUTION_TIME - P99_EXECUTION_TIME type: string maxItems: 15 type: array uniqueItems: true style: form - description: A list of SHA256 hashes of desired query shapes, output by MongoDB commands like `$queryStats` and $explain or slow query logs. To include multiple series, pass the parameter multiple times delimited with an ampersand (`&`) between each series. Omit this parameter to return results for all available series. in: query name: queryShapeHashes schema: description: A list of SHA256 hashes of desired query shapes, output by MongoDB commands like `$queryStats` and `$explain` or slow query logs. To include multiple series, pass the parameter multiple times delimited with an ampersand (`&`) between each series. Omit this parameter to return results for all available series. items: pattern: ^([a-fA-F0-9]{64})$ type: string maxItems: 10 type: array - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '200': content: application/vnd.atlas.2025-03-12+json: schema: $ref: '#/components/schemas/QueryStatsSummaryListResponse' x-xgen-version: '2025-03-12' 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 Query Statistic Summaries tags: - Query Shape Insights x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api queryShapeInsights listQueryShapeSummaries --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.ListGroupClusterQueryShapeInsightSummariesApiParams{}\n\tsdkResp, httpResp, err := client.QueryShapeInsightsApi.\n\t\tListGroupClusterQueryShapeInsightSummariesWithParams(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}/clusters/{clusterName}/queryShapeInsights/summaries?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}/clusters/{clusterName}/queryShapeInsights/summaries?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Query-Shape-Insights/operation/listGroupClusterQueryShapeInsightSummaries x-xgen-operation-id-override: listQueryShapeSummaries /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details: get: description: Returns the metadata and statistics summary for a given query shape hash. operationId: getGroupClusterQueryShapeInsightDetails parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' - $ref: '#/components/parameters/groupId' - description: Human-readable label that identifies the cluster. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string - description: 'Date and time from which to retrieve query shape statistics. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). - If you don''t specify the **until** parameter, the endpoint returns data covering from the **since** value and the current time. - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours.' in: query name: since schema: format: int64 minimum: 1199145600000 type: integer - description: 'Date and time up until which to retrieve query shape statistics. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). - If you specify the **until** parameter, you must specify the **since** parameter. - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours.' in: query name: until schema: format: int64 minimum: 1199145600000 type: integer - description: Process IDs from which to retrieve query shape statistics. A `processId` is a combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. To include multiple `processIds`, pass the parameter multiple times delimited with an ampersand (`&`) between each `processId`. in: query name: processIds schema: items: pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ type: string maxItems: 10 type: array style: form - description: A SHA256 hash of a query shape, output by MongoDB commands like `$queryStats` and `$explain` or slow query logs. in: path name: queryShapeHash required: true schema: pattern: ^([a-fA-F0-9]{64})$ type: string responses: '200': content: application/vnd.atlas.2025-03-12+json: schema: $ref: '#/components/schemas/QueryStatsDetailsResponse' x-xgen-version: '2025-03-12' 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 Query Shape Details tags: - Query Shape Insights x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api queryShapeInsights getQueryShapeDetails --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.GetGroupClusterQueryShapeInsightDetailsApiParams{}\n\tsdkResp, httpResp, err := client.QueryShapeInsightsApi.\n\t\tGetGroupClusterQueryShapeInsightDetailsWithParams(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}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details?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}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Query-Shape-Insights/operation/getGroupClusterQueryShapeInsightDetails x-xgen-operation-id-override: getQueryShapeDetails /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapes: get: description: Returns a list of query shapes for one cluster. Query shapes may be filtered by their status; at present, this endpoint supports only the REJECTED status. operationId: listGroupClusterQueryShapes parameters: - $ref: '#/components/parameters/groupId' - description: Human-readable label that identifies the cluster. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string - description: The status of query shapes to retrieve. Only REJECTED status is supported. If omitted, defaults to REJECTED. in: query name: status schema: default: REJECTED enum: - REJECTED type: string - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/includeCount' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' responses: '200': content: application/vnd.atlas.2025-03-12+json: schema: $ref: '#/components/schemas/PaginatedQueryShapes' x-xgen-version: '2025-03-12' 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 Query Shapes tags: - Query Shape Insights x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api queryShapeInsights listClusterQueryShapes --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.ListGroupClusterQueryShapesApiParams{}\n\tsdkResp, httpResp, err := client.QueryShapeInsightsApi.\n\t\tListGroupClusterQueryShapesWithParams(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}/clusters/{clusterName}/queryShapes?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}/clusters/{clusterName}/queryShapes?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Query-Shape-Insights/operation/listGroupClusterQueryShapes x-xgen-operation-id-override: listClusterQueryShapes x-xgen-version: '2025-03-12' /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapes/{queryShapeHash}: get: description: Returns the details for a single query shape. This endpoint only returns query shapes with REJECTED status. If the specified query shape hash does not correspond to a rejected query shape, a 404 Not Found error is returned. operationId: getGroupClusterQueryShape parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' - $ref: '#/components/parameters/groupId' - description: Human-readable label that identifies the cluster. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string - description: A SHA256 hash of a query shape, output by MongoDB commands like `$queryStats` and `$explain` or slow query logs. in: path name: queryShapeHash required: true schema: pattern: ^([a-fA-F0-9]{64})$ type: string responses: '200': content: application/vnd.atlas.2025-03-12+json: schema: $ref: '#/components/schemas/QueryShapeResponse' x-xgen-version: '2025-03-12' 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 Query Shape tags: - Query Shape Insights x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api queryShapeInsights getClusterQueryShape --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.GetGroupClusterQueryShapeApiParams{}\n\tsdkResp, httpResp, err := client.QueryShapeInsightsApi.\n\t\tGetGroupClusterQueryShapeWithParams(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}/clusters/{clusterName}/queryShapes/{queryShapeHash}?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}/clusters/{clusterName}/queryShapes/{queryShapeHash}?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Query-Shape-Insights/operation/getGroupClusterQueryShape x-xgen-operation-id-override: getClusterQueryShape x-xgen-version: '2025-03-12' patch: description: 'Updates the rejection status of a query shape. Use this endpoint to reject a query shape (preventing it from executing on the cluster) or to unreject a previously rejected query shape (allowing it to execute again). This operation is idempotent: rejecting an already rejected query shape or unrejecting an already unrejected query shape will return 200 OK.' operationId: updateGroupClusterQueryShape parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' - $ref: '#/components/parameters/groupId' - description: Human-readable label that identifies the cluster. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string - description: A SHA256 hash of a query shape, output by MongoDB commands like `$queryStats` and `$explain` or slow query logs. in: path name: queryShapeHash required: true schema: pattern: ^([a-fA-F0-9]{64})$ type: string requestBody: content: application/vnd.atlas.2025-03-12+json: schema: $ref: '#/components/schemas/QueryShapeUpdateRequest' description: The desired rejection status for the query shape. Provide REJECTED to block the query shape from executing, or UNREJECTED to allow it to execute. required: true responses: '200': content: application/vnd.atlas.2025-03-12+json: schema: $ref: '#/components/schemas/QueryShapeResponse' x-xgen-version: '2025-03-12' 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: Update Query Shape Rejection Status tags: - Query Shape Insights x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api queryShapeInsights updateClusterQueryShape --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.UpdateGroupClusterQueryShapeApiParams{}\n\tsdkResp, httpResp, err := client.QueryShapeInsightsApi.\n\t\tUpdateGroupClusterQueryShapeWithParams(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}/clusters/{clusterName}/queryShapes/{queryShapeHash}\" \\\n -d '{ }'" - 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}/clusters/{clusterName}/queryShapes/{queryShapeHash}\" \\\n -d '{ }'" x-rolesRequirements: - Project Data Access Admin x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Query-Shape-Insights/operation/updateGroupClusterQueryShape x-xgen-operation-id-override: updateClusterQueryShape x-xgen-version: '2025-03-12' components: responses: 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. 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. 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' 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. 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. schemas: QueryStatsDetailsResponse: description: Metadata and summary statistics for a given query shape. properties: firstSeen: $ref: '#/components/schemas/QueryShapeSeenMetadata' lastSeen: $ref: '#/components/schemas/QueryShapeSeenMetadata' queryStats: $ref: '#/components/schemas/QueryStatsSummary' type: object Link: properties: href: description: Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with `https://cloud.mongodb.com/api/atlas`. example: https://cloud.mongodb.com/api/atlas type: string rel: description: Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with `https://cloud.mongodb.com/api/atlas`. example: self type: string type: object QueryShapeSeenMetadata: description: Metadata about when a query shape was seen. properties: applicationName: description: The name of the application that this query shape came from. This can be set via the MongoDB connection string. The application name is set to unknown for internal MongoDB queries. type: string driverName: description: The name of the MongoDB driver that this query shape was executed from. The driver name is set to unknown for internal MongoDB queries. type: string driverVersion: description: The version of the MongoDB driver that this query shape was executed from. The driver version is set to unknown for internal MongoDB queries. type: string timestamp: description: Unix epoch milliseconds of the time. format: int64 type: integer 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 QueryShapeUpdateRequest: description: Request body for modifying the rejection status of a query shape. properties: status: description: The rejection status of a query shape. Use REJECTED to prevent the query shape from executing on the cluster, or UNREJECTED to allow it to execute. enum: - REJECTED - UNREJECTED type: string required: - status 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 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 QueryShapeResponse: description: Response containing the details and status of a query shape. The query shape field may be null if the user lacks PII view access. properties: command: description: The MongoDB command type issued for a query shape. enum: - FIND - DISTINCT - AGGREGATE readOnly: true type: string namespace: description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. readOnly: true type: string queryShape: description: A query shape is a set of specifications that group similar queries together. Specifications can include filters, sorts, projections, aggregation pipeline stages, a namespace, and others. Queries that have similar specifications have the same query shape. This field may be null if the user lacks PII view access. readOnly: true type: string queryShapeHash: description: A hexadecimal string that represents the hash of a MongoDB query shape. readOnly: true type: string status: description: The rejection status of a query shape. Use REJECTED to prevent the query shape from executing on the cluster, or UNREJECTED to allow it to execute. enum: - REJECTED - UNREJECTED type: string required: - queryShapeHash - status type: object QueryStatsSummaryListResponse: properties: summaries: description: List of query shape statistic summaries from Query Shape Insights. items: $ref: '#/components/schemas/QueryStatsSummary' type: array type: object QueryStatsSummary: description: A summary of execution statistics for a given query shape. properties: avgWorkingMillis: description: Average total time in milliseconds spent running queries with the given query shape. If the query resulted in `getMore` commands, this metric includes the time spent processing the `getMore` requests. This metric does not include time spent waiting for the client. format: double type: number bytesRead: description: The number of bytes read by the given query shape from the disk to the cache. format: double type: number command: description: The MongoDB command issued for this query shape. enum: - find - distinct - aggregate type: string cpuTime: description: Total CPU time in nanoseconds consumed by queries with the given query shape. Available for MDB 8.2 and higher. format: double nullable: true type: number docsExamined: description: Total number of documents examined by queries with the given query shape. format: double type: number docsExaminedRatio: description: Ratio of documents examined to documents returned by queries with the given query shape. format: double type: number docsReturned: description: Total number of documents returned by queries with the given query shape. format: double type: number execCount: description: Total number of times that queries with the given query shape have been executed. format: double type: number keysExamined: description: Total number of in-bounds and out-of-bounds index keys examined by queries with the given query shape. format: double type: number keysExaminedRatio: description: Ratio of in-bounds and out-of-bounds index keys examined to indexes containing documents returned by queries with the given query shape. format: double type: number lastExecMicros: description: Execution runtime in microseconds for the most recent query with the given query shape. format: double type: number namespace: description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. type: string p50ExecMicros: description: The 50th percentile value of execution time in microseconds. format: double type: number p90ExecMicros: description: The 90th percentile value of execution time in microseconds. format: double type: number p99ExecMicros: description: The 99th percentile value of execution time in microseconds. format: double type: number queryShape: description: A query shape is a set of specifications that group similar queries together. Specifications can include filters, sorts, projections, aggregation pipeline stages, a namespace, and others. Queries that have similar specifications have the same query shape. type: string queryShapeHash: description: A hexadecimal string that represents the hash of a MongoDB query shape. type: string systemQuery: description: Indicates whether this query shape represents a system-initiated query. type: boolean totalTimeToResponseMicros: description: Time in microseconds spent from the beginning of query processing to the first server response. format: double type: number totalWorkingMillis: description: Total time in milliseconds spent running queries with the given query shape. If the query resulted in `getMore` commands, this metric includes the time spent processing the `getMore` requests. This metric does not include time spent waiting for the client. format: double type: number type: object PaginatedQueryShapes: description: Paginated collection of query shapes. This endpoint returns a maximum of 100 results. properties: links: description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. externalDocs: description: Web Linking Specification (RFC 5988) url: https://datatracker.ietf.org/doc/html/rfc5988 items: $ref: '#/components/schemas/Link' readOnly: true type: array results: description: List of returned documents that MongoDB Cloud provides when completing this request. items: $ref: '#/components/schemas/QueryShapeResponse' readOnly: true type: array totalCount: description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. format: int32 minimum: 0 readOnly: true type: integer required: - results type: object parameters: 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 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 itemsPerPage: description: Number of items that the response returns per page. in: query name: itemsPerPage schema: default: 100 maximum: 500 minimum: 1 type: integer 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 pageNum: description: Number of the page that displays the current set of the total objects that the response returns. in: query name: pageNum schema: default: 1 minimum: 1 type: integer includeCount: description: Flag that indicates whether the response returns the total number of items (`totalCount`) in the response. in: query name: includeCount schema: default: true type: boolean headers: 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 HeaderRateLimitLimit: description: The maximum number of requests that a user can make within a specific time window. schema: type: integer HeaderRateLimitRemaining: description: The number of requests remaining in the current rate limit window before the limit is reached. 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