Return All Alerts from One Project

GET /api/atlas/v2/groups/{groupId}/alerts

Returns all alerts. These alerts apply to all components in one project. You receive an alert when a monitored component meets or exceeds a value you set. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.

This resource remains under revision and may change.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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
  • status string

    Status of the alerts to return. Omit to return all alerts in all statuses.

    Values are OPEN, TRACKING, or CLOSED.

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

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

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

      One of:

      App Services alert notifies different activities about a BAAS application.

      Hide attributes Show attributes
      • acknowledgedUntil string(date-time)

        Date and time until which this alert has been acknowledged. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if a MongoDB User previously acknowledged this alert.

        • To acknowledge this alert forever, set the parameter value to 100 years in the future.

        • To unacknowledge a previously acknowledged alert, do not set this parameter value.

        ISO 8601
      • acknowledgementComment string

        Comment that a MongoDB Cloud user submitted when acknowledging the alert.

        Maximum length is 200.

      • acknowledgingUsername string(email)

        MongoDB Cloud username of the person who acknowledged the alert. The response returns this parameter if a MongoDB Cloud user previously acknowledged this alert.

      • alertConfigId string Required

        Unique 24-hexadecimal digit string that identifies the alert configuration that sets this alert.

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

      • created string(date-time) Required

        Date and time when MongoDB Cloud created this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        ISO 8601
      • eventTypeName string Required

        Incident that triggered this alert.

        Values are URL_CONFIRMATION, SUCCESSFUL_DEPLOY, DEPLOYMENT_FAILURE, DEPLOYMENT_MODEL_CHANGE_SUCCESS, DEPLOYMENT_MODEL_CHANGE_FAILURE, REQUEST_RATE_LIMIT, LOG_FORWARDER_FAILURE, OUTSIDE_REALM_METRIC_THRESHOLD, SYNC_FAILURE, TRIGGER_FAILURE, or TRIGGER_AUTO_RESUMED.

      • groupId string

        Unique 24-hexadecimal digit string that identifies the project that owns this alert.

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

      • id string Required

        Unique 24-hexadecimal digit string that identifies this alert.

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

      • lastNotified string(date-time)

        Date and time that any notifications were last sent for this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if MongoDB Cloud has sent notifications for this alert.

        ISO 8601
      • orgId string

        Unique 24-hexadecimal character string that identifies the organization that owns the project to which this alert applies.

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

      • resolved string(date-time)

        Date and time that this alert changed to "status" : "CLOSED". This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter once "status" : "CLOSED".

        ISO 8601
      • status string Required

        State of this alert at the time you requested its details.

        Values are CANCELLED, CLOSED, OPEN, or TRACKING.

      • updated string(date-time) Required

        Date and time when someone last updated this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        ISO 8601
    • 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.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/alerts
atlas api listAlerts --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListAlertsApiParams{}
	sdkResp, httpResp, err := client.AlertsApi.
		ListAlertsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts?pretty=true"
