Return One Cloud Backup Schedule

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

Returns the cloud backup schedule for the specified 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 Read Only 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

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.

  • 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}/backup/schedule
atlas api getBackupSchedule --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.GetBackupScheduleApiParams{}
	sdkResp, httpResp, err := client.CloudBackupsApi.
		GetBackupScheduleWithParams(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}/backup/schedule?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}/backup/schedule?pretty=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 (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"
}