Creates one collection-level restore job for one cluster from the specified project. Collection-level restores allow restoring specific databases or collections from a snapshot or point-in-time.
- Project Backup Recovery Operator
Path parameters
-
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})$. -
Human-readable label that identifies the source cluster for the restore.
Format should match the following pattern:
^[a-zA-Z0-9][a-zA-Z0-9-]*$.
Query parameters
-
Flag that indicates whether Application wraps the response in an
envelopeJSON 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. -
Flag that indicates whether the response body should be in the prettyprint format.
Default value is
false.Prettyprint
Body
Required
Creates one collection-level restore job for one cluster from the specified project.
-
Optional suffix applied to restored collection names.
-
List of collections to restore (up to 100 items).
Not more than
100elements. -
Optional suffix applied to restored database names.
-
List of databases to restore (up to 100 items).
Not more than
100elements. -
Strategy for restoring indexes (all, none, or all except TTL).
Values are
ALL,NONE, orALL_EXCEPT_TTL. -
Oplog increment for point-in-time restore.
-
Oplog timestamp (seconds part) for point-in-time restore.
-
Point-in-time restore time in seconds since UNIX epoch.
-
ID of the snapshot to restore.
Format should match the following pattern:
^([a-f0-9]{24})$. -
Target cluster name.
-
Unique 24-hexadecimal digit string that identifies the target group.
Format should match the following pattern:
^([a-f0-9]{24})$. -
Strategy for writing data on the target (create as new or overwrite existing). With
OVERWRITE_EXISTING, any writes to the affected databases or collections during the restore will be lost when the existing namespaces are dropped and replaced. To avoid data loss, stop writes to the affected namespaces before starting the restore.Values are
CREATE_NEWorOVERWRITE_EXISTING.
atlas api cloudBackups createCollectionRestoreJob --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")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.CreateGroupClusterCollectionRestoreJobApiParams{}
sdkResp, httpResp, err := client.CloudBackupsApi.
CreateGroupClusterCollectionRestoreJobWithParams(ctx, params).
Execute()
}
curl --include --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}/clusters/{clusterName}/collectionRestoreJobs" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--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}/clusters/{clusterName}/collectionRestoreJobs" \
-d '{ <Payload> }'
{
"collectionSuffix": "string",
"collections": [
{
"sourceNamespace": "string",
"targetNamespace": "string"
}
],
"databaseSuffix": "string",
"databases": [
{
"sourceNamespace": "string",
"targetNamespace": "string"
}
],
"indexStrategy": "ALL",
"oplogInc": 42,
"oplogTs": 42,
"pointInTimeUtcSeconds": 42,
"snapshotId": "32b6e34b3d91647abb20e7b8",
"targetClusterName": "string",
"targetGroupId": "32b6e34b3d91647abb20e7b8",
"writeStrategy": "CREATE_NEW"
}
# Headers
# Payload
{
"collectionSuffix": "string",
"collections": [
{
"sourceNamespace": "string",
"targetNamespace": "string"
}
],
"createdAt": "2026-05-04T09:42:00Z",
"databaseSuffix": "string",
"databases": [
{
"sourceNamespace": "string",
"targetNamespace": "string"
}
],
"errorMessage": "string",
"finishedAt": "2026-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"indexStatus": {
"failedCollectionCount": 42,
"state": "NOT_STARTED"
},
"indexStrategy": "ALL",
"oplogInc": 42,
"oplogTs": 42,
"pointInTimeUtcSeconds": 42,
"restoredDocuments": 42,
"snapshotId": "32b6e34b3d91647abb20e7b8",
"state": "INITIALIZING",
"targetClusterName": "string",
"targetGroupId": "32b6e34b3d91647abb20e7b8",
"totalDocuments": 42,
"writeStrategy": "CREATE_NEW"
}
{
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"error": 400,
"errorCode": "VALIDATION_ERROR",
"reason": "Bad Request"
}
{
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"error": 401,
"errorCode": "NOT_ORG_GROUP_CREATOR",
"reason": "Unauthorized"
}
{
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"error": 403,
"errorCode": "CANNOT_CHANGE_GROUP_NAME",
"reason": "Forbidden"
}
{
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"error": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"reason": "Not Found"
}
{
"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",
"error": 409,
"errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK",
"reason": "Conflict"
}
{
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"error": 429,
"errorCode": "RATE_LIMITED",
"reason": "Too Many Requests"
}
{
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"error": 500,
"errorCode": "UNEXPECTED_ERROR",
"reason": "Internal Server Error"
}