Response examples (200)
{
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "results": [
    {
      "acknowledgedUntil": "2025-05-04T09:42:00Z",
      "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
      "acknowledgingUsername": "hello@example.com",
      "alertConfigId": "32b6e34b3d91647abb20e7b8",
      "created": "2025-05-04T09:42:00Z",
      "eventTypeName": "DEPLOYMENT_FAILURE",
      "groupId": "32b6e34b3d91647abb20e7b8",
      "id": "32b6e34b3d91647abb20e7b8",
      "lastNotified": "2025-05-04T09:42:00Z",
      "links": [
        {
          "href": "https://cloud.mongodb.com/api/atlas",
          "rel": "self"
        }
      ],
      "orgId": "32b6e34b3d91647abb20e7b8",
      "resolved": "2025-05-04T09:42:00Z",
      "status": "OPEN",
      "updated": "2025-05-04T09:42:00Z"
    }
  ],
  "totalCount": 42
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

Return One Alert from One Project

GET /api/atlas/v2/groups/{groupId}/alerts/{alertId}

Returns one alert. This alert applies to any component in one project. You receive an alert when a monitored component meets or exceeds a value you set. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return All Alerts from One Project endpoint to retrieve all alerts to which the authenticated user has access.

This resource remains under revision and may change.

Return All Alerts from One Project

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • alertId string Required

    Unique 24-hexadecimal digit string that identifies the alert.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    One of:

    App Services alert notifies different activities about a BAAS application.

    Hide attributes Show attributes
    • acknowledgedUntil string(date-time)

      Date and time until which this alert has been acknowledged. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if a MongoDB User previously acknowledged this alert.

      • To acknowledge this alert forever, set the parameter value to 100 years in the future.

      • To unacknowledge a previously acknowledged alert, do not set this parameter value.

      ISO 8601
    • acknowledgementComment string

      Comment that a MongoDB Cloud user submitted when acknowledging the alert.

      Maximum length is 200.

    • acknowledgingUsername string(email)

      MongoDB Cloud username of the person who acknowledged the alert. The response returns this parameter if a MongoDB Cloud user previously acknowledged this alert.

    • alertConfigId string Required

      Unique 24-hexadecimal digit string that identifies the alert configuration that sets this alert.

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

    • created string(date-time) Required

      Date and time when MongoDB Cloud created this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      ISO 8601
    • eventTypeName string Required

      Incident that triggered this alert.

      Values are URL_CONFIRMATION, SUCCESSFUL_DEPLOY, DEPLOYMENT_FAILURE, DEPLOYMENT_MODEL_CHANGE_SUCCESS, DEPLOYMENT_MODEL_CHANGE_FAILURE, REQUEST_RATE_LIMIT, LOG_FORWARDER_FAILURE, OUTSIDE_REALM_METRIC_THRESHOLD, SYNC_FAILURE, TRIGGER_FAILURE, or TRIGGER_AUTO_RESUMED.

    • groupId string

      Unique 24-hexadecimal digit string that identifies the project that owns this alert.

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

    • id string Required

      Unique 24-hexadecimal digit string that identifies this alert.

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

    • lastNotified string(date-time)

      Date and time that any notifications were last sent for this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if MongoDB Cloud has sent notifications for this alert.

      ISO 8601
    • orgId string

      Unique 24-hexadecimal character string that identifies the organization that owns the project to which this alert applies.

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

    • resolved string(date-time)

      Date and time that this alert changed to "status" : "CLOSED". This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter once "status" : "CLOSED".

      ISO 8601
    • status string Required

      State of this alert at the time you requested its details.

      Values are CANCELLED, CLOSED, OPEN, or TRACKING.

    • updated string(date-time) Required

      Date and time when someone last updated this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      ISO 8601
  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/alerts/{alertId}
atlas api getAlert --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetAlertApiParams{}
	sdkResp, httpResp, err := client.AlertsApi.
		GetAlertWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}?pretty=true"
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "created": "2025-05-04T09:42:00Z",
  "eventTypeName": "DEPLOYMENT_FAILURE",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "id": "32b6e34b3d91647abb20e7b8",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "orgId": "32b6e34b3d91647abb20e7b8",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "clusterName": "cluster1",
  "created": "2025-05-04T09:42:00Z",
  "eventTypeName": "CLUSTER_MONGOS_IS_MISSING",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "id": "32b6e34b3d91647abb20e7b8",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "orgId": "32b6e34b3d91647abb20e7b8",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "clusterName": "cluster1",
  "created": "2025-05-04T09:42:00Z",
  "eventTypeName": "HOST_DOWN",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "hostnameAndPort": "cloud-test.mongodb.com:27017",
  "id": "32b6e34b3d91647abb20e7b8",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "orgId": "32b6e34b3d91647abb20e7b8",
  "replicaSetName": "event-replica-set",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "clusterName": "cluster1",
  "created": "2025-05-04T09:42:00Z",
  "currentValue": {
    "number": 42.0,
    "units": "bits"
  },
  "eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "hostnameAndPort": "cloud-test.mongodb.com:27017",
  "id": "32b6e34b3d91647abb20e7b8",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "metricName": "ASSERT_USER",
  "orgId": "32b6e34b3d91647abb20e7b8",
  "replicaSetName": "event-replica-set",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "clusterName": "cluster1",
  "created": "2025-05-04T09:42:00Z",
  "eventTypeName": "NO_PRIMARY",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "hostnameAndPort": "cloud-test.mongodb.com:27017",
  "id": "32b6e34b3d91647abb20e7b8",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "nonRunningHostIds": [
    "32b6e34b3d91647abb20e7b8"
  ],
  "orgId": "32b6e34b3d91647abb20e7b8",
  "parentClusterId": "32b6e34b3d91647abb20e7b8",
  "replicaSetName": "event-replica-set",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "created": "2025-05-04T09:42:00Z",
  "eventTypeName": "HOST_DOWN",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "id": "32b6e34b3d91647abb20e7b8",
  "instanceName": "foobar",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "orgId": "32b6e34b3d91647abb20e7b8",
  "processorErrorMsg": "MongoServerError: Failed to start stream processor: (Location77175) Could not connect to the Kafka topic with kafka error code: -195, message: Local: Broker transport failure.: (Location77175)",
  "processorName": "foobar",
  "processorState": "STARTED",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
{
  "acknowledgedUntil": "2025-05-04T09:42:00Z",
  "acknowledgementComment": "Expiration on 3/19.  Silencing for 7days.",
  "acknowledgingUsername": "hello@example.com",
  "alertConfigId": "32b6e34b3d91647abb20e7b8",
  "created": "2025-05-04T09:42:00Z",
  "eventTypeName": "CREDIT_CARD_ABOUT_TO_EXPIRE",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "id": "32b6e34b3d91647abb20e7b8",
  "lastNotified": "2025-05-04T09:42:00Z",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "orgId": "32b6e34b3d91647abb20e7b8",
  "resolved": "2025-05-04T09:42:00Z",
  "status": "OPEN",
  "updated": "2025-05-04T09:42:00Z"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

























Return All Search Nodes

GET /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment

Returns the Search Nodes for the specified cluster. Deprecated versions: v2-{2024-05-30}, v2-{2023-01-01}

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Label that identifies the cluster to return the Search Nodes for.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2025-03-12+json

    OK

    Hide response attributes Show response attributes object
    • encryptionAtRestProvider string

      Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster.

      Values are NONE, AWS, AZURE, or GCP.

      Encryption at Rest using Customer Key Management
    • groupId string

      Unique 24-hexadecimal character string that identifies the project.

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

    • id string

      Unique 24-hexadecimal digit string that identifies the search deployment.

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

    • specs array[object]

      List of settings that configure the Search Nodes for your cluster. The configuration will be returned for each region and shard.

      Hide specs attributes Show specs attributes object
      • instanceSize string Required

        Hardware specification for the Search Node instance sizes.

        Values are S20_HIGHCPU_NVME, S30_HIGHCPU_NVME, S40_HIGHCPU_NVME, S50_HIGHCPU_NVME, S60_HIGHCPU_NVME, S70_HIGHCPU_NVME, S80_HIGHCPU_NVME, S30_LOWCPU_NVME, S40_LOWCPU_NVME, S50_LOWCPU_NVME, S60_LOWCPU_NVME, S70_LOWCPU_NVME, S80_LOWCPU_NVME, S90_LOWCPU_NVME, S100_LOWCPU_NVME, S110_LOWCPU_NVME, S120_LOWCPU_NVME, S130_LOWCPU_NVME, S135_LOWCPU_NVME, S140_LOWCPU_NVME, S40_STORAGE_NVME, S50_STORAGE_NVME, S60_STORAGE_NVME, S80_STORAGE_NVME, or S90_STORAGE_NVME.

      • nodeCount integer(int32) Required

        Number of Search Nodes in the cluster.

        Minimum value is 2, maximum value is 32.

    • stateName string

      Human-readable label that indicates the current operating condition of this search deployment.

      Values are IDLE, PAUSED, or UPDATING.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/clusters/{clusterName}/search/deployment
atlas api getAtlasSearchDeployment --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetAtlasSearchDeploymentApiParams{}
	sdkResp, httpResp, err := client.AtlasSearchApi.
		GetAtlasSearchDeploymentWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment?pretty=true"
Response examples (200)
{
  "encryptionAtRestProvider": "NONE",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "id": "32b6e34b3d91647abb20e7b8",
  "specs": [
    {
      "instanceSize": "S20_HIGHCPU_NVME",
      "nodeCount": 2
    }
  ],
  "stateName": "IDLE"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}








Update Search Nodes

PATCH /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment

Updates the Search Nodes for the specified cluster. Deprecated versions: v2-{2023-01-01}

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Label that identifies the cluster to update the Search Nodes for.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2024-05-30+json

Body Required

Updates the Search Nodes for the specified cluster.

  • specs array[object] Required

    List of settings that configure the Search Nodes for your cluster.

    NOTE: We accept a single configuration for all nodes currently.

    At least 1 but not more than 1 element.

    Hide specs attributes Show specs attributes object
    • instanceSize string Required

      Hardware specification for the Search Node instance sizes.

      Values are S20_HIGHCPU_NVME, S30_HIGHCPU_NVME, S40_HIGHCPU_NVME, S50_HIGHCPU_NVME, S60_HIGHCPU_NVME, S70_HIGHCPU_NVME, S80_HIGHCPU_NVME, S30_LOWCPU_NVME, S40_LOWCPU_NVME, S50_LOWCPU_NVME, S60_LOWCPU_NVME, S70_LOWCPU_NVME, S80_LOWCPU_NVME, S90_LOWCPU_NVME, S100_LOWCPU_NVME, S110_LOWCPU_NVME, S120_LOWCPU_NVME, S130_LOWCPU_NVME, S135_LOWCPU_NVME, S140_LOWCPU_NVME, S40_STORAGE_NVME, S50_STORAGE_NVME, S60_STORAGE_NVME, S80_STORAGE_NVME, or S90_STORAGE_NVME.

    • nodeCount integer(int32) Required

      Number of Search Nodes in the cluster.

      Minimum value is 2, maximum value is 32.

Responses

  • 200 application/vnd.atlas.2024-05-30+json

    OK

    Hide response attributes Show response attributes object
    • encryptionAtRestProvider string

      Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster.

      Values are NONE, AWS, AZURE, or GCP.

      Encryption at Rest using Customer Key Management
    • groupId string

      Unique 24-hexadecimal character string that identifies the project.

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

    • id string

      Unique 24-hexadecimal digit string that identifies the search deployment.

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

    • specs array[object]

      List of settings that configure the Search Nodes for your cluster. The configuration will be returned for each region and shard.

      Hide specs attributes Show specs attributes object
      • instanceSize string Required

        Hardware specification for the Search Node instance sizes.

        Values are S20_HIGHCPU_NVME, S30_HIGHCPU_NVME, S40_HIGHCPU_NVME, S50_HIGHCPU_NVME, S60_HIGHCPU_NVME, S70_HIGHCPU_NVME, S80_HIGHCPU_NVME, S30_LOWCPU_NVME, S40_LOWCPU_NVME, S50_LOWCPU_NVME, S60_LOWCPU_NVME, S70_LOWCPU_NVME, S80_LOWCPU_NVME, S90_LOWCPU_NVME, S100_LOWCPU_NVME, S110_LOWCPU_NVME, S120_LOWCPU_NVME, S130_LOWCPU_NVME, S135_LOWCPU_NVME, S140_LOWCPU_NVME, S40_STORAGE_NVME, S50_STORAGE_NVME, S60_STORAGE_NVME, S80_STORAGE_NVME, or S90_STORAGE_NVME.

      • nodeCount integer(int32) Required

        Number of Search Nodes in the cluster.

        Minimum value is 2, maximum value is 32.

    • stateName string

      Human-readable label that indicates the current operating condition of this search deployment.

      Values are IDLE, PAUSED, or UPDATING.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 409 application/json

    Conflict.

    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.

PATCH /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment
atlas api updateAtlasSearchDeployment --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.UpdateAtlasSearchDeploymentApiParams{}
	sdkResp, httpResp, err := client.AtlasSearchApi.
		UpdateAtlasSearchDeploymentWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" \
  -d '{ <Payload> }'
Request examples
{
  "specs": [
    {
      "instanceSize": "S20_HIGHCPU_NVME",
      "nodeCount": 2
    }
  ]
}
Response examples (200)
{
  "encryptionAtRestProvider": "NONE",
  "groupId": "32b6e34b3d91647abb20e7b8",
  "id": "32b6e34b3d91647abb20e7b8",
  "specs": [
    {
      "instanceSize": "S20_HIGHCPU_NVME",
      "nodeCount": 2
    }
  ],
  "stateName": "IDLE"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (409)
{
  "error": 409,
  "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",
  "reason": "Conflict",
  "errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
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"
}






















































Cloud Backups

Manages Cloud Backup snapshots, snapshot export buckets, restore jobs, and schedules. This resource applies only to clusters that use Cloud Backups.

















Return Backup Compliance Policy Settings

GET /api/atlas/v2/groups/{groupId}/backupCompliancePolicy

Returns the Backup Compliance Policy settings with the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01}

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2023-10-01+json

    OK

    Hide response attributes Show response attributes object
    • authorizedEmail string(email) Required

      Email address of the user who authorized to update the Backup Compliance Policy settings.

    • authorizedUserFirstName string Required

      First name of the user who authorized to updated the Backup Compliance Policy settings.

    • authorizedUserLastName string Required

      Last name of the user who authorized to updated the Backup Compliance Policy settings.

    • copyProtectionEnabled boolean

      Flag that indicates whether to prevent cluster users from deleting backups copied to other regions, even if those additional snapshot regions are removed. If unspecified, this value defaults to false.

      Default value is false.

    • deletable boolean

      Flag that indicates whether the Backup Compliance Policy is allowed to be disabled. It is default to false and a support ticket needs to be filed to request setting to true.

      Default value is false.

      Configure a Backup Compliance Policy
    • encryptionAtRestEnabled boolean

      Flag that indicates whether Encryption at Rest using Customer Key Management is required for all clusters with a Backup Compliance Policy. If unspecified, this value defaults to false.

      Default value is false.

      Encryption at Rest using Customer Key Management
    • onDemandPolicyItem object

      Specifications for on-demand policy.

      Hide onDemandPolicyItem attributes Show onDemandPolicyItem attributes object
      • frequencyInterval integer(int32) Required

        Number that indicates the frequency interval for a set of snapshots. MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings.

        Values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, or 40.

      • frequencyType string Required

        Human-readable label that identifies the frequency type associated with the backup policy.

        Value is ondemand.

      • id string

        Unique 24-hexadecimal digit string that identifies this backup policy item.

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

      • retentionUnit string Required

        Unit of time in which MongoDB Cloud measures snapshot retention.

        Values are days, weeks, months, or years.

      • retentionValue integer(int32) Required

        Duration in days, weeks, months, or years that MongoDB Cloud retains the snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items.

        For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item.

    • pitEnabled boolean

      Flag that indicates whether the cluster uses Continuous Cloud Backups with a Backup Compliance Policy. If unspecified, this value defaults to false.

      Default value is false.

      Continuous Cloud Backups
    • projectId string

      Unique 24-hexadecimal digit string that identifies the project for the Backup Compliance Policy.

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

    • restoreWindowDays integer(int32)

      Number of previous days that you can restore back to with Continuous Cloud Backup with a Backup Compliance Policy. You must specify a positive, non-zero integer, and the maximum retention window can't exceed the hourly retention time. This parameter applies only to Continuous Cloud Backups with a Backup Compliance Policy.

    • scheduledPolicyItems array[object]

      List that contains the specifications for one scheduled policy.

      Specifications for scheduled policy.

      Hide scheduledPolicyItems attributes Show scheduledPolicyItems attributes object
      • frequencyInterval integer(int32) Required

        Number that indicates the frequency interval for a set of Snapshots. A value of 1 specifies the first instance of the corresponding frequencyType.

        • In a yearly policy item, 1 indicates that the yearly Snapshot occurs on the first day of January and 12 indicates the first day of December.

        • In a monthly policy item, 1 indicates that the monthly Snapshot occurs on the first day of the month and 40 indicates the last day of the month.

        • In a weekly policy item, 1 indicates that the weekly Snapshot occurs on Monday and 7 indicates Sunday.

        • In an hourly policy item, you can set the frequency interval to 1, 2, 4, 6, 8, or 12. For hourly policy items for NVMe clusters, MongoDB Cloud accepts only 12 as the frequency interval value.

        MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings.

        Values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, or 40.

      • frequencyType string Required

        Human-readable label that identifies the frequency type associated with the backup policy.

        Values are daily, hourly, weekly, monthly, or yearly.

      • id string

        Unique 24-hexadecimal digit string that identifies this backup policy item.

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

      • retentionUnit string Required

        Unit of time in which MongoDB Cloud measures Snapshot retention.

        Values are days, weeks, months, or years.

      • retentionValue integer(int32) Required

        Duration in days, weeks, months, or years that MongoDB Cloud retains the Snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items.

        For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item.

    • state string

      Label that indicates the state of the Backup Compliance Policy settings. MongoDB Cloud ignores this setting when you enable or update the Backup Compliance Policy settings.

      Values are ACTIVE, ENABLING, UPDATING, or DISABLING.

    • updatedDate string(date-time)

      ISO 8601 timestamp format in UTC that indicates when the user updated the Data Protection Policy settings. MongoDB Cloud ignores this setting when you enable or update the Backup Compliance Policy settings.

    • updatedUser string(email)

      Email address that identifies the user who updated the Backup Compliance Policy settings. MongoDB Cloud ignores this email setting when you enable or update the Backup Compliance Policy settings.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/backupCompliancePolicy
atlas api getDataProtectionSettings --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetDataProtectionSettingsApiParams{}
	sdkResp, httpResp, err := client.CloudBackupsApi.
		GetDataProtectionSettingsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy?pretty=true"
Response examples (200)
{
  "authorizedEmail": "hello@example.com",
  "authorizedUserFirstName": "string",
  "authorizedUserLastName": "string",
  "copyProtectionEnabled": false,
  "deletable": false,
  "encryptionAtRestEnabled": false,
  "onDemandPolicyItem": {
    "frequencyInterval": 0,
    "frequencyType": "ondemand",
    "id": "32b6e34b3d91647abb20e7b8",
    "retentionUnit": "days",
    "retentionValue": 42
  },
  "pitEnabled": false,
  "projectId": "32b6e34b3d91647abb20e7b8",
  "restoreWindowDays": 42,
  "scheduledPolicyItems": [
    {
      "frequencyInterval": 1,
      "frequencyType": "daily",
      "id": "32b6e34b3d91647abb20e7b8",
      "retentionUnit": "days",
      "retentionValue": 42
    }
  ],
  "state": "ACTIVE",
  "updatedDate": "2025-05-04T09:42:00Z",
  "updatedUser": "hello@example.com"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}








































Remove All Cloud Backup Schedules

DELETE /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule

Removes all cloud backup schedules for the specified cluster. This schedule defines when MongoDB Cloud takes scheduled snapshots and how long it stores those snapshots. To use this resource, the requesting Service Account or API Key must have the Project Atlas Admin role. Deprecated versions: v2-{2023-01-01}

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Human-readable label that identifies the cluster.

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

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.

Responses

  • 200 application/vnd.atlas.2024-08-05+json

    OK

    Hide response attributes Show response attributes object
    • autoExportEnabled boolean

      Flag that indicates whether MongoDB Cloud automatically exports Cloud Backup Snapshots to the Export Bucket.

    • clusterId string

      Unique 24-hexadecimal digit string that identifies the cluster with the Snapshot you want to return.

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

    • clusterName string

      Human-readable label that identifies the cluster with the Snapshot you want to return.

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

    • copySettings array[object]

      List that contains a document for each copy setting item in the desired backup policy.

      Copy setting item in the desired backup policy.

      Hide copySettings attributes Show copySettings attributes object
      • cloudProvider string

        Human-readable label that identifies the cloud provider that stores the snapshot copy.

        Values are AWS, AZURE, or GCP.

      • frequencies array[string]

        List that describes which types of snapshots to copy.

        Values are HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY, or ON_DEMAND.

      • regionName string

        Target region to copy snapshots belonging to zoneId. Please supply the 'Atlas Region'.

        Cloud Provider Regions
      • shouldCopyOplogs boolean

        Flag that indicates whether to copy the oplogs to the target region. You can use the oplogs to perform point-in-time restores.

      • zoneId string Required

        Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Zone Id, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array.

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

        Return One Cluster From One Project
    • export object

      Policy for automatically exporting Cloud Backup Snapshots.

      Hide export attributes Show export attributes object
      • exportBucketId string

        Unique 24-hexadecimal character string that identifies the Export Bucket.

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

      • frequencyType string

        Human-readable label that indicates the rate at which the export policy item occurs.

        Values are monthly or yearly.

    • extraRetentionSettings array[object]

      List that contains a document for each extra retention setting item in the desired backup policy.

      extra retention setting item in the desired backup policy.

      Hide extraRetentionSettings attributes Show extraRetentionSettings attributes object
      • frequencyType string

        The frequency type for the extra retention settings for the cluster.

        Values are HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY, or ON_DEMAND.

      • retentionDays integer(int32)

        The number of extra retention days for the cluster.

    • nextSnapshot string(date-time)

      Date and time when MongoDB Cloud takes the next Snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • policies array[object]

      Rules set for this backup schedule.

      List that contains a document for each backup policy item in the desired backup policy.

      Not more than 1 element.

      Hide policies attributes Show policies attributes object
      • id string

        Unique 24-hexadecimal digit string that identifies this backup policy.

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

      • policyItems array[object]

        List that contains the specifications for one policy.

        Specifications for one policy.

        Hide policyItems attributes Show policyItems attributes object
        • frequencyInterval integer(int32) Required

          Number that indicates the frequency interval for a set of Snapshots. A value of 1 specifies the first instance of the corresponding frequencyType.

          • In a yearly policy item, 1 indicates that the yearly Snapshot occurs on the first day of January and 12 indicates the first day of December.

          • In a monthly policy item, 1 indicates that the monthly Snapshot occurs on the first day of the month and 40 indicates the last day of the month.

          • In a weekly policy item, 1 indicates that the weekly Snapshot occurs on Monday and 7 indicates Sunday.

          • In an hourly policy item, you can set the frequency interval to 1, 2, 4, 6, 8, or 12. For hourly policy items for NVMe clusters, MongoDB Cloud accepts only 12 as the frequency interval value.

          MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings.

          Values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, or 40.

        • frequencyType string Required

          Human-readable label that identifies the frequency type associated with the backup policy.

          Values are daily, hourly, weekly, monthly, yearly, or ondemand.

        • id string

          Unique 24-hexadecimal digit string that identifies this backup policy item.

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

        • retentionUnit string Required

          Unit of time in which MongoDB Cloud measures Snapshot retention.

          Values are days, weeks, months, or years.

        • retentionValue integer(int32) Required

          Duration in days, weeks, months, or years that MongoDB Cloud retains the Snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items.

          For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item.

    • referenceHourOfDay integer(int32)

      Hour of day in Coordinated Universal Time (UTC) that represents when MongoDB Cloud takes the Snapshot.

    • referenceMinuteOfHour integer(int32)

      Minute of the referenceHourOfDay that represents when MongoDB Cloud takes the Snapshot.

    • restoreWindowDays integer(int32)

      Number of previous days that you can restore back to with Continuous Cloud Backup accuracy. You must specify a positive, non-zero integer. This parameter applies to continuous Cloud Backups only.

    • useOrgAndGroupNamesInExportPrefix boolean

      Flag that indicates whether to use organization and project names instead of organization and project UUIDs in the path to the metadata files that MongoDB Cloud uploads to your Export Bucket.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

DELETE /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule
atlas api deleteAllBackupSchedules --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.DeleteAllBackupSchedulesApiParams{}
	httpResp, err := client.CloudBackupsApi.
		DeleteAllBackupSchedulesWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule"
Response examples (200)
{
  "autoExportEnabled": true,
  "clusterId": "32b6e34b3d91647abb20e7b8",
  "clusterName": "string",
  "copySettings": [
    {
      "cloudProvider": "AWS",
      "frequencies": [
        "HOURLY"
      ],
      "regionName": "string",
      "shouldCopyOplogs": true,
      "zoneId": "32b6e34b3d91647abb20e7b8"
    }
  ],
  "export": {
    "exportBucketId": "32b6e34b3d91647abb20e7b8",
    "frequencyType": "monthly"
  },
  "extraRetentionSettings": [
    {
      "frequencyType": "HOURLY",
      "retentionDays": 42
    }
  ],
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "nextSnapshot": "2025-05-04T09:42:00Z",
  "policies": [
    {
      "id": "32b6e34b3d91647abb20e7b8",
      "policyItems": [
        {
          "frequencyInterval": 1,
          "frequencyType": "daily",
          "id": "32b6e34b3d91647abb20e7b8",
          "retentionUnit": "days",
          "retentionValue": 42
        }
      ]
    }
  ],
  "referenceHourOfDay": 42,
  "referenceMinuteOfHour": 42,
  "restoreWindowDays": 42,
  "useOrgAndGroupNamesInExportPrefix": true
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

Update Cloud Backup Schedule for One Cluster

PATCH /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule

Updates the cloud backup schedule for one cluster within the specified project. This schedule defines when MongoDB Cloud takes scheduled snapshots and how long it stores those snapshots. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01}

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Human-readable label that identifies the cluster.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2024-08-05+json

Body Required

Updates the cloud backup schedule for one cluster within the specified project.

Note: In the request body, provide only the fields that you want to update.

  • autoExportEnabled boolean

    Flag that indicates whether MongoDB Cloud automatically exports Cloud Backup Snapshots to the Export Bucket.

  • copySettings array[object]

    List that contains a document for each copy setting item in the desired backup policy.

    Copy setting item in the desired backup policy.

    Hide copySettings attributes Show copySettings attributes object
    • cloudProvider string

      Human-readable label that identifies the cloud provider that stores the snapshot copy.

      Values are AWS, AZURE, or GCP.

    • frequencies array[string]

      List that describes which types of snapshots to copy.

      Values are HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY, or ON_DEMAND.

    • regionName string

      Target region to copy snapshots belonging to zoneId. Please supply the 'Atlas Region'.

      Cloud Provider Regions
    • shouldCopyOplogs boolean

      Flag that indicates whether to copy the oplogs to the target region. You can use the oplogs to perform point-in-time restores.

    • zoneId string Required

      Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Zone Id, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array.

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

      Return One Cluster From One Project
  • deleteCopiedBackups array[object]

    List that contains a document for each deleted copy setting whose backup copies you want to delete.

    Deleted copy setting whose backup copies need to also be deleted.

    Hide deleteCopiedBackups attributes Show deleteCopiedBackups attributes object
    • cloudProvider string

      Human-readable label that identifies the cloud provider for the deleted copy setting whose backup copies you want to delete.

      Values are AWS, AZURE, or GCP.

    • regionName string

      Target region for the deleted copy setting whose backup copies you want to delete. Please supply the 'Atlas Region'.

      Cloud Provider Regions
    • zoneId string

      Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Zone Id, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array.

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

      Return One Cluster from One Project
  • export object

    Policy for automatically exporting Cloud Backup Snapshots.

    Hide export attributes Show export attributes object
    • exportBucketId string

      Unique 24-hexadecimal character string that identifies the Export Bucket.

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

    • frequencyType string

      Human-readable label that indicates the rate at which the export policy item occurs.

      Values are monthly or yearly.

  • extraRetentionSettings array[object]

    List that contains a document for each extra retention setting item in the desired backup policy.

    extra retention setting item in the desired backup policy.

    Hide extraRetentionSettings attributes Show extraRetentionSettings attributes object
    • frequencyType string

      The frequency type for the extra retention settings for the cluster.

      Values are HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY, or ON_DEMAND.

    • retentionDays integer(int32)

      The number of extra retention days for the cluster.

  • policies array[object]

    Rules set for this backup schedule.

    List that contains a document for each backup policy item in the desired backup policy.

    Not more than 1 element.

    Hide policies attributes Show policies attributes object
    • id string

      Unique 24-hexadecimal digit string that identifies this backup policy.

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

    • policyItems array[object]

      List that contains the specifications for one policy.

      Specifications for one policy.

      Hide policyItems attributes Show policyItems attributes object
      • frequencyInterval integer(int32) Required

        Number that indicates the frequency interval for a set of Snapshots. A value of 1 specifies the first instance of the corresponding frequencyType.

        • In a yearly policy item, 1 indicates that the yearly Snapshot occurs on the first day of January and 12 indicates the first day of December.

        • In a monthly policy item, 1 indicates that the monthly Snapshot occurs on the first day of the month and 40 indicates the last day of the month.

        • In a weekly policy item, 1 indicates that the weekly Snapshot occurs on Monday and 7 indicates Sunday.

        • In an hourly policy item, you can set the frequency interval to 1, 2, 4, 6, 8, or 12. For hourly policy items for NVMe clusters, MongoDB Cloud accepts only 12 as the frequency interval value.

        MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings.

        Values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, or 40.

      • frequencyType string Required

        Human-readable label that identifies the frequency type associated with the backup policy.

        Values are daily, hourly, weekly, monthly, yearly, or ondemand.

      • retentionUnit string Required

        Unit of time in which MongoDB Cloud measures Snapshot retention.

        Values are days, weeks, months, or years.

      • retentionValue integer(int32) Required

        Duration in days, weeks, months, or years that MongoDB Cloud retains the Snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items.

        For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item.

  • referenceHourOfDay integer(int32)

    Hour of day in Coordinated Universal Time (UTC) that represents when MongoDB Cloud takes the Snapshot.

  • referenceMinuteOfHour integer(int32)

    Minute of the referenceHourOfDay that represents when MongoDB Cloud takes the Snapshot.

  • restoreWindowDays integer(int32)

    Number of previous days that you can restore back to with Continuous Cloud Backup accuracy. You must specify a positive, non-zero integer. This parameter applies to continuous Cloud Backups only.

  • updateSnapshots boolean

    Flag that indicates whether to apply the retention changes in the updated backup policy to Snapshots that MongoDB Cloud took previously.

  • useOrgAndGroupNamesInExportPrefix boolean

    Flag that indicates whether to use organization and project names instead of organization and project UUIDs in the path to the metadata files that MongoDB Cloud uploads to your Export Bucket.

Responses

  • 200 application/vnd.atlas.2024-08-05+json

    OK

    Hide response attributes Show response attributes object
    • autoExportEnabled boolean

      Flag that indicates whether MongoDB Cloud automatically exports Cloud Backup Snapshots to the Export Bucket.

    • clusterId string

      Unique 24-hexadecimal digit string that identifies the cluster with the Snapshot you want to return.

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

    • clusterName string

      Human-readable label that identifies the cluster with the Snapshot you want to return.

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

    • copySettings array[object]

      List that contains a document for each copy setting item in the desired backup policy.

      Copy setting item in the desired backup policy.

      Hide copySettings attributes Show copySettings attributes object
      • cloudProvider string

        Human-readable label that identifies the cloud provider that stores the snapshot copy.

        Values are AWS, AZURE, or GCP.

      • frequencies array[string]

        List that describes which types of snapshots to copy.

        Values are HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY, or ON_DEMAND.

      • regionName string

        Target region to copy snapshots belonging to zoneId. Please supply the 'Atlas Region'.

        Cloud Provider Regions
      • shouldCopyOplogs boolean

        Flag that indicates whether to copy the oplogs to the target region. You can use the oplogs to perform point-in-time restores.

      • zoneId string Required

        Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Zone Id, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array.

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

        Return One Cluster From One Project
    • export object

      Policy for automatically exporting Cloud Backup Snapshots.

      Hide export attributes Show export attributes object
      • exportBucketId string

        Unique 24-hexadecimal character string that identifies the Export Bucket.

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

      • frequencyType string

        Human-readable label that indicates the rate at which the export policy item occurs.

        Values are monthly or yearly.

    • extraRetentionSettings array[object]

      List that contains a document for each extra retention setting item in the desired backup policy.

      extra retention setting item in the desired backup policy.

      Hide extraRetentionSettings attributes Show extraRetentionSettings attributes object
      • frequencyType string

        The frequency type for the extra retention settings for the cluster.

        Values are HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY, or ON_DEMAND.

      • retentionDays integer(int32)

        The number of extra retention days for the cluster.

    • nextSnapshot string(date-time)

      Date and time when MongoDB Cloud takes the next Snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • policies array[object]

      Rules set for this backup schedule.

      List that contains a document for each backup policy item in the desired backup policy.

      Not more than 1 element.

      Hide policies attributes Show policies attributes object
      • id string

        Unique 24-hexadecimal digit string that identifies this backup policy.

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

      • policyItems array[object]

        List that contains the specifications for one policy.

        Specifications for one policy.

        Hide policyItems attributes Show policyItems attributes object
        • frequencyInterval integer(int32) Required

          Number that indicates the frequency interval for a set of Snapshots. A value of 1 specifies the first instance of the corresponding frequencyType.

          • In a yearly policy item, 1 indicates that the yearly Snapshot occurs on the first day of January and 12 indicates the first day of December.

          • In a monthly policy item, 1 indicates that the monthly Snapshot occurs on the first day of the month and 40 indicates the last day of the month.

          • In a weekly policy item, 1 indicates that the weekly Snapshot occurs on Monday and 7 indicates Sunday.

          • In an hourly policy item, you can set the frequency interval to 1, 2, 4, 6, 8, or 12. For hourly policy items for NVMe clusters, MongoDB Cloud accepts only 12 as the frequency interval value.

          MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings.

          Values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, or 40.

        • frequencyType string Required

          Human-readable label that identifies the frequency type associated with the backup policy.

          Values are daily, hourly, weekly, monthly, yearly, or ondemand.

        • id string

          Unique 24-hexadecimal digit string that identifies this backup policy item.

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

        • retentionUnit string Required

          Unit of time in which MongoDB Cloud measures Snapshot retention.

          Values are days, weeks, months, or years.

        • retentionValue integer(int32) Required

          Duration in days, weeks, months, or years that MongoDB Cloud retains the Snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items.

          For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item.

    • referenceHourOfDay integer(int32)

      Hour of day in Coordinated Universal Time (UTC) that represents when MongoDB Cloud takes the Snapshot.

    • referenceMinuteOfHour integer(int32)

      Minute of the referenceHourOfDay that represents when MongoDB Cloud takes the Snapshot.

    • restoreWindowDays integer(int32)

      Number of previous days that you can restore back to with Continuous Cloud Backup accuracy. You must specify a positive, non-zero integer. This parameter applies to continuous Cloud Backups only.

    • useOrgAndGroupNamesInExportPrefix boolean

      Flag that indicates whether to use organization and project names instead of organization and project UUIDs in the path to the metadata files that MongoDB Cloud uploads to your Export Bucket.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

PATCH /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule
atlas api updateBackupSchedule --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.UpdateBackupScheduleApiParams{}
	sdkResp, httpResp, err := client.CloudBackupsApi.
		UpdateBackupScheduleWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule" \
  -d '{ <Payload> }'
Request examples
{
  "autoExportEnabled": true,
  "copySettings": [
    {
      "cloudProvider": "AWS",
      "frequencies": [
        "HOURLY"
      ],
      "regionName": "string",
      "shouldCopyOplogs": true,
      "zoneId": "32b6e34b3d91647abb20e7b8"
    }
  ],
  "deleteCopiedBackups": [
    {
      "cloudProvider": "AWS",
      "regionName": "string",
      "zoneId": "32b6e34b3d91647abb20e7b8"
    }
  ],
  "export": {
    "exportBucketId": "32b6e34b3d91647abb20e7b8",
    "frequencyType": "monthly"
  },
  "extraRetentionSettings": [
    {
      "frequencyType": "HOURLY",
      "retentionDays": 42
    }
  ],
  "policies": [
    {
      "id": "32b6e34b3d91647abb20e7b8",
      "policyItems": [
        {
          "frequencyInterval": 1,
          "frequencyType": "daily",
          "retentionUnit": "days",
          "retentionValue": 42
        }
      ]
    }
  ],
  "referenceHourOfDay": 42,
  "referenceMinuteOfHour": 42,
  "restoreWindowDays": 42,
  "updateSnapshots": true,
  "useOrgAndGroupNamesInExportPrefix": true
}
Response examples (200)
{
  "autoExportEnabled": true,
  "clusterId": "32b6e34b3d91647abb20e7b8",
  "clusterName": "string",
  "copySettings": [
    {
      "cloudProvider": "AWS",
      "frequencies": [
        "HOURLY"
      ],
      "regionName": "string",
      "shouldCopyOplogs": true,
      "zoneId": "32b6e34b3d91647abb20e7b8"
    }
  ],
  "export": {
    "exportBucketId": "32b6e34b3d91647abb20e7b8",
    "frequencyType": "monthly"
  },
  "extraRetentionSettings": [
    {
      "frequencyType": "HOURLY",
      "retentionDays": 42
    }
  ],
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "nextSnapshot": "2025-05-04T09:42:00Z",
  "policies": [
    {
      "id": "32b6e34b3d91647abb20e7b8",
      "policyItems": [
        {
          "frequencyInterval": 1,
          "frequencyType": "daily",
          "id": "32b6e34b3d91647abb20e7b8",
          "retentionUnit": "days",
          "retentionValue": 42
        }
      ]
    }
  ],
  "referenceHourOfDay": 42,
  "referenceMinuteOfHour": 42,
  "restoreWindowDays": 42,
  "useOrgAndGroupNamesInExportPrefix": true
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}












Remove One Sharded Cluster Cloud Backup

DELETE /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}

