Return All Authorized Clusters in All Projects

GET /api/atlas/v1.0/clusters

Returns the details for all clusters in all projects to which you have access. Clusters contain a group of hosts that maintain the same data set. The response does not include multi-cloud clusters. To use this resource, the requesting Service Account or API Key can have any cluster-level role.

Query parameters

  • envelope boolean

    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.

    Default value is false.

  • includeCount boolean

    Flag that indicates whether the response returns the total number of items (totalCount) in the response.

    Default value is true.

  • itemsPerPage integer

    Number of items that the response returns per page.

    Minimum value is 1, maximum value is 500. Default value is 100.

  • pageNum integer

    Number of the page that displays the current set of the total objects that the response returns.

    Minimum value is 1. Default value is 1.

  • pretty boolean

    Flag that indicates whether the response body should be in the prettyprint format.

    Default value is false.

    Prettyprint

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • results array[object]

      List of returned documents that MongoDB Cloud provides when completing this request.

      Hide results attributes Show results attributes object
      • clusters array[object]

        Settings that describe the clusters in each project that the API key is authorized to view.

        Settings that describe the clusters in each project that the API key is authorized to view.

        Hide clusters attributes Show clusters attributes object
        • alertCount integer(int32)

          Whole number that indicates the quantity of alerts open on the cluster.

        • authEnabled boolean

          Flag that indicates whether authentication is required to access the nodes in this cluster.

        • availability string

          Term that expresses how many nodes of the cluster can be accessed when MongoDB Cloud receives this request. This parameter returns available when all nodes are accessible, warning only when some nodes in the cluster can be accessed, unavailable when the cluster can't be accessed, or dead when the cluster has been deactivated.

          Values are available, dead, unavailable, or warning.

        • backupEnabled boolean

          Flag that indicates whether the cluster can perform backups. If set to true, the cluster can perform backups. You must set this value to true for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and Shared Cluster Backups for tenant clusters. If set to false, the cluster doesn't use MongoDB Cloud backups.

        • clusterId string

          Unique 24-hexadecimal character string that identifies the cluster. Each clusterId is used only once across all MongoDB Cloud deployments.

          Format should match the following pattern: ^([a-f0-9]{24})$.

        • dataSizeBytes integer(int64)

          Total size of the data stored on each node in the cluster. The resource expresses this value in bytes.

        • name string

          Human-readable label that identifies the cluster.

          Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$.

        • nodeCount integer(int32)

          Whole number that indicates the quantity of nodes that comprise the cluster.

        • sslEnabled boolean

          Flag that indicates whether TLS authentication is required to access the nodes in this cluster.

        • type string

          Human-readable label that indicates the cluster type.

          Values are REPLICA_SET or SHARDED_CLUSTER.

        • versions array[string]

          List that contains the versions of MongoDB that each node in the cluster runs.

      • groupId string

        Unique 24-hexadecimal character string that identifies the project.

      • groupName string

        Human-readable label that identifies the project.

        Format should match the following pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$.

      • orgId string

        Unique 24-hexadecimal character string that identifies the organization that contains the project.

      • orgName string

        Human-readable label that identifies the organization that contains the project.

        Format should match the following pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$.

      • planType string

        Human-readable label that indicates the plan type.

      • tags array[string]

        List of human-readable labels that categorize the specified project. MongoDB Cloud returns an empty array.

    • totalCount integer(int32)

      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.

      Minimum value is 0.

  • 401 application/json

    Unauthorized.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • reason string

      Application error message returned with this error.

  • 403 application/json

    Forbidden.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • reason string

      Application error message returned with this error.

  • 500 application/json

    Internal Server Error.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • reason string

      Application error message returned with this error.

GET /api/atlas/v1.0/clusters
curl \ --request GET 'https://cloud.mongodb.com/api/atlas/v1.0/clusters' \ --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{ "links": [ { "href": "https://cloud.mongodb.com/api/atlas", "rel": "self" } ], "results": [ { "clusters": [ { "alertCount": 42, "authEnabled": true, "availability": "available", "backupEnabled": true, "clusterId": "string", "dataSizeBytes": 42, "name": "string", "nodeCount": 42, "sslEnabled": true, "type": "REPLICA_SET", "versions": [ "string" ] } ], "groupId": "string", "groupName": "string", "orgId": "string", "orgName": "string", "planType": "string", "tags": [ "string" ] } ], "totalCount": 42 }
Response examples (401)
{ "error": 401, "detail": "(This is just an example, the exception may not be related to this endpoint)", "reason": "Unauthorized", "errorCode": "NOT_ORG_GROUP_CREATOR" }
Response examples (403)
{ "error": 403, "detail": "(This is just an example, the exception may not be related to this endpoint)", "reason": "Forbidden", "errorCode": "CANNOT_CHANGE_GROUP_NAME" }
Response examples (500)
{ "error": 500, "detail": "(This is just an example, the exception may not be related to this endpoint)", "reason": "Internal Server Error", "errorCode": "UNEXPECTED_ERROR" }