Removes one snapshot of one sharded cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Human-readable label that identifies the cluster.

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

  • snapshotId string Required

    Unique 24-hexadecimal digit string that identifies the desired snapshot.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 204 application/vnd.atlas.2023-01-01+json

    This endpoint does not return a response body.

  • 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.

  • 404 application/json

    Not Found.

    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.

DELETE /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}
atlas api deleteShardedClusterBackup --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.DeleteShardedClusterBackupApiParams{}
	httpResp, err := client.CloudBackupsApi.
		DeleteShardedClusterBackupWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}"
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}





































Migrate One Local Managed Cluster to MongoDB Atlas

POST /api/atlas/v2/groups/{groupId}/liveMigrations

Migrate one cluster that Cloud or Ops Manager manages to MongoDB Atlas.

Please make sure to validate your migration before initiating it.

You can use this API endpoint for push live migrations only. Your API Key must have the Organization Owner role to successfully call this resource.

NOTE: Migrating time-series collections is not yet supported on MongoDB 6.0 or higher. Migrations on MongoDB 6.0 or higher will skip any time-series collections on the source cluster. Deprecated versions: v2-{2023-01-01}

Validate Migration

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2024-05-30+json

Body Required

One migration to be created.

  • destination object Required

    Document that describes the destination of the migration.

    Hide destination attributes Show destination attributes object
    • clusterName string Required

      Label that identifies the destination cluster.

    • groupId string Required

      Unique 24-hexadecimal digit string that identifies the destination project.

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

    • hostnameSchemaType string Required

      The network type to use between the migration host and the destination cluster.

      Values are PUBLIC, PRIVATE_LINK, or VPC_PEERING.

    • privateLinkId string

      Represents the endpoint to use when the host schema type is PRIVATE_LINK.

  • dropDestinationData boolean

    Flag that indicates whether the migration process drops all collections from the destination cluster before the migration starts.

    Default value is false.

  • migrationHosts array[string]

    List of migration hosts used for this migration.

    At least 1 but not more than 1 element.

  • sharding object

    Document that configures sharding on the destination cluster when migrating from a replica set source to a sharded cluster destination on MongoDB 6.0 or higher. If you don't wish to shard any collections on the destination cluster, leave this empty.

    Hide sharding attributes Show sharding attributes object
    • createSupportingIndexes boolean Required

      Flag that lets the migration create supporting indexes for the shard keys, if none exists, as the destination cluster also needs compatible indexes for the specified shard keys.

    • shardingEntries array[object]

      List of shard configurations to shard destination collections. Atlas shards only those collections that you include in the sharding entries array.

      Sharding configuration for a collection to be sharded on the destination cluster.

      Hide shardingEntries attributes Show shardingEntries attributes object
      • collection string Required

        Human-readable label that identifies the collection to be sharded on the destination cluster.

      • database string Required

        Human-readable label that identifies the database that contains the collection to be sharded on the destination cluster.

      • shardCollection object Required

        Document that configures the shard key on the destination cluster.

        Hide shardCollection attribute Show shardCollection attribute object
        • key array[object]

          List of fields to use for the shard key.

          Hide key attribute Show key attribute object
          • * object Additional properties
  • source object Required

    Document that describes the source of the migration.

    Hide source attributes Show source attributes object
    • caCertificatePath string

      Path to the CA certificate that signed SSL certificates use to authenticate to the source cluster.

    • clusterName string Required

      Label that identifies the source cluster name.

    • groupId string Required

      Unique 24-hexadecimal digit string that identifies the source project.

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

    • managedAuthentication boolean Required

      Flag that indicates whether MongoDB Automation manages authentication to the source cluster. If true, do not provide values for username and password.

    • password string

      Password that authenticates the username to the source cluster.

    • ssl boolean Required

      Flag that indicates whether you have SSL enabled.

    • username string

      Label that identifies the SCRAM-SHA user that connects to the source cluster.

Responses

  • 201 application/vnd.atlas.2024-05-30+json

    Created

    Hide response attributes Show response attributes object
    • _id string

      Unique 24-hexadecimal digit string that identifies the migration job.

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

    • lagTimeSeconds integer(int64) | null

      Replication lag between the source and destination clusters. Atlas returns this setting only during an active migration, before the cutover phase.

    • migrationHosts array[string]

      List of hosts running MongoDB Agents. These Agents can transfer your MongoDB data between one source and one destination cluster.

      Format of each should match the following 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]+)?$.

    • readyForCutover boolean

      Flag that indicates the migrated cluster can be cut over to MongoDB Atlas.

    • status string

      Progress made in migrating one cluster to MongoDB Atlas.

      NEW: Someone scheduled a local cluster migration to MongoDB Atlas.

      FAILED: The cluster migration to MongoDB Atlas failed.

      COMPLETE: The cluster migration to MongoDB Atlas succeeded.

      EXPIRED: MongoDB Atlas prepares to begin the cut over of the migrating cluster when source and destination clusters have almost synchronized. If "readyForCutover" : true, this synchronization starts a timer of 120 hours. You can extend this timer. If the timer expires, MongoDB Atlas returns this status.

      WORKING: The cluster migration to MongoDB Atlas is performing one of the following tasks:

      • Preparing connections to source and destination clusters.
      • Replicating data from source to destination.
      • Verifying MongoDB Atlas connection settings.
      • Stopping replication after the cut over.

      Values are NEW, WORKING, FAILED, COMPLETE, or EXPIRED.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

POST /api/atlas/v2/groups/{groupId}/liveMigrations
atlas api createPushMigration --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.CreatePushMigrationApiParams{}
	sdkResp, httpResp, err := client.CloudMigrationServiceApi.
		CreatePushMigrationWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations" \
  -d '{ <Payload> }'
Request examples
{
  "destination": {
    "clusterName": "string",
    "groupId": "32b6e34b3d91647abb20e7b8",
    "hostnameSchemaType": "PUBLIC",
    "privateLinkId": "string"
  },
  "dropDestinationData": false,
  "migrationHosts": [
    "vm001.example.com"
  ],
  "sharding": {
    "createSupportingIndexes": true,
    "shardingEntries": [
      {
        "collection": "string",
        "database": "string",
        "shardCollection": {
          "key": [
            {
              "additionalProperty1": {},
              "additionalProperty2": {}
            }
          ]
        }
      }
    ]
  },
  "source": {
    "caCertificatePath": "string",
    "clusterName": "string",
    "groupId": "32b6e34b3d91647abb20e7b8",
    "managedAuthentication": true,
    "password": "string",
    "ssl": true,
    "username": "string"
  }
}
Response examples (201)
{
  "_id": "32b6e34b3d91647abb20e7b8",
  "lagTimeSeconds": 42,
  "migrationHosts": [
    "vm001.example.com"
  ],
  "readyForCutover": true,
  "status": "NEW"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}




















Create One Link-Token

POST /api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens

Create one link-token that contains all the information required to complete the link. MongoDB Atlas uses the link-token for push live migrations only. Live migration (push) allows you to securely push data from Cloud Manager or Ops Manager into MongoDB Atlas. Your API Key must have the Organization Owner role to successfully call this resource.

Path parameters

  • orgId string Required

    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2023-01-01+json

Body Required

IP address access list entries associated with the migration.

  • accessListIps array[string]

    IP address access list entries associated with the API key.

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attribute Show response attribute object
    • linkToken string Required

      Link token that contains all the information required to complete the link.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

POST /api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens
atlas api createLinkToken --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.CreateLinkTokenApiParams{}
	sdkResp, httpResp, err := client.CloudMigrationServiceApi.
		CreateLinkTokenWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens" \
  -d '{ <Payload> }'
Request examples
{
  "accessListIps": [
    "string"
  ]
}
Response examples (200)
{
  "linkToken": "string"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

Remove One Link-Token

DELETE /api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens

Remove one organization link and its associated public API key. MongoDB Atlas uses the link-token for push live migrations only. Live migrations (push) let you securely push data from Cloud Manager or Ops Manager into MongoDB Atlas. Your API Key must have the Organization Owner role to successfully call this resource.

Path parameters

  • orgId string Required

    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.

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

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.

Responses

  • 204 application/vnd.atlas.2023-01-01+json

    This endpoint does not return a response body.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

DELETE /api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens
atlas api deleteLinkToken --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.DeleteLinkTokenApiParams{}
	httpResp, err := client.CloudMigrationServiceApi.
		DeleteLinkTokenWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens"
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}



































Return All Authorized Clusters in All Projects

GET /api/atlas/v2/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/vnd.atlas.2023-01-01+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.

atlas api listClustersForAllProjects --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListClustersForAllProjectsApiParams{}
	sdkResp, httpResp, err := client.ClustersApi.
		ListClustersForAllProjectsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/clusters?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/clusters?pretty=true"
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"
}
































Return Auto Scaling Configuration for One Sharded Cluster Deprecated

GET /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration

Returns the internal configuration of AutoScaling for sharded clusters. This endpoint can be used for diagnostic purposes to ensure that sharded clusters updated from older APIs have gained support for AutoScaling each shard independently.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Human-readable label that identifies this cluster.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2024-08-05+json

    OK

    Hide response attribute Show response attribute object
    • autoScalingMode string

      Describes whether cluster nodes scale together across all shards or independently.

      Values are INDEPENDENT_SHARD_SCALING or CLUSTER_WIDE_SCALING.

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 409 application/json

    Conflict.

    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/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration
atlas api autoScalingConfiguration --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.AutoScalingConfigurationApiParams{}
	sdkResp, httpResp, err := client.ClustersApi.
		AutoScalingConfigurationWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration?pretty=true"
Response examples (200)
{
  "autoScalingMode": "INDEPENDENT_SHARD_SCALING"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (409)
{
  "error": 409,
  "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",
  "reason": "Conflict",
  "errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
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"
}




































Return Status of Sample Dataset Load for One Cluster

GET /api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}

Checks the progress of loading the sample dataset into one cluster. To use this resource, the requesting Service Account or API Key must have the Project Owner role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • sampleDatasetId string Required

    Unique 24-hexadecimal digit string that identifies the loaded sample dataset.

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

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.

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attributes Show response attributes object
    • _id string

      Unique 24-hexadecimal character string that identifies this sample dataset.

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

    • clusterName string

      Human-readable label that identifies the cluster into which you loaded the sample dataset.

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

    • completeDate string(date-time)

      Date and time when the sample dataset load job completed. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.

    • createDate string(date-time)

      Date and time when you started the sample dataset load job. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.

    • errorMessage string

      Details of the error returned when MongoDB Cloud loads the sample dataset. This endpoint returns null if state has a value other than FAILED.

    • state string

      Status of the sample dataset load job.

      Values are WORKING, FAILED, or COMPLETED.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}
atlas api getSampleDatasetLoadStatus --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetSampleDatasetLoadStatusApiParams{}
	sdkResp, httpResp, err := client.ClustersApi.
		GetSampleDatasetLoadStatusWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}?pretty=true"
Response examples (200)
{
  "_id": "32b6e34b3d91647abb20e7b8",
  "clusterName": "string",
  "completeDate": "2025-05-04T09:42:00Z",
  "createDate": "2025-05-04T09:42:00Z",
  "errorMessage": "string",
  "state": "WORKING"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}



























































Return All Federated Database Instances in One Project

GET /api/atlas/v2/groups/{groupId}/dataFederation

Returns the details of all federated database instances in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only or higher role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
  • type string

    Type of Federated Database Instances to return.

    Values are USER or ONLINE_ARCHIVE. Default value is USER.

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attributes Show response attributes object
    • cloudProviderConfig object

      Cloud provider where this Federated Database Instance is hosted.

      Hide cloudProviderConfig attributes Show cloudProviderConfig attributes object
      • aws object

        Configuration for running Data Federation in AWS.

        Hide aws attributes Show aws attributes object
        • externalId string

          Unique identifier associated with the Identity and Access Management (IAM) role that the data lake assumes when accessing the data stores.

        • iamAssumedRoleARN string

          Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that the data lake assumes when accessing data stores.

          Minimum length is 20, maximum length is 2048.

        • iamUserARN string

          Amazon Resource Name (ARN) of the user that the data lake assumes when accessing data stores.

        • roleId string Required

          Unique identifier of the role that the data lake can use to access the data stores.Required if specifying cloudProviderConfig.

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

      • azure object

        Configuration for running Data Federation in Azure.

        Hide azure attributes Show azure attributes object
        • atlasAppId string

          The App ID generated by Atlas for the Service Principal's access policy.

        • roleId string Required

          Unique identifier of the role that Data Federation can use to access the data stores. Required if specifying cloudProviderConfig.

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

        • servicePrincipalId string

          The ID of the Service Principal for which there is an access policy for Atlas to access Azure resources.

        • tenantId string

          The Azure Active Directory / Entra ID tenant ID associated with the Service Principal.

      • gcp object

        Configuration for running Data Federation in GCP.

        Hide gcp attributes Show gcp attributes object
        • gcpServiceAccount string

          The email address of the Google Cloud Platform (GCP) service account created by Atlas which should be authorized to allow Atlas to access Google Cloud Storage.

        • roleId string Required

          Unique identifier of the role that Data Federation can use to access the data stores. Required if specifying cloudProviderConfig.

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

    • dataProcessRegion object

      Information about the cloud provider region to which the Federated Database Instance routes client connections.

      Hide dataProcessRegion attributes Show dataProcessRegion attributes object
      • cloudProvider string Required

        Name of the cloud service that hosts the Federated Database Instance's infrastructure.

        Values are AWS, AZURE, or GCP.

      • region string Required

        Name of the region to which the data lake routes client connections.

        One of:

        Atlas Data Federation AWS Regions.

        Values are SYDNEY_AUS, MUMBAI_IND, FRANKFURT_DEU, DUBLIN_IRL, LONDON_GBR, VIRGINIA_USA, OREGON_USA, SAOPAULO_BRA, MONTREAL_CAN, TOKYO_JPN, or SINGAPORE_SGP.

    • groupId string

      Unique 24-hexadecimal character string that identifies the project.

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

    • hostnames array[string]

      List that contains the hostnames assigned to the Federated Database Instance.

    • name string

      Human-readable label that identifies the Federated Database Instance.

    • privateEndpointHostnames array[object]

      List that contains the sets of private endpoints and hostnames.

      Set of Private endpoint and hostnames.

      Hide privateEndpointHostnames attributes Show privateEndpointHostnames attributes object
      • hostname string

        Human-readable label that identifies the hostname.

      • privateEndpoint string

        Human-readable label that identifies private endpoint.

    • state string

      Label that indicates the status of the Federated Database Instance.

      Values are UNVERIFIED, ACTIVE, or DELETED.

    • storage object

      Configuration information for each data store and its mapping to MongoDB Cloud databases.

      Hide storage attributes Show storage attributes object
      • databases array[object]

        Array that contains the queryable databases and collections for this data lake.

        Database associated with this data lake. Databases contain collections and views.

        Hide databases attributes Show databases attributes object
        • collections array[object]

          Array of collections and data sources that map to a stores data store.

          A collection and data sources that map to a stores data store.

          Hide collections attributes Show collections attributes object
          • dataSources array[object]

            Array that contains the data stores that map to a collection for this data lake.

            Data store that maps to a collection for this data lake.

            Hide dataSources attributes Show dataSources attributes object
            • allowInsecure boolean

              Flag that validates the scheme in the specified URLs. If true, allows insecure HTTP scheme, doesn't verify the server's certificate chain and hostname, and accepts any certificate with any hostname presented by the server. If false, allows secure HTTPS scheme only.

              Default value is false.

            • collection string

              Human-readable label that identifies the collection in the database. For creating a wildcard (*) collection, you must omit this parameter.

            • collectionRegex string

              Regex pattern to use for creating the wildcard (*) collection. To learn more about the regex syntax, see Go programming language.

            • database string

              Human-readable label that identifies the database, which contains the collection in the cluster. You must omit this parameter to generate wildcard (*) collections for dynamically generated databases.

            • databaseRegex string

              Regex pattern to use for creating the wildcard (*) database. To learn more about the regex syntax, see Go programming language.

            • datasetName string

              Human-readable label that identifies the dataset that Atlas generates for an ingestion pipeline run or Online Archive.

            • datasetPrefix string

              Human-readable label that matches against the dataset names for ingestion pipeline runs or Online Archives.

            • defaultFormat string

              File format that MongoDB Cloud uses if it encounters a file without a file extension while searching storeName.

              Values are .avro, .avro.bz2, .avro.gz, .bson, .bson.bz2, .bson.gz, .bsonx, .csv, .csv.bz2, .csv.gz, .json, .json.bz2, .json.gz, .orc, .parquet, .tsv, .tsv.bz2, or .tsv.gz.

            • path string

              File path that controls how MongoDB Cloud searches for and parses files in the storeName before mapping them to a collection.Specify / to capture all files and folders from the prefix path.

            • provenanceFieldName string

              Name for the field that includes the provenance of the documents in the results. MongoDB Cloud returns different fields in the results for each supported provider.

            • storeName string

              Human-readable label that identifies the data store that MongoDB Cloud maps to the collection.

            • trimLevel integer(int32)

              Unsigned integer that specifies how many fields of the dataset name to trim from the left of the dataset name before mapping the remaining fields to a wildcard collection name.

            • urls array[string]

              URLs of the publicly accessible data files. You can't specify URLs that require authentication. Atlas Data Lake creates a partition for each URL. If empty or omitted, Data Lake uses the URLs from the store specified in the dataSources.storeName parameter.

          • name string

            Human-readable label that identifies the collection to which MongoDB Cloud maps the data in the data stores.

        • maxWildcardCollections integer(int32)

          Maximum number of wildcard collections in the database. This only applies to S3 data sources.

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

        • name string

          Human-readable label that identifies the database to which the data lake maps data.

        • views array[object]

          Array of aggregation pipelines that apply to the collection. This only applies to S3 data sources.

          An aggregation pipeline that applies to the collection.

          Hide views attributes Show views attributes object
          • name string

            Human-readable label that identifies the view, which corresponds to an aggregation pipeline on a collection.

          • pipeline string

            Aggregation pipeline stages to apply to the source collection.

            Aggregation Pipelines
          • source string

            Human-readable label that identifies the source collection for the view.

      • stores array[object]

        Array that contains the data stores for the data lake.

        One of:

        Group of settings that define where the data is stored.

        Hide attributes Show attributes
        • name string

          Human-readable label that identifies the data store. The databases.[n].collections.[n].dataSources.[n].storeName field references this values as part of the mapping configuration. To use MongoDB Cloud as a data store, the data lake requires a serverless instance or an M10 or higher cluster.

        • provider string Required Discriminator

          Value is object.

        • additionalStorageClasses array[string]

          Collection of AWS S3 storage classes. Atlas Data Lake includes the files in these storage classes in the query results.

          Values are STANDARD, INTELLIGENT_TIERING, or STANDARD_IA.

        • bucket string

          Human-readable label that identifies the AWS S3 bucket. This label must exactly match the name of an S3 bucket that the data lake can access with the configured AWS Identity and Access Management (IAM) credentials.

        • delimiter string

          The delimiter that separates databases.[n].collections.[n].dataSources.[n].path segments in the data store. MongoDB Cloud uses the delimiter to efficiently traverse S3 buckets with a hierarchical directory structure. You can specify any character supported by the S3 object keys as the delimiter. For example, you can specify an underscore () or a plus sign (+) or multiple characters, such as double underscores (_) as the delimiter. If omitted, defaults to /.

        • includeTags boolean

          Flag that indicates whether to use S3 tags on the files in the given path as additional partition attributes. If set to true, data lake adds the S3 tags as additional partition attributes and adds new top-level BSON elements associating each tag to each document.

          Default value is false.

        • prefix string

          Prefix that MongoDB Cloud applies when searching for files in the S3 bucket. The data store prepends the value of prefix to the databases.[n].collections.[n].dataSources.[n].path to create the full path for files to ingest. If omitted, MongoDB Cloud searches all files from the root of the S3 bucket.

        • public boolean

          Flag that indicates whether the bucket is public. If set to true, MongoDB Cloud doesn't use the configured AWS Identity and Access Management (IAM) role to access the S3 bucket. If set to false, the configured AWS IAM role must include permissions to access the S3 bucket.

          Default value is false.

        • region string

          Physical location where MongoDB Cloud deploys your AWS-hosted MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. MongoDB Cloud assigns the VPC a CIDR block. To limit a new VPC peering connection to one CIDR block and region, create the connection first. Deploy the cluster after the connection starts.

          Values are US_GOV_WEST_1, US_GOV_EAST_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, CA_CENTRAL_1, EU_NORTH_1, EU_WEST_1, EU_WEST_2, EU_WEST_3, EU_CENTRAL_1, EU_CENTRAL_2, AP_EAST_1, AP_NORTHEAST_1, AP_NORTHEAST_2, AP_NORTHEAST_3, AP_SOUTHEAST_1, AP_SOUTHEAST_2, AP_SOUTHEAST_3, AP_SOUTHEAST_4, AP_SOUTH_1, AP_SOUTH_2, SA_EAST_1, CN_NORTH_1, CN_NORTHWEST_1, ME_SOUTH_1, ME_CENTRAL_1, AF_SOUTH_1, EU_SOUTH_1, EU_SOUTH_2, IL_CENTRAL_1, CA_WEST_1, or GLOBAL.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/dataFederation
atlas api listFederatedDatabases --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListFederatedDatabasesApiParams{}
	sdkResp, httpResp, err := client.DataFederationApi.
		ListFederatedDatabasesWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation?pretty=true"
Response examples (200)
[
  {
    "cloudProviderConfig": {
      "aws": {
        "externalId": "string",
        "iamAssumedRoleARN": "arn:aws:iam::123456789012:root",
        "iamUserARN": "string",
        "roleId": "32b6e34b3d91647abb20e7b8"
      },
      "azure": {
        "atlasAppId": "string",
        "roleId": "32b6e34b3d91647abb20e7b8",
        "servicePrincipalId": "string",
        "tenantId": "string"
      },
      "gcp": {
        "gcpServiceAccount": "string",
        "roleId": "32b6e34b3d91647abb20e7b8"
      }
    },
    "dataProcessRegion": {
      "cloudProvider": "AWS",
      "": "SYDNEY_AUS"
    },
    "groupId": "32b6e34b3d91647abb20e7b8",
    "hostnames": [
      "string"
    ],
    "name": "string",
    "privateEndpointHostnames": [
      {
        "hostname": "string",
        "privateEndpoint": "string"
      }
    ],
    "state": "UNVERIFIED",
    "storage": {
      "databases": [
        {
          "collections": [
            {
              "dataSources": [
                {
                  "allowInsecure": false,
                  "collection": "string",
                  "collectionRegex": "string",
                  "database": "string",
                  "databaseRegex": "string",
                  "datasetName": "v1$atlas$snapshot$Cluster0$myDatabase$myCollection$19700101T000000Z",
                  "datasetPrefix": "string",
                  "defaultFormat": ".avro",
                  "path": "string",
                  "provenanceFieldName": "string",
                  "storeName": "string",
                  "trimLevel": 42,
                  "urls": [
                    "string"
                  ]
                }
              ],
              "name": "string"
            }
          ],
          "maxWildcardCollections": 100,
          "name": "string",
          "views": [
            {
              "name": "string",
              "pipeline": "string",
              "source": "string"
            }
          ]
        }
      ],
      "stores": [
        {
          "name": "string",
          "provider": "object",
          "additionalStorageClasses": [
            "STANDARD"
          ],
          "bucket": "string",
          "delimiter": "string",
          "includeTags": false,
          "prefix": "string",
          "public": false,
          "region": "US_GOV_WEST_1"
        }
      ]
    }
  }
]
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}




































Return All Federated Database Instance and Online Archive Private Endpoints in One Project

GET /api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds

Returns all private endpoints for Federated Database Instances and Online Archives in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only or Project Charts Admin roles.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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/vnd.atlas.2023-01-01+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
      • azureLinkId string

        Link ID that identifies the Azure private endpoint connection.

      • comment string

        Human-readable string to associate with this private endpoint.

      • customerEndpointDNSName string

        Human-readable label to identify customer's VPC endpoint DNS name. If defined, you must also specify a value for region.

      • customerEndpointIPAddress string

        IP address used to connect to the Azure private endpoint.

        Format should match the following pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$.

      • endpointId string Required

        Unique 22-character alphanumeric string that identifies the private endpoint.

        Format should match the following pattern: ^vpce-[0-9a-f]{17}$.

        Atlas Data Lake supports Amazon Web Services private endpoints using the AWS PrivateLink feature
      • errorMessage string

        Error message describing a failure approving the private endpoint request.

      • provider string

        Human-readable label that identifies the cloud service provider. Atlas Data Lake supports Amazon Web Services only.

        Value is AWS. Default value is AWS.

      • region string

        Human-readable label to identify the region of customer's VPC endpoint. If defined, you must also specify a value for customerEndpointDNSName.

      • status string

        Status of the private endpoint connection request.

        Values are PENDING, OK, FAILED, or DELETING.

      • type string

        Human-readable label that identifies the resource type associated with this private endpoint.

        Value is DATA_LAKE. Default value is DATA_LAKE.

    • 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.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/privateNetworkSettings/endpointIds
atlas api listDataFederationPrivateEndpoints --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListDataFederationPrivateEndpointsApiParams{}
	sdkResp, httpResp, err := client.DataFederationApi.
		ListDataFederationPrivateEndpointsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds?pretty=true"
Response examples (200)
{
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "results": [
    {
      "azureLinkId": "string",
      "comment": "string",
      "customerEndpointDNSName": "string",
      "customerEndpointIPAddress": "string",
      "endpointId": "vpce-3bf78b0ddee411ba1",
      "errorMessage": "string",
      "provider": "AWS",
      "region": "US_EAST_1",
      "status": "PENDING",
      "type": "DATA_LAKE"
    }
  ],
  "totalCount": 42
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}













































Resume One Data Lake Pipeline Deprecated

POST /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume

Resumes ingestion for a Data Lake Pipeline within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • pipelineName string Required

    Human-readable label that identifies the Data Lake Pipeline.

    Format should match the following pattern: ^[^/\\ "$]{1,64}$.

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attributes Show response attributes object
    • _id string

      Unique 24-hexadecimal digit string that identifies the Data Lake Pipeline.

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

    • createdDate string(date-time)

      Timestamp that indicates when the Data Lake Pipeline was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • datasetRetentionPolicy object

      Dataset Retention Policy for a Scheduled Data Lake Pipeline.

      Hide datasetRetentionPolicy attributes Show datasetRetentionPolicy attributes object
      • lastModifiedDate string(date-time)

        Date when retention policy was last modified. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      • units string Required

        Quantity of time in which the Data Lake Pipeline measures dataset retention.

        Values are DAYS, WEEKS, or MONTHS.

      • value integer(int32) Required

        Number that indicates the amount of days, weeks, or months that the Data Lake Pipeline will retain datasets.

        Minimum value is 1.

    • groupId string

      Unique 24-hexadecimal digit string that identifies the group.

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

    • lastUpdatedDate string(date-time)

      Timestamp that indicates the last time that the Data Lake Pipeline was updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • name string

      Name of this Data Lake Pipeline.

    • sink object

      Atlas Data Lake Storage as the destination for a Data Lake Pipeline.

      Hide sink attributes Show sink attributes object
      • type string Discriminator

        Type of ingestion destination of this Data Lake Pipeline.

        Value is DLS.

      • metadataProvider string

        Target cloud provider for this Data Lake Pipeline.

        Value is AWS.

      • metadataRegion string

        Target cloud provider region for this Data Lake Pipeline.

        Supported cloud provider regions
      • partitionFields array[object]

        Ordered fields used to physically organize data in the destination.

        Partition Field in the Data Lake Storage provider for a Data Lake Pipeline.

        Hide partitionFields attributes Show partitionFields attributes object
        • fieldName string Required

          Human-readable label that identifies the field name used to partition data.

          Maximum length is 700.

        • order integer(int32) Required

          Sequence in which MongoDB Cloud slices the collection data to create partitions. The resource expresses this sequence starting with zero.

          Default value is 0.

    • source object

      One of:

      On-Demand Cloud Provider Snapshots as Source for a Data Lake Pipeline.

      Hide attributes Show attributes
      • type string Discriminator

        Type of ingestion source of this Data Lake Pipeline.

        Value is ON_DEMAND_CPS.

      • clusterName string

        Human-readable name that identifies the cluster.

      • collectionName string

        Human-readable name that identifies the collection.

      • databaseName string

        Human-readable name that identifies the database.

      • groupId string

        Unique 24-hexadecimal character string that identifies the project.

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

    • state string

      State of this Data Lake Pipeline.

      Values are ACTIVE or PAUSED.

    • transformations array[object]

      Fields to be excluded for this Data Lake Pipeline.

      Field Transformations during ingestion of a Data Lake Pipeline.

      Hide transformations attributes Show transformations attributes object
      • field string

        Key in the document.

      • type string

        Type of transformation applied during the export of the namespace in a Data Lake Pipeline.

        Value is EXCLUDE.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

POST /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume
atlas api resumePipeline --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ResumePipelineApiParams{}
	sdkResp, httpResp, err := client.DataLakePipelinesApi.
		ResumePipelineWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume" \
  -d '{ <Payload> }'
Response examples (200)
{
  "_id": "32b6e34b3d91647abb20e7b8",
  "createdDate": "2025-05-04T09:42:00Z",
  "datasetRetentionPolicy": {
    "lastModifiedDate": "2025-05-04T09:42:00Z",
    "units": "DAYS",
    "value": 42
  },
  "groupId": "32b6e34b3d91647abb20e7b8",
  "lastUpdatedDate": "2025-05-04T09:42:00Z",
  "name": "string",
  "sink": {
    "type": "DLS",
    "metadataProvider": "AWS",
    "metadataRegion": "string",
    "partitionFields": [
      {
        "fieldName": "string",
        "order": 0
      }
    ]
  },
  "source": {
    "type": "PERIODIC_CPS",
    "clusterName": "string",
    "collectionName": "string",
    "databaseName": "string",
    "groupId": "32b6e34b3d91647abb20e7b8"
  },
  "state": "ACTIVE",
  "transformations": [
    {
      "field": "string",
      "type": "EXCLUDE"
    }
  ]
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}






































Return One Configuration for Encryption at Rest using Customer-Managed Keys for One Project

GET /api/atlas/v2/groups/{groupId}/encryptionAtRest

Returns the configuration for encryption at rest using the keys you manage through your cloud provider. MongoDB Cloud encrypts all storage even if you don't use your own key management. This resource requires the requesting Service Account or API Key to have the Project Owner role.

LIMITED TO M10 OR GREATER: MongoDB Cloud limits this feature to dedicated cluster tiers of M10 and greater.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attributes Show response attributes object
    • awsKms object

      Amazon Web Services (AWS) KMS configuration details and encryption at rest configuration set for the specified project.

      Amazon Web Services Key Management Service
      Hide awsKms attributes Show awsKms attributes object
      • accessKeyID string

        Unique alphanumeric string that identifies an Identity and Access Management (IAM) access key with permissions required to access your Amazon Web Services (AWS) Customer Master Key (CMK).

        Minimum length is 16, maximum length is 128.

      • customerMasterKeyID string

        Unique alphanumeric string that identifies the Amazon Web Services (AWS) Customer Master Key (CMK) you used to encrypt and decrypt the MongoDB master keys.

        Minimum length is 1, maximum length is 2048.

      • enabled boolean

        Flag that indicates whether someone enabled encryption at rest for the specified project through Amazon Web Services (AWS) Key Management Service (KMS). To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

      • region string

        Physical location where MongoDB Cloud deploys your AWS-hosted MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. MongoDB Cloud assigns the VPC a CIDR block. To limit a new VPC peering connection to one CIDR block and region, create the connection first. Deploy the cluster after the connection starts.

        Values are US_GOV_WEST_1, US_GOV_EAST_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, CA_CENTRAL_1, EU_NORTH_1, EU_WEST_1, EU_WEST_2, EU_WEST_3, EU_CENTRAL_1, EU_CENTRAL_2, AP_EAST_1, AP_NORTHEAST_1, AP_NORTHEAST_2, AP_NORTHEAST_3, AP_SOUTHEAST_1, AP_SOUTHEAST_2, AP_SOUTHEAST_3, AP_SOUTHEAST_4, AP_SOUTH_1, AP_SOUTH_2, SA_EAST_1, CN_NORTH_1, CN_NORTHWEST_1, ME_SOUTH_1, ME_CENTRAL_1, AF_SOUTH_1, EU_SOUTH_1, EU_SOUTH_2, IL_CENTRAL_1, CA_WEST_1, AP_SOUTHEAST_5, AP_SOUTHEAST_7, MX_CENTRAL_1, or GLOBAL.

      • requirePrivateNetworking boolean

        Enable connection to your Amazon Web Services (AWS) Key Management Service (KMS) over private networking.

      • valid boolean

        Flag that indicates whether the Amazon Web Services (AWS) Key Management Service (KMS) encryption key can encrypt and decrypt data.

    • azureKeyVault object

      Details that define the configuration of Encryption at Rest using Azure Key Vault (AKV).

      Azure Key Vault
      Hide azureKeyVault attributes Show azureKeyVault attributes object
      • azureEnvironment string

        Azure environment in which your account credentials reside.

        Values are AZURE or AZURE_CHINA.

      • clientID string(uuid)

        Unique 36-hexadecimal character string that identifies an Azure application associated with your Azure Active Directory tenant.

      • enabled boolean

        Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

      • keyIdentifier string

        Web address with a unique key that identifies for your Azure Key Vault.

      • keyVaultName string

        Unique string that identifies the Azure Key Vault that contains your key. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

      • requirePrivateNetworking boolean

        Enable connection to your Azure Key Vault over private networking.

      • resourceGroupName string

        Name of the Azure resource group that contains your Azure Key Vault. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

      • subscriptionID string(uuid)

        Unique 36-hexadecimal character string that identifies your Azure subscription. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

      • tenantID string(uuid)

        Unique 36-hexadecimal character string that identifies the Azure Active Directory tenant within your Azure subscription.

      • valid boolean

        Flag that indicates whether the Azure encryption key can encrypt and decrypt data.

    • enabledForSearchNodes boolean

      Flag that indicates whether Encryption at Rest for Dedicated Search Nodes is enabled in the specified project.

    • googleCloudKms object

      Details that define the configuration of Encryption at Rest using Google Cloud Key Management Service (KMS).

      Google Cloud Key Management Service
      Hide googleCloudKms attributes Show googleCloudKms attributes object
      • enabled boolean

        Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

      • keyVersionResourceID string

        Resource path that displays the key version resource ID for your Google Cloud KMS.

      • roleId string

        Unique 24-hexadecimal digit string that identifies the Google Cloud Provider Access Role that MongoDB Cloud uses to access the Google Cloud KMS.

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

      • valid boolean

        Flag that indicates whether the Google Cloud Key Management Service (KMS) encryption key can encrypt and decrypt data.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/encryptionAtRest
atlas api getEncryptionAtRest --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetEncryptionAtRestApiParams{}
	sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi.
		GetEncryptionAtRestWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest?pretty=true"
Response examples (200)
{
  "awsKms": {
    "accessKeyID": "019dd98d94b4bb778e7552e4",
    "customerMasterKeyID": "string",
    "enabled": true,
    "region": "US_GOV_WEST_1",
    "requirePrivateNetworking": true,
    "valid": true
  },
  "azureKeyVault": {
    "azureEnvironment": "AZURE",
    "clientID": "string",
    "enabled": true,
    "keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
    "keyVaultName": "string",
    "requirePrivateNetworking": true,
    "resourceGroupName": "string",
    "subscriptionID": "string",
    "tenantID": "string",
    "valid": true
  },
  "enabledForSearchNodes": true,
  "googleCloudKms": {
    "enabled": true,
    "keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
    "roleId": "32b6e34b3d91647abb20e7b8",
    "valid": true
  }
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

Update Encryption at Rest Configuration for One Project

PATCH /api/atlas/v2/groups/{groupId}/encryptionAtRest

Updates the configuration for encryption at rest using the keys you manage through your cloud provider. MongoDB Cloud encrypts all storage even if you don't use your own key management. This resource requires the requesting Service Account or API Key to have the Project Owner role. This feature isn't available for M0 free clusters, M2, M5, or serverless clusters.

After you configure at least one Encryption at Rest using a Customer Key Management provider for the MongoDB Cloud project, Project Owners can enable Encryption at Rest using Customer Key Management for each MongoDB Cloud cluster for which they require encryption. The Encryption at Rest using Customer Key Management provider doesn't have to match the cluster cloud service provider. MongoDB Cloud doesn't automatically rotate user-managed encryption keys. Defer to your preferred Encryption at Rest using Customer Key Management provider's documentation and guidance for best practices on key rotation. MongoDB Cloud automatically creates a 90-day key rotation alert when you configure Encryption at Rest using Customer Key Management using your Key Management in an MongoDB Cloud project. MongoDB Cloud encrypts all storage whether or not you use your own key management.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2023-01-01+json

Body Required

Required parameters depend on whether someone has enabled Encryption at Rest using Customer Key Management:

If you have enabled Encryption at Rest using Customer Key Management (CMK), Atlas requires all of the parameters for the desired encryption provider.

  • To use AWS Key Management Service (KMS), MongoDB Cloud requires all the fields in the awsKms object.
  • To use Azure Key Vault, MongoDB Cloud requires all the fields in the azureKeyVault object.
  • To use Google Cloud Key Management Service (KMS), MongoDB Cloud requires all the fields in the googleCloudKms object.

If you enabled Encryption at Rest using Customer Key Management, administrators can pass only the changed fields for the awsKms, azureKeyVault, or googleCloudKms object to update the configuration to this endpoint.

  • awsKms object

    Amazon Web Services (AWS) KMS configuration details and encryption at rest configuration set for the specified project.

    Amazon Web Services Key Management Service
    Hide awsKms attributes Show awsKms attributes object
    • accessKeyID string

      Unique alphanumeric string that identifies an Identity and Access Management (IAM) access key with permissions required to access your Amazon Web Services (AWS) Customer Master Key (CMK).

      Minimum length is 16, maximum length is 128.

    • customerMasterKeyID string

      Unique alphanumeric string that identifies the Amazon Web Services (AWS) Customer Master Key (CMK) you used to encrypt and decrypt the MongoDB master keys.

      Minimum length is 1, maximum length is 2048.

    • enabled boolean

      Flag that indicates whether someone enabled encryption at rest for the specified project through Amazon Web Services (AWS) Key Management Service (KMS). To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

    • region string

      Physical location where MongoDB Cloud deploys your AWS-hosted MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. MongoDB Cloud assigns the VPC a CIDR block. To limit a new VPC peering connection to one CIDR block and region, create the connection first. Deploy the cluster after the connection starts.

      Values are US_GOV_WEST_1, US_GOV_EAST_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, CA_CENTRAL_1, EU_NORTH_1, EU_WEST_1, EU_WEST_2, EU_WEST_3, EU_CENTRAL_1, EU_CENTRAL_2, AP_EAST_1, AP_NORTHEAST_1, AP_NORTHEAST_2, AP_NORTHEAST_3, AP_SOUTHEAST_1, AP_SOUTHEAST_2, AP_SOUTHEAST_3, AP_SOUTHEAST_4, AP_SOUTH_1, AP_SOUTH_2, SA_EAST_1, CN_NORTH_1, CN_NORTHWEST_1, ME_SOUTH_1, ME_CENTRAL_1, AF_SOUTH_1, EU_SOUTH_1, EU_SOUTH_2, IL_CENTRAL_1, CA_WEST_1, AP_SOUTHEAST_5, AP_SOUTHEAST_7, MX_CENTRAL_1, or GLOBAL.

    • requirePrivateNetworking boolean

      Enable connection to your Amazon Web Services (AWS) Key Management Service (KMS) over private networking.

    • roleId string

      Unique 24-hexadecimal digit string that identifies an Amazon Web Services (AWS) Identity and Access Management (IAM) role. This IAM role has the permissions required to manage your AWS customer master key.

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

    • secretAccessKey string

      Human-readable label of the Identity and Access Management (IAM) secret access key with permissions required to access your Amazon Web Services (AWS) customer master key.

  • azureKeyVault object

    Details that define the configuration of Encryption at Rest using Azure Key Vault (AKV).

    Azure Key Vault
    Hide azureKeyVault attributes Show azureKeyVault attributes object
    • azureEnvironment string

      Azure environment in which your account credentials reside.

      Values are AZURE or AZURE_CHINA.

    • clientID string(uuid)

      Unique 36-hexadecimal character string that identifies an Azure application associated with your Azure Active Directory tenant.

    • enabled boolean

      Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

    • keyIdentifier string

      Web address with a unique key that identifies for your Azure Key Vault.

    • keyVaultName string

      Unique string that identifies the Azure Key Vault that contains your key. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

    • requirePrivateNetworking boolean

      Enable connection to your Azure Key Vault over private networking.

    • resourceGroupName string

      Name of the Azure resource group that contains your Azure Key Vault. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

    • secret string

      Private data that you need secured and that belongs to the specified Azure Key Vault (AKV) tenant (azureKeyVault.tenantID). This data can include any type of sensitive data such as passwords, database connection strings, API keys, and the like. AKV stores this information as encrypted binary data.

      Azure Key Vault Secrets
    • subscriptionID string(uuid)

      Unique 36-hexadecimal character string that identifies your Azure subscription. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

    • tenantID string(uuid)

      Unique 36-hexadecimal character string that identifies the Azure Active Directory tenant within your Azure subscription.

  • enabledForSearchNodes boolean

    Flag that indicates whether Encryption at Rest for Dedicated Search Nodes is enabled in the specified project.

  • googleCloudKms object

    Details that define the configuration of Encryption at Rest using Google Cloud Key Management Service (KMS).

    Google Cloud Key Management Service
    Hide googleCloudKms attributes Show googleCloudKms attributes object
    • enabled boolean

      Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

    • keyVersionResourceID string

      Resource path that displays the key version resource ID for your Google Cloud KMS.

    • roleId string

      Unique 24-hexadecimal digit string that identifies the Google Cloud Provider Access Role that MongoDB Cloud uses to access the Google Cloud KMS.

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

    • serviceAccountKey string

      JavaScript Object Notation (JSON) object that contains the Google Cloud Key Management Service (KMS). Format the JSON as a string and not as an object.

      Google Cloud Authentication

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attributes Show response attributes object
    • awsKms object

      Amazon Web Services (AWS) KMS configuration details and encryption at rest configuration set for the specified project.

      Amazon Web Services Key Management Service
      Hide awsKms attributes Show awsKms attributes object
      • accessKeyID string

        Unique alphanumeric string that identifies an Identity and Access Management (IAM) access key with permissions required to access your Amazon Web Services (AWS) Customer Master Key (CMK).

        Minimum length is 16, maximum length is 128.

      • customerMasterKeyID string

        Unique alphanumeric string that identifies the Amazon Web Services (AWS) Customer Master Key (CMK) you used to encrypt and decrypt the MongoDB master keys.

        Minimum length is 1, maximum length is 2048.

      • enabled boolean

        Flag that indicates whether someone enabled encryption at rest for the specified project through Amazon Web Services (AWS) Key Management Service (KMS). To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

      • region string

        Physical location where MongoDB Cloud deploys your AWS-hosted MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. MongoDB Cloud assigns the VPC a CIDR block. To limit a new VPC peering connection to one CIDR block and region, create the connection first. Deploy the cluster after the connection starts.

        Values are US_GOV_WEST_1, US_GOV_EAST_1, US_EAST_1, US_EAST_2, US_WEST_1, US_WEST_2, CA_CENTRAL_1, EU_NORTH_1, EU_WEST_1, EU_WEST_2, EU_WEST_3, EU_CENTRAL_1, EU_CENTRAL_2, AP_EAST_1, AP_NORTHEAST_1, AP_NORTHEAST_2, AP_NORTHEAST_3, AP_SOUTHEAST_1, AP_SOUTHEAST_2, AP_SOUTHEAST_3, AP_SOUTHEAST_4, AP_SOUTH_1, AP_SOUTH_2, SA_EAST_1, CN_NORTH_1, CN_NORTHWEST_1, ME_SOUTH_1, ME_CENTRAL_1, AF_SOUTH_1, EU_SOUTH_1, EU_SOUTH_2, IL_CENTRAL_1, CA_WEST_1, AP_SOUTHEAST_5, AP_SOUTHEAST_7, MX_CENTRAL_1, or GLOBAL.

      • requirePrivateNetworking boolean

        Enable connection to your Amazon Web Services (AWS) Key Management Service (KMS) over private networking.

      • valid boolean

        Flag that indicates whether the Amazon Web Services (AWS) Key Management Service (KMS) encryption key can encrypt and decrypt data.

    • azureKeyVault object

      Details that define the configuration of Encryption at Rest using Azure Key Vault (AKV).

      Azure Key Vault
      Hide azureKeyVault attributes Show azureKeyVault attributes object
      • azureEnvironment string

        Azure environment in which your account credentials reside.

        Values are AZURE or AZURE_CHINA.

      • clientID string(uuid)

        Unique 36-hexadecimal character string that identifies an Azure application associated with your Azure Active Directory tenant.

      • enabled boolean

        Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

      • keyIdentifier string

        Web address with a unique key that identifies for your Azure Key Vault.

      • keyVaultName string

        Unique string that identifies the Azure Key Vault that contains your key. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

      • requirePrivateNetworking boolean

        Enable connection to your Azure Key Vault over private networking.

      • resourceGroupName string

        Name of the Azure resource group that contains your Azure Key Vault. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

      • subscriptionID string(uuid)

        Unique 36-hexadecimal character string that identifies your Azure subscription. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault.

      • tenantID string(uuid)

        Unique 36-hexadecimal character string that identifies the Azure Active Directory tenant within your Azure subscription.

      • valid boolean

        Flag that indicates whether the Azure encryption key can encrypt and decrypt data.

    • enabledForSearchNodes boolean

      Flag that indicates whether Encryption at Rest for Dedicated Search Nodes is enabled in the specified project.

    • googleCloudKms object

      Details that define the configuration of Encryption at Rest using Google Cloud Key Management Service (KMS).

      Google Cloud Key Management Service
      Hide googleCloudKms attributes Show googleCloudKms attributes object
      • enabled boolean

        Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of false.

      • keyVersionResourceID string

        Resource path that displays the key version resource ID for your Google Cloud KMS.

      • roleId string

        Unique 24-hexadecimal digit string that identifies the Google Cloud Provider Access Role that MongoDB Cloud uses to access the Google Cloud KMS.

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

      • valid boolean

        Flag that indicates whether the Google Cloud Key Management Service (KMS) encryption key can encrypt and decrypt data.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 409 application/json

    Conflict.

    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.

PATCH /api/atlas/v2/groups/{groupId}/encryptionAtRest
atlas api updateEncryptionAtRest --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.UpdateEncryptionAtRestApiParams{}
	sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi.
		UpdateEncryptionAtRestWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest" \
  -d '{ <Payload> }'
Request examples
{
  "awsKms": {
    "accessKeyID": "019dd98d94b4bb778e7552e4",
    "customerMasterKeyID": "string",
    "enabled": true,
    "region": "US_GOV_WEST_1",
    "requirePrivateNetworking": true,
    "roleId": "32b6e34b3d91647abb20e7b8",
    "secretAccessKey": "string"
  },
  "azureKeyVault": {
    "azureEnvironment": "AZURE",
    "clientID": "string",
    "enabled": true,
    "keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
    "keyVaultName": "string",
    "requirePrivateNetworking": true,
    "resourceGroupName": "string",
    "secret": "string",
    "subscriptionID": "string",
    "tenantID": "string"
  },
  "enabledForSearchNodes": true,
  "googleCloudKms": {
    "enabled": true,
    "keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
    "roleId": "32b6e34b3d91647abb20e7b8",
    "serviceAccountKey": "string"
  }
}
Response examples (200)
{
  "awsKms": {
    "accessKeyID": "019dd98d94b4bb778e7552e4",
    "customerMasterKeyID": "string",
    "enabled": true,
    "region": "US_GOV_WEST_1",
    "requirePrivateNetworking": true,
    "valid": true
  },
  "azureKeyVault": {
    "azureEnvironment": "AZURE",
    "clientID": "string",
    "enabled": true,
    "keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
    "keyVaultName": "string",
    "requirePrivateNetworking": true,
    "resourceGroupName": "string",
    "subscriptionID": "string",
    "tenantID": "string",
    "valid": true
  },
  "enabledForSearchNodes": true,
  "googleCloudKms": {
    "enabled": true,
    "keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
    "roleId": "32b6e34b3d91647abb20e7b8",
    "valid": true
  }
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (409)
{
  "error": 409,
  "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",
  "reason": "Conflict",
  "errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
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"
}




Create One Private Endpoint in a Specified Region for Encryption at Rest Using Customer Key Management

POST /api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints

Creates a private endpoint in the specified region for encryption at rest using customer key management.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • cloudProvider string Required

    Human-readable label that identifies the cloud provider for the private endpoint to create.

    Values are AZURE or AWS.

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2023-01-01+json

Body object Required

Creates a private endpoint in the specified region.

One of:

Azure Key Vault Encryption At Rest Private Endpoint.

  • regionName string

    Cloud provider region in which the Encryption At Rest private endpoint is located.

    One of:

    Microsoft Azure Regions.

    Values are US_CENTRAL, US_EAST, US_EAST_2, US_NORTH_CENTRAL, US_WEST, US_SOUTH_CENTRAL, EUROPE_NORTH, EUROPE_WEST, US_WEST_CENTRAL, US_WEST_2, US_WEST_3, CANADA_EAST, CANADA_CENTRAL, BRAZIL_SOUTH, BRAZIL_SOUTHEAST, AUSTRALIA_CENTRAL, AUSTRALIA_CENTRAL_2, AUSTRALIA_EAST, AUSTRALIA_SOUTH_EAST, GERMANY_WEST_CENTRAL, GERMANY_NORTH, SWEDEN_CENTRAL, SWEDEN_SOUTH, SWITZERLAND_NORTH, SWITZERLAND_WEST, UK_SOUTH, UK_WEST, NORWAY_EAST, NORWAY_WEST, INDIA_CENTRAL, INDIA_SOUTH, INDIA_WEST, CHINA_EAST, CHINA_NORTH, ASIA_EAST, JAPAN_EAST, JAPAN_WEST, ASIA_SOUTH_EAST, KOREA_CENTRAL, KOREA_SOUTH, FRANCE_CENTRAL, FRANCE_SOUTH, SOUTH_AFRICA_NORTH, SOUTH_AFRICA_WEST, UAE_CENTRAL, UAE_NORTH, or QATAR_CENTRAL.

  • regionName string

    Cloud provider region in which the Encryption At Rest private endpoint is located.

    One of:

    Microsoft Azure Regions.

    Values are US_CENTRAL, US_EAST, US_EAST_2, US_NORTH_CENTRAL, US_WEST, US_SOUTH_CENTRAL, EUROPE_NORTH, EUROPE_WEST, US_WEST_CENTRAL, US_WEST_2, US_WEST_3, CANADA_EAST, CANADA_CENTRAL, BRAZIL_SOUTH, BRAZIL_SOUTHEAST, AUSTRALIA_CENTRAL, AUSTRALIA_CENTRAL_2, AUSTRALIA_EAST, AUSTRALIA_SOUTH_EAST, GERMANY_WEST_CENTRAL, GERMANY_NORTH, SWEDEN_CENTRAL, SWEDEN_SOUTH, SWITZERLAND_NORTH, SWITZERLAND_WEST, UK_SOUTH, UK_WEST, NORWAY_EAST, NORWAY_WEST, INDIA_CENTRAL, INDIA_SOUTH, INDIA_WEST, CHINA_EAST, CHINA_NORTH, ASIA_EAST, JAPAN_EAST, JAPAN_WEST, ASIA_SOUTH_EAST, KOREA_CENTRAL, KOREA_SOUTH, FRANCE_CENTRAL, FRANCE_SOUTH, SOUTH_AFRICA_NORTH, SOUTH_AFRICA_WEST, UAE_CENTRAL, UAE_NORTH, or QATAR_CENTRAL.

Responses

  • 202 application/vnd.atlas.2023-01-01+json

    Accepted

    One of:

    Azure Key Vault Encryption At Rest Private Endpoint.

    Hide attributes Show attributes
    • cloudProvider string Discriminator

      Human-readable label that identifies the cloud provider for the Encryption At Rest private endpoint.

      Value is AZURE.

    • errorMessage string

      Error message for failures associated with the Encryption At Rest private endpoint.

    • id string

      Unique 24-hexadecimal digit string that identifies the Private Endpoint Service.

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

    • regionName string

      Cloud provider region in which the Encryption At Rest private endpoint is located.

      One of:

      Microsoft Azure Regions.

      Values are US_CENTRAL, US_EAST, US_EAST_2, US_NORTH_CENTRAL, US_WEST, US_SOUTH_CENTRAL, EUROPE_NORTH, EUROPE_WEST, US_WEST_CENTRAL, US_WEST_2, US_WEST_3, CANADA_EAST, CANADA_CENTRAL, BRAZIL_SOUTH, BRAZIL_SOUTHEAST, AUSTRALIA_CENTRAL, AUSTRALIA_CENTRAL_2, AUSTRALIA_EAST, AUSTRALIA_SOUTH_EAST, GERMANY_WEST_CENTRAL, GERMANY_NORTH, SWEDEN_CENTRAL, SWEDEN_SOUTH, SWITZERLAND_NORTH, SWITZERLAND_WEST, UK_SOUTH, UK_WEST, NORWAY_EAST, NORWAY_WEST, INDIA_CENTRAL, INDIA_SOUTH, INDIA_WEST, CHINA_EAST, CHINA_NORTH, ASIA_EAST, JAPAN_EAST, JAPAN_WEST, ASIA_SOUTH_EAST, KOREA_CENTRAL, KOREA_SOUTH, FRANCE_CENTRAL, FRANCE_SOUTH, SOUTH_AFRICA_NORTH, SOUTH_AFRICA_WEST, UAE_CENTRAL, UAE_NORTH, or QATAR_CENTRAL.

    • regionName string

      Cloud provider region in which the Encryption At Rest private endpoint is located.

      One of:

      Microsoft Azure Regions.

      Values are US_CENTRAL, US_EAST, US_EAST_2, US_NORTH_CENTRAL, US_WEST, US_SOUTH_CENTRAL, EUROPE_NORTH, EUROPE_WEST, US_WEST_CENTRAL, US_WEST_2, US_WEST_3, CANADA_EAST, CANADA_CENTRAL, BRAZIL_SOUTH, BRAZIL_SOUTHEAST, AUSTRALIA_CENTRAL, AUSTRALIA_CENTRAL_2, AUSTRALIA_EAST, AUSTRALIA_SOUTH_EAST, GERMANY_WEST_CENTRAL, GERMANY_NORTH, SWEDEN_CENTRAL, SWEDEN_SOUTH, SWITZERLAND_NORTH, SWITZERLAND_WEST, UK_SOUTH, UK_WEST, NORWAY_EAST, NORWAY_WEST, INDIA_CENTRAL, INDIA_SOUTH, INDIA_WEST, CHINA_EAST, CHINA_NORTH, ASIA_EAST, JAPAN_EAST, JAPAN_WEST, ASIA_SOUTH_EAST, KOREA_CENTRAL, KOREA_SOUTH, FRANCE_CENTRAL, FRANCE_SOUTH, SOUTH_AFRICA_NORTH, SOUTH_AFRICA_WEST, UAE_CENTRAL, UAE_NORTH, or QATAR_CENTRAL.

    • status string

      State of the Encryption At Rest private endpoint.

      Values are INITIATING, PENDING_ACCEPTANCE, ACTIVE, FAILED, PENDING_RECREATION, or DELETING.

    • privateEndpointConnectionName string

      Connection name of the Azure Private Endpoint.

  • 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.

  • 404 application/json

    Not Found.

    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.

POST /api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints
atlas api createEncryptionAtRestPrivateEndpoint --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.CreateEncryptionAtRestPrivateEndpointApiParams{}
	sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi.
		CreateEncryptionAtRestPrivateEndpointWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints" \
  -d '{ <Payload> }'
Request examples
{
  "regionName": "US_CENTRAL"
}
{
  "regionName": "US_CENTRAL"
}
Response examples (202)
{
  "cloudProvider": "AZURE",
  "errorMessage": "string",
  "id": "32b6e34b3d91647abb20e7b8",
  "regionName": "US_CENTRAL",
  "status": "INITIATING",
  "privateEndpointConnectionName": "string"
}
{
  "cloudProvider": "AZURE",
  "errorMessage": "string",
  "id": "32b6e34b3d91647abb20e7b8",
  "regionName": "US_CENTRAL",
  "status": "INITIATING",
  "privateEndpointConnectionName": "string"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}










































































Create One Identity Provider

POST /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders

Creates one identity provider within the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations.

Note: This resource only supports the creation of OIDC identity providers.

Path parameters

  • federationSettingsId string Required

    Unique 24-hexadecimal digit string that identifies your federation.

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

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.

application/vnd.atlas.2023-11-15+json

Body object Required

The identity provider that you want to create.

One of:
  • audience string

    Identifier of the intended recipient of the token.

  • authorizationType string

    Indicates whether authorization is granted based on group membership or user ID.

    Values are GROUP or USER.

  • description string

    The description of the identity provider.

  • displayName string

    Human-readable label that identifies the identity provider.

    Minimum length is 1, maximum length is 50.

  • groupsClaim string

    Identifier of the claim which contains IdP Group IDs in the token.

  • idpType string

    String enum that indicates the type of the identity provider. Default is WORKFORCE.

    Values are WORKFORCE or WORKLOAD.

  • issuerUri string

    Unique string that identifies the issuer of the SAML Assertion or OIDC metadata/discovery document URL.

  • protocol string

    String enum that indicates the protocol of the identity provider. Either SAML or OIDC.

    Values are SAML or OIDC.

  • userClaim string

    Identifier of the claim which contains the user ID in the token.

  • associatedDomains array[string]

    List that contains the domains associated with the identity provider.

  • clientId string

    Client identifier that is assigned to an application by the Identity Provider.

  • requestedScopes array[string]

    Scopes that MongoDB applications will request from the authorization endpoint.

Responses

  • 200 application/vnd.atlas.2023-11-15+json

    OK

    One of:
    Hide attributes Show attributes
    • associatedOrgs array[object]

      List that contains the connected organization configurations associated with the identity provider.

      Hide associatedOrgs attributes Show associatedOrgs attributes object
      • dataAccessIdentityProviderIds array[string]

        The collection of unique ids representing the identity providers that can be used for data access in this organization.

      • domainAllowList array[string]

        Approved domains that restrict users who can join the organization based on their email address.

      • domainRestrictionEnabled boolean Required

        Value that indicates whether domain restriction is enabled for this connected org.

      • identityProviderId string

        Legacy 20-hexadecimal digit string that identifies the UI access identity provider that this connected org config is associated with. This id can be found within the Federation Management Console > Identity Providers tab by clicking the info icon in the IdP ID row of a configured identity provider.

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

      • orgId string Required

        Unique 24-hexadecimal digit string that identifies the connected organization configuration.

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

      • postAuthRoleGrants array[string]

        Atlas roles that are granted to a user in this organization after authenticating. Roles are a human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific MongoDB Cloud user. These roles can only be organization specific roles.

        Values are ORG_OWNER, ORG_MEMBER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN, ORG_BILLING_READ_ONLY, or ORG_READ_ONLY.

      • roleMappings array[object]

        Role mappings that are configured in this organization.

        Mapping settings that link one IdP and MongoDB Cloud.

        Hide roleMappings attributes Show roleMappings attributes object
        • externalGroupName string Required

          Unique human-readable label that identifies the identity provider group to which this role mapping applies.

          Minimum length is 1, maximum length is 200.

        • id string

          Unique 24-hexadecimal digit string that identifies this role mapping.

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

        • roleAssignments array[object]

          Atlas roles and the unique identifiers of the groups and organizations associated with each role. The array must include at least one element with an Organization role and its respective orgId. Each element in the array can have a value for orgId or groupId, but not both.

          Hide roleAssignments attributes Show roleAssignments attributes object
          • groupId string

            Unique 24-hexadecimal digit string that identifies the project to which this role belongs. Each element within roleAssignments can have a value for groupId or orgId, but not both.

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

          • orgId string

            Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. Each element within roleAssignments can have a value for orgId or groupId, but not both.

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

          • role string

            Human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific API key, MongoDB Cloud user, or MongoDB Cloud team. These roles include organization- and project-level roles.

            Values are ORG_OWNER, ORG_MEMBER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN, ORG_BILLING_READ_ONLY, ORG_READ_ONLY, GROUP_BACKUP_MANAGER, GROUP_CLUSTER_MANAGER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_ONLY, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATABASE_ACCESS_ADMIN, GROUP_OBSERVABILITY_VIEWER, GROUP_OWNER, GROUP_READ_ONLY, GROUP_SEARCH_INDEX_EDITOR, or GROUP_STREAM_PROCESSING_OWNER.

      • userConflicts array[object]

        List that contains the users who have an email address that doesn't match any domain on the allowed list.

        MongoDB Cloud user linked to this federated authentication.

        Hide userConflicts attributes Show userConflicts attributes object
        • emailAddress string(email) Required

          Email address of the MongoDB Cloud user linked to the federated organization.

        • federationSettingsId string Required

          Unique 24-hexadecimal digit string that identifies the federation to which this MongoDB Cloud user belongs.

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

        • firstName string Required

          First or given name that belongs to the MongoDB Cloud user.

        • lastName string Required

          Last name, family name, or surname that belongs to the MongoDB Cloud user.

        • userId string

          Unique 24-hexadecimal digit string that identifies this user.

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

    • audience string

      Identifier of the intended recipient of the token.

    • authorizationType string

      Indicates whether authorization is granted based on group membership or user ID.

      Values are GROUP or USER.

    • createdAt string(date-time)

      Date that the identity provider was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • description string

      The description of the identity provider.

    • displayName string

      Human-readable label that identifies the identity provider.

    • groupsClaim string

      Identifier of the claim which contains IdP Group IDs in the token.

    • id string Required

      Unique 24-hexadecimal digit string that identifies the identity provider.

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

    • idpType string

      String enum that indicates the type of the identity provider. Default is WORKFORCE.

      Values are WORKFORCE or WORKLOAD.

    • issuerUri string

      Unique string that identifies the issuer of the SAML Assertion or OIDC metadata/discovery document URL.

    • oktaIdpId string Required

      Legacy 20-hexadecimal digit string that identifies the identity provider.

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

    • protocol string

      String enum that indicates the protocol of the identity provider. Either SAML or OIDC.

      Values are SAML or OIDC.

    • updatedAt string(date-time)

      Date that the identity provider was last updated on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • userClaim string

      Identifier of the claim which contains the user ID in the token.

    • associatedDomains array[string]

      List that contains the domains associated with the identity provider.

    • clientId string

      Client identifier that is assigned to an application by the Identity Provider.

    • requestedScopes array[string]

      Scopes that MongoDB applications will request from the authorization endpoint.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

POST /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders
atlas api createIdentityProvider --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.CreateIdentityProviderApiParams{}
	sdkResp, httpResp, err := client.FederatedAuthenticationApi.
		CreateIdentityProviderWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders" \
  -d '{ <Payload> }'
Request examples
{
  "audience": "string",
  "authorizationType": "GROUP",
  "description": "string",
  "displayName": "string",
  "groupsClaim": "string",
  "idpType": "WORKFORCE",
  "issuerUri": "urn:idp:default",
  "protocol": "SAML",
  "userClaim": "string",
  "associatedDomains": [
    "string"
  ],
  "clientId": "string",
  "requestedScopes": [
    "string"
  ]
}
{
  "audience": "string",
  "authorizationType": "GROUP",
  "description": "string",
  "displayName": "string",
  "groupsClaim": "string",
  "idpType": "WORKFORCE",
  "issuerUri": "urn:idp:default",
  "protocol": "SAML",
  "userClaim": "string"
}
Response examples (200)
{
  "associatedOrgs": [
    {
      "dataAccessIdentityProviderIds": [
        "string"
      ],
      "domainAllowList": [
        "string"
      ],
      "domainRestrictionEnabled": true,
      "identityProviderId": "string",
      "orgId": "32b6e34b3d91647abb20e7b8",
      "postAuthRoleGrants": [
        "ORG_OWNER"
      ],
      "roleMappings": [
        {
          "externalGroupName": "string",
          "id": "32b6e34b3d91647abb20e7b8",
          "roleAssignments": [
            {
              "groupId": "32b6e34b3d91647abb20e7b8",
              "orgId": "32b6e34b3d91647abb20e7b8",
              "role": "ORG_OWNER"
            }
          ]
        }
      ],
      "userConflicts": [
        {
          "emailAddress": "hello@example.com",
          "federationSettingsId": "32b6e34b3d91647abb20e7b8",
          "firstName": "string",
          "lastName": "string",
          "userId": "32b6e34b3d91647abb20e7b8"
        }
      ]
    }
  ],
  "audience": "string",
  "authorizationType": "GROUP",
  "createdAt": "2025-05-04T09:42:00Z",
  "description": "string",
  "displayName": "string",
  "groupsClaim": "string",
  "id": "32b6e34b3d91647abb20e7b8",
  "idpType": "WORKFORCE",
  "issuerUri": "string",
  "oktaIdpId": "string",
  "protocol": "SAML",
  "updatedAt": "2025-05-04T09:42:00Z",
  "userClaim": "string",
  "associatedDomains": [
    "string"
  ],
  "clientId": "string",
  "requestedScopes": [
    "string"
  ]
}
{
  "associatedOrgs": [
    {
      "dataAccessIdentityProviderIds": [
        "string"
      ],
      "domainAllowList": [
        "string"
      ],
      "domainRestrictionEnabled": true,
      "identityProviderId": "string",
      "orgId": "32b6e34b3d91647abb20e7b8",
      "postAuthRoleGrants": [
        "ORG_OWNER"
      ],
      "roleMappings": [
        {
          "externalGroupName": "string",
          "id": "32b6e34b3d91647abb20e7b8",
          "roleAssignments": [
            {
              "groupId": "32b6e34b3d91647abb20e7b8",
              "orgId": "32b6e34b3d91647abb20e7b8",
              "role": "ORG_OWNER"
            }
          ]
        }
      ],
      "userConflicts": [
        {
          "emailAddress": "hello@example.com",
          "federationSettingsId": "32b6e34b3d91647abb20e7b8",
          "firstName": "string",
          "lastName": "string",
          "userId": "32b6e34b3d91647abb20e7b8"
        }
      ]
    }
  ],
  "audience": "string",
  "authorizationType": "GROUP",
  "createdAt": "2025-05-04T09:42:00Z",
  "description": "string",
  "displayName": "string",
  "groupsClaim": "string",
  "id": "32b6e34b3d91647abb20e7b8",
  "idpType": "WORKFORCE",
  "issuerUri": "string",
  "oktaIdpId": "string",
  "protocol": "SAML",
  "updatedAt": "2025-05-04T09:42:00Z",
  "userClaim": "string"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}












Revoke JWKS from One OIDC Identity Provider

DELETE /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks

Revokes the JWKS tokens from the requested OIDC identity provider. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations.

Note: Revoking your JWKS tokens immediately refreshes your IdP public keys from all your Atlas clusters, invalidating previously signed access tokens and logging out all users. You may need to restart your MongoDB clients. All organizations connected to the identity provider will be affected.

Configure OIDC Authorization

Path parameters

  • federationSettingsId string Required

    Unique 24-hexadecimal digit string that identifies your federation.

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

  • identityProviderId string Required

    Unique 24-hexadecimal digit string that identifies the identity provider to connect.

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.

Responses

  • 204 application/vnd.atlas.2023-11-15+json

    No Response

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

DELETE /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks
atlas api revokeJwksFromIdentityProvider --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.RevokeJwksFromIdentityProviderApiParams{}
	httpResp, err := client.FederatedAuthenticationApi.
		RevokeJwksFromIdentityProviderWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks"
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}





















































































Return results from a given Cost Explorer query, or notify that the results are not ready yet.

GET /api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage/{token}

Returns the usage details for a Cost Explorer query, if the query is finished and the data is ready to be viewed. If the data is not ready, a 'processing' response willindicate that another request should be sent later to view the data.

Path parameters

  • orgId string Required

    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.

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

  • token string Required

    Unique 64 digit string that identifies the Cost Explorer query.

    Minimum length is 64, maximum length is 64.

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.

Responses

  • 102

    Processing

  • OK

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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/v2/orgs/{orgId}/billing/costExplorer/usage/{token}
atlas api getCostExplorerQueryProcess --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetCostExplorerQueryProcessApiParams{}
	sdkResp, httpResp, err := client.InvoicesApi.
		GetCostExplorerQueryProcessWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage/{token}?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage/{token}?pretty=true"
Response examples (200)
Billed Date,666acb8787ba90706905dcae,
Invoice Id,"June 1, 2024 - July 1, 2024",
Organization Name,Test 2,
Organization ID,666acb8787ba90706905dcae,
Project Name,666acb8787ba90706905dcae,
Project Id,666acb8787ba90706905dcae,
Cluster Name,TestCluster
Cluster Unique Id,666acb8787ba90706905dcae
Usage Amount, 1018.39
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}




Return All Pending Invoices for One Organization

GET /api/atlas/v2/orgs/{orgId}/invoices/pending

Returns all invoices accruing charges for the current billing cycle for the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Billing Viewer, Organization Billing Admin, or Organization Owner role. If you have a cross-organization setup, you can view linked invoices if you have the Organization Billing Admin or Organization Owner Role.

Path parameters

  • orgId string Required

    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2023-01-01+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
      • amountBilledCents integer(int64)

        Sum of services that the specified organization consumed in the period covered in this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

      • amountPaidCents integer(int64)

        Sum that the specified organization paid toward this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

      • created string(date-time)

        Date and time when MongoDB Cloud created this invoice. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      • creditsCents integer(int64)

        Sum that MongoDB credited the specified organization toward this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

      • endDate string(date-time)

        Date and time when MongoDB Cloud finished the billing period that this invoice covers. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      • id string

        Unique 24-hexadecimal digit string that identifies the invoice submitted to the specified organization. Charges typically post the next day.

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

      • lineItems array[object]

        List that contains individual services included in this invoice.

        One service included in this invoice.

        Hide lineItems attributes Show lineItems attributes object
        • clusterName string

          Human-readable label that identifies the cluster that incurred the charge.

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

        • created string(date-time)

          Date and time when MongoDB Cloud created this line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        • discountCents integer(int64)

          Sum by which MongoDB discounted this line item. MongoDB Cloud expresses this value in cents (100ths of one US Dollar). The resource returns this parameter when a discount applies.

        • endDate string(date-time)

          Date and time when when MongoDB Cloud finished charging for this line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        • groupId string

          Unique 24-hexadecimal digit string that identifies the project associated to this line item.

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

        • groupName string

          Human-readable label that identifies the project.

        • note string

          Comment that applies to this line item.

        • percentDiscount number(float)

          Percentage by which MongoDB discounted this line item. The resource returns this parameter when a discount applies.

        • quantity number(double)

          Number of units included for the line item. These can be expressions of storage (GB), time (hours), or other units.

        • sku string

          Human-readable description of the service that this line item provided. This Stock Keeping Unit (SKU) could be the instance type, a support charge, advanced security, or another service.

        • startDate string(date-time)

          Date and time when MongoDB Cloud began charging for this line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        • stitchAppName string

          Human-readable label that identifies the Atlas App Services application associated with this line item.

          Create a new Atlas App Service
        • tags object

          A map of key-value pairs corresponding to the tags associated with the line item resource.

          Hide tags attribute Show tags attribute object
          • * array[string] Additional properties

            A map of key-value pairs corresponding to the tags associated with the line item resource.

        • tierLowerBound number(double)

          Lower bound for usage amount range in current SKU tier.

          NOTE: lineItems[n].tierLowerBound appears only if your lineItems[n].sku is tiered.

        • tierUpperBound number(double)

          Upper bound for usage amount range in current SKU tier.

          NOTE: lineItems[n].tierUpperBound appears only if your lineItems[n].sku is tiered.

        • totalPriceCents integer(int64)

          Sum of the cost set for this line item. MongoDB Cloud expresses this value in cents (100ths of one US Dollar) and calculates this value as unitPriceDollars × quantity × 100.

        • unit string

          Element used to express what quantity this line item measures. This value can be elements of time, storage capacity, and the like.

        • unitPriceDollars number(double)

          Value per unit for this line item expressed in US Dollars.

      • linkedInvoices array[object]

        List that contains the invoices for organizations linked to the paying organization.

      • orgId string

        Unique 24-hexadecimal digit string that identifies the organization charged for services consumed from MongoDB Cloud.

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

      • payments array[object]

        List that contains funds transferred to MongoDB to cover the specified service noted in this invoice.

        Funds transferred to MongoDB to cover the specified service in this invoice.

        Hide payments attributes Show payments attributes object
        • amountBilledCents integer(int64)

          Sum of services that the specified organization consumed in the period covered in this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

        • amountPaidCents integer(int64)

          Sum that the specified organization paid toward the associated invoice. This parameter expresses its value in cents (100ths of one US Dollar).

        • created string(date-time)

          Date and time when the customer made this payment attempt. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        • currency string

          The currency in which payment was paid. This parameter expresses its value in 3-letter ISO 4217 currency code.

        • id string

          Unique 24-hexadecimal digit string that identifies this payment toward the associated invoice.

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

        • salesTaxCents integer(int64)

          Sum of sales tax applied to this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

        • statusName string

          Phase of payment processing for the associated invoice when you made this request. These phases include:

          • CANCELLED: Customer or MongoDB cancelled the payment.
          • ERROR: Issue arose when attempting to complete payment.
          • FAILED: MongoDB tried to charge the credit card without success.
          • FAILED_AUTHENTICATION: Strong Customer Authentication has failed. Confirm that your payment method is authenticated.
          • FORGIVEN: Customer initiated payment which MongoDB later forgave.
          • INVOICED: MongoDB issued an invoice that included this line item.
          • NEW: Customer provided a method of payment, but MongoDB hasn't tried to charge the credit card.
          • PAID: Customer submitted a successful payment.
          • PARTIAL_PAID: Customer paid for part of this line item.

          Values are NEW, FORGIVEN, FAILED, PAID, PARTIAL_PAID, CANCELLED, INVOICED, FAILED_AUTHENTICATION, PROCESSING, PENDING_REVERSAL, or REFUNDED.

        • subtotalCents integer(int64)

          Sum of all positive invoice line items contained in this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

        • unitPrice string

          The unit price applied to amountBilledCents to compute total payment amount. This value is represented as a decimal string.

        • updated string(date-time)

          Date and time when the customer made an update to this payment attempt. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      • refunds array[object]

        List that contains payments that MongoDB returned to the organization for this invoice.

        One payment that MongoDB returned to the organization for this invoice.

        Hide refunds attributes Show refunds attributes object
        • amountCents integer(int64)

          Sum of the funds returned to the specified organization expressed in cents (100th of US Dollar).

        • created string(date-time)

          Date and time when MongoDB Cloud created this refund. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

        • paymentId string

          Unique 24-hexadecimal digit string that identifies the payment that the organization had made.

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

        • reason string

          Justification that MongoDB accepted to return funds to the organization.

      • salesTaxCents integer(int64)

        Sum of sales tax applied to this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

      • startDate string(date-time)

        Date and time when MongoDB Cloud began the billing period that this invoice covers. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

      • startingBalanceCents integer(int64)

        Sum that the specified organization owed to MongoDB when MongoDB issued this invoice. This parameter expresses its value in US Dollars.

      • statusName string

        Phase of payment processing in which this invoice exists when you made this request. Accepted phases include:

        • CLOSED: MongoDB finalized all charges in the billing cycle but has yet to charge the customer.
        • FAILED: MongoDB attempted to charge the provided credit card but charge for that amount failed.
        • FORGIVEN: Customer initiated payment which MongoDB later forgave.
        • FREE: All charges totalled zero so the customer won't be charged.
        • INVOICED: MongoDB handled these charges using elastic invoicing.
        • PAID: MongoDB succeeded in charging the provided credit card.
        • PENDING: Invoice includes charges for the current billing cycle.
        • PREPAID: Customer has a pre-paid plan so they won't be charged.

        Values are PENDING, CLOSED, FORGIVEN, FAILED, PAID, FREE, PREPAID, or INVOICED.

      • subtotalCents integer(int64)

        Sum of all positive invoice line items contained in this invoice. This parameter expresses its value in cents (100ths of one US Dollar).

      • updated string(date-time)

        Date and time when MongoDB Cloud last updated the value of this payment. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • 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.

  • 404 application/json

    Not Found.

    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/v2/orgs/{orgId}/invoices/pending
atlas api listPendingInvoices --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListPendingInvoicesApiParams{}
	sdkResp, httpResp, err := client.InvoicesApi.
		ListPendingInvoicesWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/pending?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/pending?pretty=true"
Response examples (200)
{
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "results": [
    {
      "amountBilledCents": 42,
      "amountPaidCents": 42,
      "created": "2025-05-04T09:42:00Z",
      "creditsCents": 42,
      "endDate": "2025-05-04T09:42:00Z",
      "id": "32b6e34b3d91647abb20e7b8",
      "lineItems": [
        {
          "clusterName": "string",
          "created": "2025-05-04T09:42:00Z",
          "discountCents": 42,
          "endDate": "2025-05-04T09:42:00Z",
          "groupId": "32b6e34b3d91647abb20e7b8",
          "groupName": "string",
          "note": "string",
          "percentDiscount": 42.0,
          "quantity": 42.0,
          "sku": "CLASSIC_BACKUP_OPLOG",
          "startDate": "2025-05-04T09:42:00Z",
          "stitchAppName": "string",
          "tags": {
            "additionalProperty1": [
              "string"
            ],
            "additionalProperty2": [
              "string"
            ]
          },
          "tierLowerBound": 42.0,
          "tierUpperBound": 42.0,
          "totalPriceCents": 42,
          "unit": "string",
          "unitPriceDollars": 42.0
        }
      ],
      "linkedInvoices": [
        {}
      ],
      "links": [
        {
          "href": "https://cloud.mongodb.com/api/atlas",
          "rel": "self"
        }
      ],
      "orgId": "32b6e34b3d91647abb20e7b8",
      "payments": [
        {
          "amountBilledCents": 42,
          "amountPaidCents": 42,
          "created": "2025-05-04T09:42:00Z",
          "currency": "string",
          "id": "32b6e34b3d91647abb20e7b8",
          "salesTaxCents": 42,
          "statusName": "NEW",
          "subtotalCents": 42,
          "unitPrice": "string",
          "updated": "2025-05-04T09:42:00Z"
        }
      ],
      "refunds": [
        {
          "amountCents": 42,
          "created": "2025-05-04T09:42:00Z",
          "paymentId": "32b6e34b3d91647abb20e7b8",
          "reason": "string"
        }
      ],
      "salesTaxCents": 42,
      "startDate": "2025-05-04T09:42:00Z",
      "startingBalanceCents": 42,
      "statusName": "PENDING",
      "subtotalCents": 42,
      "updated": "2025-05-04T09:42:00Z"
    }
  ],
  "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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

















Update LDAP or X.509 Configuration

PATCH /api/atlas/v2/groups/{groupId}/userSecurity

Edits the LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.

Updating this configuration triggers a rolling restart of the database.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2023-01-01+json

Body Required

Updates the LDAP configuration for the specified project.

  • customerX509 object

    Settings to configure TLS Certificates for database users.

    Hide customerX509 attribute Show customerX509 attribute object
    • cas string

      Concatenated list of customer certificate authority (CA) certificates needed to authenticate database users. MongoDB Cloud expects this as a PEM-formatted certificate.

  • ldap object

    Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration details that apply to the specified project.

    Hide ldap attributes Show ldap attributes object
    • authenticationEnabled boolean

      Flag that indicates whether users can authenticate using an Lightweight Directory Access Protocol (LDAP) host.

    • authorizationEnabled boolean

      Flag that indicates whether users can authorize access to MongoDB Cloud resources using an Lightweight Directory Access Protocol (LDAP) host.

    • authzQueryTemplate string

      Lightweight Directory Access Protocol (LDAP) query template that MongoDB Cloud runs to obtain the LDAP groups associated with the authenticated user. MongoDB Cloud uses this parameter only for user authorization. Use the {USER} placeholder in the Uniform Resource Locator (URL) to substitute the authenticated username. The query relates to the host specified with the hostname. Format this query according to RFC 4515 and RFC 4516.

      Default value is {USER}?memberOf?base.

    • bindPassword string

      Password that MongoDB Cloud uses to authenticate the bindUsername.

    • bindUsername string

      Full Distinguished Name (DN) of the Lightweight Directory Access Protocol (LDAP) user that MongoDB Cloud uses to connect to the LDAP host. LDAP distinguished names must be formatted according to RFC 2253.

      Format should match the following pattern: ^(?:(?<cn>CN=(?<name>[^,]*)),)?(?:(?<path>(?:(?:CN|OU)=[^,]+,?)+),)?(?<domain>(?:DC=[^,]+,?)+)$.

      RFC 2253
    • caCertificate string

      Certificate Authority (CA) certificate that MongoDB Cloud uses to verify the identity of the Lightweight Directory Access Protocol (LDAP) host. MongoDB Cloud allows self-signed certificates. To delete an assigned value, pass an empty string: "caCertificate": "".

    • hostname string

      Human-readable label that identifies the hostname or Internet Protocol (IP) address of the Lightweight Directory Access Protocol (LDAP) host. This host must have access to the internet or have a Virtual Private Cloud (VPC) peering connection to your cluster.

      Format should match the following 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]+)?$.

    • port integer(int32)

      Port to which the Lightweight Directory Access Protocol (LDAP) host listens for client connections.

      Default value is 636.

    • userToDNMapping array[object]

      User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN.

      User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN.

      Hide userToDNMapping attributes Show userToDNMapping attributes object
      • ldapQuery string

        Lightweight Directory Access Protocol (LDAP) query template that inserts the LDAP name that the regular expression matches into an LDAP query Uniform Resource Identifier (URI). The formatting for the query must conform to RFC 4515 and RFC 4516.

      • match string Required

        Regular expression that MongoDB Cloud uses to match against the provided Lightweight Directory Access Protocol (LDAP) username. Each parenthesis-enclosed section represents a regular expression capture group that the substitution or ldapQuery template uses.

      • substitution string

        Lightweight Directory Access Protocol (LDAP) Distinguished Name (DN) template that converts the LDAP username that matches regular expression in the match parameter into an LDAP Distinguished Name (DN).

Responses

  • 202 application/vnd.atlas.2023-01-01+json

    Accepted

    Hide response attributes Show response attributes object
    • customerX509 object

      Settings to configure TLS Certificates for database users.

      Hide customerX509 attributes Show customerX509 attributes object
      • cas string

        Concatenated list of customer certificate authority (CA) certificates needed to authenticate database users. MongoDB Cloud expects this as a PEM-formatted certificate.

    • ldap object

      Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration details that apply to the specified project.

      Hide ldap attributes Show ldap attributes object
      • authenticationEnabled boolean

        Flag that indicates whether users can authenticate using an Lightweight Directory Access Protocol (LDAP) host.

      • authorizationEnabled boolean

        Flag that indicates whether users can authorize access to MongoDB Cloud resources using an Lightweight Directory Access Protocol (LDAP) host.

      • authzQueryTemplate string

        Lightweight Directory Access Protocol (LDAP) query template that MongoDB Cloud runs to obtain the LDAP groups associated with the authenticated user. MongoDB Cloud uses this parameter only for user authorization. Use the {USER} placeholder in the Uniform Resource Locator (URL) to substitute the authenticated username. The query relates to the host specified with the hostname. Format this query according to RFC 4515 and RFC 4516.

        Default value is {USER}?memberOf?base.

      • bindUsername string

        Full Distinguished Name (DN) of the Lightweight Directory Access Protocol (LDAP) user that MongoDB Cloud uses to connect to the LDAP host. LDAP distinguished names must be formatted according to RFC 2253.

        Format should match the following pattern: ^(?:(?<cn>CN=(?<name>[^,]*)),)?(?:(?<path>(?:(?:CN|OU)=[^,]+,?)+),)?(?<domain>(?:DC=[^,]+,?)+)$.

        RFC 2253
      • caCertificate string

        Certificate Authority (CA) certificate that MongoDB Cloud uses to verify the identity of the Lightweight Directory Access Protocol (LDAP) host. MongoDB Cloud allows self-signed certificates. To delete an assigned value, pass an empty string: "caCertificate": "".

      • hostname string

        Human-readable label that identifies the hostname or Internet Protocol (IP) address of the Lightweight Directory Access Protocol (LDAP) host. This host must have access to the internet or have a Virtual Private Cloud (VPC) peering connection to your cluster.

        Format should match the following 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]+)?$.

      • port integer(int32)

        Port to which the Lightweight Directory Access Protocol (LDAP) host listens for client connections.

        Default value is 636.

      • userToDNMapping array[object]

        User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN.

        User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN.

        Hide userToDNMapping attributes Show userToDNMapping attributes object
        • ldapQuery string

          Lightweight Directory Access Protocol (LDAP) query template that inserts the LDAP name that the regular expression matches into an LDAP query Uniform Resource Identifier (URI). The formatting for the query must conform to RFC 4515 and RFC 4516.

        • match string Required

          Regular expression that MongoDB Cloud uses to match against the provided Lightweight Directory Access Protocol (LDAP) username. Each parenthesis-enclosed section represents a regular expression capture group that the substitution or ldapQuery template uses.

        • substitution string

          Lightweight Directory Access Protocol (LDAP) Distinguished Name (DN) template that converts the LDAP username that matches regular expression in the match parameter into an LDAP Distinguished Name (DN).

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

PATCH /api/atlas/v2/groups/{groupId}/userSecurity
atlas api saveLdapConfiguration --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.SaveLdapConfigurationApiParams{}
	sdkResp, httpResp, err := client.LDAPConfigurationApi.
		SaveLdapConfigurationWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity" \
  -d '{ <Payload> }'
Request examples
{
  "customerX509": {
    "cas": "string"
  },
  "ldap": {
    "authenticationEnabled": true,
    "authorizationEnabled": true,
    "authzQueryTemplate": "{USER}?memberOf?base",
    "bindPassword": "string",
    "bindUsername": "CN=BindUser,CN=Users,DC=myldapserver,DC=mycompany,DC=com",
    "caCertificate": "string",
    "hostname": "string",
    "port": 636,
    "userToDNMapping": [
      {
        "ldapQuery": "string",
        "match": "(.*)",
        "substitution": "CN={0},CN=Users,DC=my-atlas-ldap-server,DC=example,DC=com"
      }
    ]
  }
}
Response examples (202)
{
  "customerX509": {
    "cas": "string",
    "links": [
      {
        "href": "https://cloud.mongodb.com/api/atlas",
        "rel": "self"
      }
    ]
  },
  "ldap": {
    "authenticationEnabled": true,
    "authorizationEnabled": true,
    "authzQueryTemplate": "{USER}?memberOf?base",
    "bindUsername": "CN=BindUser,CN=Users,DC=myldapserver,DC=mycompany,DC=com",
    "caCertificate": "string",
    "hostname": "string",
    "links": [
      {
        "href": "https://cloud.mongodb.com/api/atlas",
        "rel": "self"
      }
    ],
    "port": 636,
    "userToDNMapping": [
      {
        "ldapQuery": "string",
        "match": "(.*)",
        "substitution": "CN={0},CN=Users,DC=my-atlas-ldap-server,DC=example,DC=com"
      }
    ]
  },
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ]
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

Remove LDAP User to DN Mapping

DELETE /api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping

Removes the current LDAP Distinguished Name mapping captured in the userToDNMapping document from the LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 202 application/vnd.atlas.2023-01-01+json

    Accepted

    Hide response attributes Show response attributes object
    • customerX509 object

      Settings to configure TLS Certificates for database users.

      Hide customerX509 attributes Show customerX509 attributes object
      • cas string

        Concatenated list of customer certificate authority (CA) certificates needed to authenticate database users. MongoDB Cloud expects this as a PEM-formatted certificate.

    • ldap object

      Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration details that apply to the specified project.

      Hide ldap attributes Show ldap attributes object
      • authenticationEnabled boolean

        Flag that indicates whether users can authenticate using an Lightweight Directory Access Protocol (LDAP) host.

      • authorizationEnabled boolean

        Flag that indicates whether users can authorize access to MongoDB Cloud resources using an Lightweight Directory Access Protocol (LDAP) host.

      • authzQueryTemplate string

        Lightweight Directory Access Protocol (LDAP) query template that MongoDB Cloud runs to obtain the LDAP groups associated with the authenticated user. MongoDB Cloud uses this parameter only for user authorization. Use the {USER} placeholder in the Uniform Resource Locator (URL) to substitute the authenticated username. The query relates to the host specified with the hostname. Format this query according to RFC 4515 and RFC 4516.

        Default value is {USER}?memberOf?base.

      • bindUsername string

        Full Distinguished Name (DN) of the Lightweight Directory Access Protocol (LDAP) user that MongoDB Cloud uses to connect to the LDAP host. LDAP distinguished names must be formatted according to RFC 2253.

        Format should match the following pattern: ^(?:(?<cn>CN=(?<name>[^,]*)),)?(?:(?<path>(?:(?:CN|OU)=[^,]+,?)+),)?(?<domain>(?:DC=[^,]+,?)+)$.

        RFC 2253
      • caCertificate string

        Certificate Authority (CA) certificate that MongoDB Cloud uses to verify the identity of the Lightweight Directory Access Protocol (LDAP) host. MongoDB Cloud allows self-signed certificates. To delete an assigned value, pass an empty string: "caCertificate": "".

      • hostname string

        Human-readable label that identifies the hostname or Internet Protocol (IP) address of the Lightweight Directory Access Protocol (LDAP) host. This host must have access to the internet or have a Virtual Private Cloud (VPC) peering connection to your cluster.

        Format should match the following 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]+)?$.

      • port integer(int32)

        Port to which the Lightweight Directory Access Protocol (LDAP) host listens for client connections.

        Default value is 636.

      • userToDNMapping array[object]

        User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN.

        User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN.

        Hide userToDNMapping attributes Show userToDNMapping attributes object
        • ldapQuery string

          Lightweight Directory Access Protocol (LDAP) query template that inserts the LDAP name that the regular expression matches into an LDAP query Uniform Resource Identifier (URI). The formatting for the query must conform to RFC 4515 and RFC 4516.

        • match string Required

          Regular expression that MongoDB Cloud uses to match against the provided Lightweight Directory Access Protocol (LDAP) username. Each parenthesis-enclosed section represents a regular expression capture group that the substitution or ldapQuery template uses.

        • substitution string

          Lightweight Directory Access Protocol (LDAP) Distinguished Name (DN) template that converts the LDAP username that matches regular expression in the match parameter into an LDAP Distinguished Name (DN).

  • 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.

  • 404 application/json

    Not Found.

    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.

DELETE /api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping
atlas api deleteLdapConfiguration --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.DeleteLdapConfigurationApiParams{}
	httpResp, err := client.LDAPConfigurationApi.
		DeleteLdapConfigurationWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping"
Response examples (202)
{
  "customerX509": {
    "cas": "string",
    "links": [
      {
        "href": "https://cloud.mongodb.com/api/atlas",
        "rel": "self"
      }
    ]
  },
  "ldap": {
    "authenticationEnabled": true,
    "authorizationEnabled": true,
    "authzQueryTemplate": "{USER}?memberOf?base",
    "bindUsername": "CN=BindUser,CN=Users,DC=myldapserver,DC=mycompany,DC=com",
    "caCertificate": "string",
    "hostname": "string",
    "links": [
      {
        "href": "https://cloud.mongodb.com/api/atlas",
        "rel": "self"
      }
    ],
    "port": 636,
    "userToDNMapping": [
      {
        "ldapQuery": "string",
        "match": "(.*)",
        "substitution": "CN={0},CN=Users,DC=my-atlas-ldap-server,DC=example,DC=com"
      }
    ]
  },
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ]
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}

































Update Snapshot Schedule for One Cluster Deprecated

PATCH /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule

Updates the snapshot schedule for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.

Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation.

Cloud Backup Documentation

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Human-readable label that identifies the cluster with the snapshot you want to return.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2023-01-01+json

Body Required

Update the snapshot schedule for one cluster in the specified project.

  • clusterCheckpointIntervalMin integer(int32) Required

    Quantity of time expressed in minutes between successive cluster checkpoints. This parameter applies only to sharded clusters. This number determines the granularity of continuous cloud backups for sharded clusters.

    Values are 15, 30, or 60.

  • clusterId string Required

    Unique 24-hexadecimal digit string that identifies the cluster with the snapshot you want to return.

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

  • dailySnapshotRetentionDays integer(int32) Required

    Quantity of time to keep daily snapshots. MongoDB Cloud expresses this value in days. Set this value to 0 to disable daily snapshot retention.

    Values are 0, 3, 4, 5, 6, 7, 15, 30, 60, 90, 120, 180, or 360.

  • monthlySnapshotRetentionMonths integer(int32) Required

    Number of months that MongoDB Cloud must keep monthly snapshots. Set this value to 0 to disable monthly snapshot retention.

    Values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 18, 24, or 36.

  • pointInTimeWindowHours integer(int32) Required

    Number of hours before the current time from which MongoDB Cloud can create a Continuous Cloud Backup snapshot.

  • snapshotIntervalHours integer(int32) Required

    Number of hours that must elapse before taking another snapshot.

    Values are 6, 8, 12, or 24.

  • snapshotRetentionDays integer(int32) Required

    Number of days that MongoDB Cloud must keep recent snapshots.

    Values are 2, 3, 4, or 5.

  • weeklySnapshotRetentionWeeks integer(int32) Required

    Number of weeks that MongoDB Cloud must keep weekly snapshots. Set this value to 0 to disable weekly snapshot retention.

    Values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, or 52.

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

    Hide response attributes Show response attributes object
    • clusterCheckpointIntervalMin integer(int32) Required

      Quantity of time expressed in minutes between successive cluster checkpoints. This parameter applies only to sharded clusters. This number determines the granularity of continuous cloud backups for sharded clusters.

      Values are 15, 30, or 60.

    • clusterId string Required

      Unique 24-hexadecimal digit string that identifies the cluster with the snapshot you want to return.

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

    • dailySnapshotRetentionDays integer(int32) Required

      Quantity of time to keep daily snapshots. MongoDB Cloud expresses this value in days. Set this value to 0 to disable daily snapshot retention.

      Values are 0, 3, 4, 5, 6, 7, 15, 30, 60, 90, 120, 180, or 360.

    • groupId string Required

      Unique 24-hexadecimal digit string that identifies the project that contains the cluster.

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

    • monthlySnapshotRetentionMonths integer(int32) Required

      Number of months that MongoDB Cloud must keep monthly snapshots. Set this value to 0 to disable monthly snapshot retention.

      Values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 18, 24, or 36.

    • pointInTimeWindowHours integer(int32) Required

      Number of hours before the current time from which MongoDB Cloud can create a Continuous Cloud Backup snapshot.

    • snapshotIntervalHours integer(int32) Required

      Number of hours that must elapse before taking another snapshot.

      Values are 6, 8, 12, or 24.

    • snapshotRetentionDays integer(int32) Required

      Number of days that MongoDB Cloud must keep recent snapshots.

      Values are 2, 3, 4, or 5.

    • weeklySnapshotRetentionWeeks integer(int32) Required

      Number of weeks that MongoDB Cloud must keep weekly snapshots. Set this value to 0 to disable weekly snapshot retention.

      Values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, or 52.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

PATCH /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule
atlas api updateLegacySnapshotSchedule --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.UpdateLegacySnapshotScheduleApiParams{}
	sdkResp, httpResp, err := client.LegacyBackupApi.
		UpdateLegacySnapshotScheduleWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule" \
  -d '{ <Payload> }'
Request examples
{
  "clusterCheckpointIntervalMin": 15,
  "clusterId": "32b6e34b3d91647abb20e7b8",
  "dailySnapshotRetentionDays": 0,
  "monthlySnapshotRetentionMonths": 0,
  "pointInTimeWindowHours": 42,
  "snapshotIntervalHours": 6,
  "snapshotRetentionDays": 2,
  "weeklySnapshotRetentionWeeks": 0
}
Response examples (200)
{
  "clusterCheckpointIntervalMin": 15,
  "clusterId": "32b6e34b3d91647abb20e7b8",
  "dailySnapshotRetentionDays": 0,
  "groupId": "32b6e34b3d91647abb20e7b8",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "monthlySnapshotRetentionMonths": 0,
  "pointInTimeWindowHours": 42,
  "snapshotIntervalHours": 6,
  "snapshotRetentionDays": 2,
  "weeklySnapshotRetentionWeeks": 0
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}






















































Add One Project Role to One MongoDB Cloud User

POST /api/atlas/v2/groups/{groupId}/users/{userId}:addRole

Adds one project-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has been invited to join the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.

Note: This resource cannot be used to add a role to users invited using the deprecated Invite One MongoDB Cloud User to Join One Project endpoint.

Deprecated: Invite One MongoDB Cloud User to Join One Project

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • userId string Required

    Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2025-02-19+json

Body Required

Project-level role to assign to the MongoDB Cloud user.

  • groupRole string Required

    Project-level role.

    Values are GROUP_OWNER, GROUP_CLUSTER_MANAGER, GROUP_STREAM_PROCESSING_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY, GROUP_READ_ONLY, GROUP_SEARCH_INDEX_EDITOR, GROUP_BACKUP_MANAGER, GROUP_OBSERVABILITY_VIEWER, or GROUP_DATABASE_ACCESS_ADMIN.

Responses

  • 200 application/vnd.atlas.2025-02-19+json

    OK

    One of:
    Hide attributes Show attributes
    • id string Required

      Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.

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

    • orgMembershipStatus string Required Discriminator

      String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.

      Value is PENDING.

    • roles object Required

      Organization- and project-level roles assigned to one MongoDB Cloud user within one organization.

      Hide roles attributes Show roles attributes object
      • groupRoleAssignments array[object]

        List of project-level role assignments assigned to the MongoDB Cloud user.

        Hide groupRoleAssignments attributes Show groupRoleAssignments attributes object
        • groupId string

          Unique 24-hexadecimal digit string that identifies the project to which these roles belong.

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

        • groupRoles array[string]

          One or more project-level roles assigned to the MongoDB Cloud user.

          Values are GROUP_OWNER, GROUP_CLUSTER_MANAGER, GROUP_STREAM_PROCESSING_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY, GROUP_READ_ONLY, GROUP_SEARCH_INDEX_EDITOR, GROUP_BACKUP_MANAGER, GROUP_OBSERVABILITY_VIEWER, or GROUP_DATABASE_ACCESS_ADMIN.

      • orgRoles array[string]

        One or more organization-level roles assigned to the MongoDB Cloud user.

        Values are ORG_OWNER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN, ORG_BILLING_READ_ONLY, ORG_READ_ONLY, or ORG_MEMBER.

    • teamIds array[string]

      List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.

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

    • username string(email) Required

      Email address that represents the username of the MongoDB Cloud user.

    • invitationCreatedAt string(date-time) Required

      Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.

    • invitationExpiresAt string(date-time) Required

      Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.

    • inviterUsername string(email) Required

      Username of the MongoDB Cloud user who sent the invitation to join the organization.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 409 application/json

    Conflict.

    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.

POST /api/atlas/v2/groups/{groupId}/users/{userId}:addRole
atlas api addProjectRole --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.AddProjectRoleApiParams{}
	sdkResp, httpResp, err := client.MongoDBCloudUsersApi.
		AddProjectRoleWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}:addRole" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}:addRole" \
  -d '{ <Payload> }'
Request examples
{
  "groupRole": "GROUP_OWNER"
}
Response examples (200)
{
  "id": "32b6e34b3d91647abb20e7b8",
  "orgMembershipStatus": "PENDING",
  "roles": {
    "groupRoleAssignments": [
      {
        "groupId": "32b6e34b3d91647abb20e7b8",
        "groupRoles": [
          "GROUP_OWNER"
        ]
      }
    ],
    "orgRoles": [
      "ORG_OWNER"
    ]
  },
  "teamIds": [
    "32b6e34b3d91647abb20e7b8"
  ],
  "username": "hello@example.com",
  "invitationCreatedAt": "2025-05-04T09:42:00Z",
  "invitationExpiresAt": "2025-05-04T09:42:00Z",
  "inviterUsername": "hello@example.com"
}
{
  "id": "32b6e34b3d91647abb20e7b8",
  "orgMembershipStatus": "PENDING",
  "roles": {
    "groupRoleAssignments": [
      {
        "groupId": "32b6e34b3d91647abb20e7b8",
        "groupRoles": [
          "GROUP_OWNER"
        ]
      }
    ],
    "orgRoles": [
      "ORG_OWNER"
    ]
  },
  "teamIds": [
    "32b6e34b3d91647abb20e7b8"
  ],
  "username": "hello@example.com",
  "country": "US",
  "createdAt": "2025-05-04T09:42:00Z",
  "firstName": "John",
  "lastAuth": "2025-05-04T09:42:00Z",
  "lastName": "Doe",
  "mobileNumber": "string"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (409)
{
  "error": 409,
  "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",
  "reason": "Conflict",
  "errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
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"
}








































Remove One Organization Role from One MongoDB Cloud User

POST /api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole

Removes one organization-level role from the MongoDB Cloud user. You can remove a role from an active user or a user that has not yet accepted the invitation to join the organization. To replace a user's only role, add the new role before removing the old role. A user must have at least one role at all times. To use this resource, the requesting Service Account or API Key must have the Organization Owner role.

Note: This operation is atomic.

Note: This resource cannot be used to remove a role from users invited using the deprecated Invite One MongoDB Cloud User to Join One Project endpoint.

Invite One MongoDB Cloud User to Join One Project

Path parameters

  • orgId string Required

    Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.

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

  • userId string Required

    Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint
application/vnd.atlas.2025-02-19+json

Body Required

Organization-level role to remove from the MongoDB Cloud user.

  • orgRole string Required

    Organization-level role.

    Values are ORG_OWNER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN, ORG_BILLING_READ_ONLY, ORG_READ_ONLY, or ORG_MEMBER.

Responses

  • 200 application/vnd.atlas.2025-02-19+json

    OK

    One of:
    Hide attributes Show attributes
    • id string Required

      Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.

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

    • orgMembershipStatus string Required Discriminator

      String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.

      Value is PENDING.

    • roles object Required

      Organization- and project-level roles assigned to one MongoDB Cloud user within one organization.

      Hide roles attributes Show roles attributes object
      • groupRoleAssignments array[object]

        List of project-level role assignments assigned to the MongoDB Cloud user.

        Hide groupRoleAssignments attributes Show groupRoleAssignments attributes object
        • groupId string

          Unique 24-hexadecimal digit string that identifies the project to which these roles belong.

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

        • groupRoles array[string]

          One or more project-level roles assigned to the MongoDB Cloud user.

          Values are GROUP_OWNER, GROUP_CLUSTER_MANAGER, GROUP_STREAM_PROCESSING_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY, GROUP_READ_ONLY, GROUP_SEARCH_INDEX_EDITOR, GROUP_BACKUP_MANAGER, GROUP_OBSERVABILITY_VIEWER, or GROUP_DATABASE_ACCESS_ADMIN.

      • orgRoles array[string]

        One or more organization-level roles assigned to the MongoDB Cloud user.

        Values are ORG_OWNER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN, ORG_BILLING_READ_ONLY, ORG_READ_ONLY, or ORG_MEMBER.

    • teamIds array[string]

      List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs.

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

    • username string(email) Required

      Email address that represents the username of the MongoDB Cloud user.

    • invitationCreatedAt string(date-time) Required

      Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.

    • invitationExpiresAt string(date-time) Required

      Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.

    • inviterUsername string(email) Required

      Username of the MongoDB Cloud user who sent the invitation to join the organization.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

POST /api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole
atlas api removeOrganizationRole --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.RemoveOrganizationRoleApiParams{}
	sdkResp, httpResp, err := client.MongoDBCloudUsersApi.
		RemoveOrganizationRoleWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole" \
  -d '{ <Payload> }'
Request examples
{
  "orgRole": "ORG_OWNER"
}
Response examples (200)
{
  "id": "32b6e34b3d91647abb20e7b8",
  "orgMembershipStatus": "PENDING",
  "roles": {
    "groupRoleAssignments": [
      {
        "groupId": "32b6e34b3d91647abb20e7b8",
        "groupRoles": [
          "GROUP_OWNER"
        ]
      }
    ],
    "orgRoles": [
      "ORG_OWNER"
    ]
  },
  "teamIds": [
    "32b6e34b3d91647abb20e7b8"
  ],
  "username": "hello@example.com",
  "invitationCreatedAt": "2025-05-04T09:42:00Z",
  "invitationExpiresAt": "2025-05-04T09:42:00Z",
  "inviterUsername": "hello@example.com"
}
{
  "id": "32b6e34b3d91647abb20e7b8",
  "orgMembershipStatus": "PENDING",
  "roles": {
    "groupRoleAssignments": [
      {
        "groupId": "32b6e34b3d91647abb20e7b8",
        "groupRoles": [
          "GROUP_OWNER"
        ]
      }
    ],
    "orgRoles": [
      "ORG_OWNER"
    ]
  },
  "teamIds": [
    "32b6e34b3d91647abb20e7b8"
  ],
  "username": "hello@example.com",
  "country": "US",
  "createdAt": "2025-05-04T09:42:00Z",
  "firstName": "John",
  "lastAuth": "2025-05-04T09:42:00Z",
  "lastName": "Doe",
  "mobileNumber": "string"
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}













Download Logs for One Cluster Host in One Project

GET /api/atlas/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz

Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for M0 free clusters, M2, M5, flex, or serverless clusters. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip". Deprecated versions: v2-{2023-01-01}

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • hostName string Required

    Human-readable label that identifies the host that stores the log files that you want to download.

    Format should match the following 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]+)?$.

  • logName string Required

    Human-readable label that identifies the log file that you want to return. To return audit logs, enable Database Auditing for the specified project.

    Values are mongodb, mongos, mongodb-audit-log, or mongos-audit-log.

    Set up Database Auditing

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.

  • endDate integer(int64)

    Specifies the date and time for the ending point of the range of log messages to retrieve, in the number of seconds that have elapsed since the UNIX epoch. This value will default to 24 hours after the start date. If the start date is also unspecified, the value will default to the time of the request.

    Minimum value is 1199145600.

  • startDate integer(int64)

    Specifies the date and time for the starting point of the range of log messages to retrieve, in the number of seconds that have elapsed since the UNIX epoch. This value will default to 24 hours prior to the end date. If the end date is also unspecified, the value will default to 24 hours prior to the time of the request.

    Minimum value is 1199145600.

Responses

  • 200 application/vnd.atlas.2023-02-01+gzip

    OK

    Compressed (.gz) log file that contains a range of log messages for the specified host for the specified project

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 409 application/json

    Conflict.

    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/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz
atlas api getHostLogs --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetHostLogsApiParams{}
	sdkResp, httpResp, err := client.MonitoringandLogsApi.
		GetHostLogsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz?pretty=true"
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (409)
{
  "error": 409,
  "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",
  "reason": "Conflict",
  "errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
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"
}




































Return Available Disks for One MongoDB Process

GET /api/atlas/v2/groups/{groupId}/processes/{processId}/disks

Returns the list of disks or partitions for the specified host for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • processId string Required

    Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) 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.

    Format should match the following 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})$.

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/vnd.atlas.2023-01-01+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
      • partitionName string

        Human-readable label of the disk or partition to which the measurements apply.

    • 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.

  • 404 application/json

    Not Found.

    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/v2/groups/{groupId}/processes/{processId}/disks
atlas api listDiskPartitions --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListDiskPartitionsApiParams{}
	sdkResp, httpResp, err := client.MonitoringandLogsApi.
		ListDiskPartitionsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks?pretty=true"
Response examples (200)
{
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/atlas",
      "rel": "self"
    }
  ],
  "results": [
    {
      "links": [
        {
          "href": "https://cloud.mongodb.com/api/atlas",
          "rel": "self"
        }
      ],
      "partitionName": "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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
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"
}




























































































































































Return Schema Advice

GET /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice

Returns the schema suggestions that the Performance Advisor detects. The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

  • clusterName string Required

    Human-readable label that identifies the cluster.

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

Responses

  • 200 application/vnd.atlas.2024-08-05+json

    OK

    Hide response attribute Show response attribute object
    • recommendations array[object]

      List that contains the documents with information about the schema advice that Performance Advisor suggests.

      Hide recommendations attributes Show recommendations attributes object
      • affectedNamespaces array[object]

        List that contains the namespaces and information on why those namespaces triggered the recommendation.

        Hide affectedNamespaces attributes Show affectedNamespaces attributes object
        • namespace string | null

          Namespace of the affected collection. Will be null for REDUCE_NUMBER_OF_NAMESPACE recommendation.

        • triggers array[object]

          List of triggers that specify why the collection activated the recommendation.

          Hide triggers attributes Show triggers attributes object
          • description string

            Description of the trigger type.

          • triggerType string

            Type of trigger.

            Values are PERCENT_QUERIES_USE_LOOKUP, NUMBER_OF_QUERIES_USE_LOOKUP, DOCS_CONTAIN_UNBOUNDED_ARRAY, NUMBER_OF_NAMESPACES, DOC_SIZE_TOO_LARGE, NUM_INDEXES, or QUERIES_CONTAIN_CASE_INSENSITIVE_REGEX.

      • description string

        Description of the specified recommendation.

      • recommendation string

        Type of recommendation.

        Values are REDUCE_LOOKUP_OPS, AVOID_UNBOUNDED_ARRAY, REDUCE_DOCUMENT_SIZE, REMOVE_UNNECESSARY_INDEXES, REDUCE_NUMBER_OF_NAMESPACES, OPTIMIZE_CASE_INSENSITIVE_REGEX_QUERIES, or OPTIMIZE_TEXT_QUERIES.

  • 400 application/json

    Bad Request.

    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.

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 429 application/json

    Too Many Requests.

    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/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice
atlas api listSchemaAdvice --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.ListSchemaAdviceApiParams{}
	sdkResp, httpResp, err := client.PerformanceAdvisorApi.
		ListSchemaAdviceWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice?pretty=true"
Response examples (200)
{
  "recommendations": [
    {
      "affectedNamespaces": [
        {
          "namespace": "string",
          "triggers": [
            {
              "description": "string",
              "triggerType": "PERCENT_QUERIES_USE_LOOKUP"
            }
          ]
        }
      ],
      "description": "string",
      "recommendation": "REDUCE_LOOKUP_OPS"
    }
  ]
}
Response examples (400)
{
  "error": 400,
  "detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
  "reason": "Bad Request",
  "errorCode": "VALIDATION_ERROR"
}
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (429)
{
  "error": 429,
  "detail": "(This is just an example, the exception may not be related to this endpoint)",
  "reason": "Too Many Requests",
  "errorCode": "RATE_LIMITED"
}
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"
}




Return Managed Slow Operation Threshold Status

GET /api/atlas/v2/groups/{groupId}/managedSlowMs

Get whether the Managed Slow MS feature is enabled.

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

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

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.

  • pretty boolean

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

    Default value is false.

    Prettyprint

Responses

  • 200 application/vnd.atlas.2023-01-01+json

    OK

  • 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.

  • 404 application/json

    Not Found.

    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.

  • 429 application/json

    Too Many Requests.

    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/v2/groups/{groupId}/managedSlowMs
atlas api getManagedSlowMs --help
import (
	"os"
	"context"
	"log"
	sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)

func main() {
	ctx := context.Background()
	clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
	clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")

	client, err := sdk.NewClient(
		sdk.UseOAuthAuth(clientID, clientSecret),
		sdk.UseBaseURL(url))

	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	params = &sdk.GetManagedSlowMsApiParams{}
	sdkResp, httpResp, err := client.PerformanceAdvisorApi.
		GetManagedSlowMsWithParams(ctx, params).
		Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs?pretty=true"
Response examples (200)
true
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 (404)
{
  "error": 404,
  "detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
  "reason": "Not Found",
  "errorCode": "RESOURCE_NOT_FOUND"
}
Response examples (429)
{
  "error": 429,
  "detail": "(This is just an example, the exception may not be related to this endpoint)",
  "reason": "Too Many Requests",
  "errorCode": "RATE_LIMITED"
}
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"
}