MongoDB Atlas organizes everything by project (a.k.a. group). Almost every operation requires a groupId (24‑hex string). Within a project the most commonly referenced resources are clusters (identified by their human‑readable clusterName), database users (username + databaseName), backups/snapshots (24‑hex snapshotId), alert configurations/alerts (alertConfigId / alertId), network containers and private endpoints (containerId / endpointId), and various federation or AI resources that use their own IDs. Learn where each ID lives before trying to change things: you will normally call list endpoints to discover IDs, then call create/update/delete endpoints using those values.
How the domain is organized (what to fetch first)
Projects (groups) are the root scope. Most calls require groupId. Within a project:
- Clusters are referenced by
clusterName(label visible in the Atlas UI). Use cluster operations to view status, metrics, snapshots and to create/update/delete clusters. CalllistGroupsto discover projects andlistGroupClustersto discover clusters and theirclusterNamevalues. - Backups and snapshots are tied to a cluster; snapshot and restore operations expect a
clusterNameand snapshot/restore job IDs. Some endpoints differ by cluster type (shared M2/M5 vs dedicated), so choose the matching snapshots/restore endpoint. - Database users are addressed by
usernameanddatabaseNametogether. Some authentication methods change the requireddatabaseNameand username format—see the DB user section. - Network objects (containers, private endpoints) require
containerIdorendpointId; those are obtained from list endpoints for containers or private endpoints. - Federation and identity-provider resources live under a
federationSettingsIdand sometimes also anorgId. Identity provider IDs can be legacy 20‑hex or current 24‑hex depending on API version.
Always call the relevant list operation first to get the exact identifier you need (for example listGroups, listGroupClusters, listGroupAlerts, listGroupClusterSearchIndexes, listGroupAiModelApiKeys).
Common entry points (what to call first)
Use these to discover IDs and names before taking action:
- Get the project id(s):
listGroups→ projectid(24 hex). Most workflows start here. - Get clusters in a project:
listGroupClusters→ useclusterNamefor cluster‑scoped calls. - Find alerts/alert configs:
listGroupAlertsandlistGroupAlertConfigs→alertId/alertConfigId. - Find snapshots/restore jobs:
listGroupClusterSnapshots(orlistGroupClusterBackupSnapshots/listGroupClusterBackupTenantSnapshots) →snapshotId;listGroupClusterBackupRestoreJobs→restoreJobId. - Find database users and certificates:
getGroupDatabaseUser(for a specific user) orlistGroupDatabaseUserCerts(certs), or calllistGroupDatabaseUsers(if available) to enumerate users. - Find search indexes:
listGroupClusterSearchIndexorlistGroupClusterFtsIndex→ indexindexIdorindexName. - Federation / IdP:
listFederationSettingIdentityProvidersandlistFederationSettingConnectedOrgConfigsto discoverfederationSettingsId,identityProviderId, and connected orgs.
Typical user requests and the operation sequences
Below are the most common tasks users ask an assistant to perform and the minimal, reproducible operation sequences to accomplish them.
Project / cluster lifecycle
- Create a project: call
createGroupwithbody: Group. - Create a cluster: call
createGroupClusterwithgroupIdand aLegacyAtlasClusterbody (cluster label becomesclusterName). After create, callgetGroupClusterto verify. - Update a cluster: call
updateGroupClusterwithgroupId,clusterNameand the updated cluster body. Consider theUse-Effective-Instance-Fieldsflag: when true the response includes the original requested hardware fields and separate effective fields; when false you see the current operational values. Note: with autoscaling enabled, that header can affect whether replicationSpec changes are applied. - Delete a cluster: call
deleteGroupClusterwithgroupIdandclusterName. Use theretainBackupsflag if you must preserve cloud backups.
Database users and authentication
- Create a DB user: call
createGroupDatabaseUserwithgroupIdand the user body. The request must includedatabaseName(authentication database) andusername. - Delete a DB user: call
deleteGroupDatabaseUserwithgroupId,databaseName, andusername. - Username and
databaseNamerules (non-obvious):- SCRAM/OIDC Workforce users authenticate against
adminand use an alphanumericusername. - External methods (AWS IAM, x.509, LDAP, OIDC Workload) often use
$externalasdatabaseNameand require specialusernameformats:- AWS IAM:
usernameis the ARN for ROLE or USER types. - x.509:
usernameis an RFC‑2253 DN. - LDAP:
usernameis an RFC‑2253 DN for USER/GROUP. - OIDC Workforce/Workload: format is
<Atlas OIDC IdP ID>/<IdP group or user name>for the IdP Group/User types.
- AWS IAM:
- SCRAM/OIDC Workforce users authenticate against
Always pick the correct databaseName and username format for the authentication method—these determine which delete/get/update endpoints to call and whether the operation will succeed.
Network & IP access
- Inspect current project IP access list:
listGroupAccessListEntries(usegroupId). - Remove an access entry:
deleteGroupAccessListEntrywithgroupIdandentryValue(the API accepts an IP, CIDR, or cloud security construct). Use the list endpoint first to confirm the exactentryValuestring returned by Atlas. - Create containers/private endpoints: use
createGroupContainerfor network containers andcreateGroupBackupPrivateEndpoint/createGroupEncryptionAtRestPrivateEndpointfor private endpoints; find their IDs vialistGroupContainersorlistGroupBackupPrivateEndpoints.
Backups & snapshots
- Take an on‑demand snapshot: call
takeGroupClusterBackupSnapshotswithgroupId,clusterName, and the snapshot request body; snapshot responses will includesnapshotId. - List snapshots: call
listGroupClusterSnapshots(or the appropriate tenant/specific snapshot list) withgroupIdandclusterNameto findsnapshotIdvalues. - Create a restore job:
createGroupClusterBackupRestoreJob(for cloud backup) orcreateGroupClusterBackupTenantRestore(for M2/M5) — pick the endpoint matching the cluster type. - Cancel a restore job:
cancelGroupClusterBackupRestoreJobwithgroupId,clusterName, andrestoreJobId. - Export or update snapshot export buckets and jobs: use
createGroupClusterBackupExport,createGroupBackupExportBucket,updateGroupBackupExportBucket, andgetGroupClusterBackupExportto manage export jobs and buckets.
Note: Atlas exposes legacy and newer backup endpoints; choose the set that matches your cluster type and the snapshot/restore objects returned by the list/get endpoints.
Alerts & incident handling
- Create alert rules:
createGroupAlertConfigwithgroupIdand aGroupAlertsConfigbody. - Toggle an alert config on/off:
toggleGroupAlertConfigwithgroupIdandalertConfigId(body:AlertsToggle). - Acknowledge an alert:
acknowledgeGroupAlertwithgroupIdandalertId(body:AlertView). - List open alerts:
listGroupAlertswithgroupIdand optionalstatusfilter. UsegetGroupAlertto retrieve a single alert.
Atlas Search indexes
- List indexes for a collection:
listGroupClusterSearchIndex(or FTS variant) withgroupId,clusterName,databaseName,collectionName→ returnsindexIdandindexName. - Create an index:
createGroupClusterSearchIndexwithgroupId,clusterName, andSearchIndexCreateRequestbody. - Update by id:
updateGroupClusterSearchIndexwithgroupId,clusterName,indexId, andSearchIndexUpdateRequestbody. - Delete by id or by name: use
deleteGroupClusterSearchIndex(byindexId) ordeleteGroupClusterSearchIndexByName(byindexNameplus db/collection); list first to obtain the correct identifier.
Federation and identity providers
- Discover federations and their identity providers:
listFederationSettingIdentityProviders(needsfederationSettingsId) andlistFederationSettingConnectedOrgConfigs. - Identity provider IDs: older API versions use 20‑hex ids while newer versions use 24‑hex ids—check the
identityProviderIdreturned by the list call before using it in update/delete operations. - Manage role mappings and connected orgs using
createFederationSettingConnectedOrgConfigRoleMapping,listFederationSettingConnectedOrgConfigRoleMappings, and the matching update/delete operations. Many federation operations also accept or require anorgId.
AI model API keys and rate limits
- List, create, update, delete AI model API keys with
listGroupAiModelApiKeys,createGroupAiModelApiKey,updateGroupAiModelApiKey, anddeleteGroupAiModelApiKey(operate using theapiKeyId). - Rate limits: use
listGroupAiModelRateLimits,getGroupAiModelRateLimit(bymodelGroupName), andupdateGroupAiModelRateLimitto inspect and change model rate limits.resetGroupAiModelRateLimitsclears limits for a group.
Logs, metrics, and query shapes
- Download logs:
downloadGroupClusterLogreturns either plain text or base64 (response body may be$text,$base64, or a string). Use the cluster hosthostName,logNameand optional start/end timestamps. - Metrics and coll stats: use the cluster metrics endpoints (for example
listGroupClusterCollStatMeasurements) withclusterName,databaseName,collectionName, and either astart/endwindow or an ISO‑8601periodto retrieve time series. - Query shapes: obtain SHA256 query shape hashes from MongoDB logs or $queryStats/$explain, then use
listGroupClusterQueryShapes,getGroupClusterQueryShape,updateGroupClusterQueryShapeand insight endpoints to manage and inspect rejected or recorded query shapes.
Responses and multiple schemas
Many operations return different schemas depending on API version or cluster type (for example getGroupCluster can return legacy or advanced cluster descriptions). After each call inspect the returned object to determine the appropriate next step—IDs, names, and nested fields differ across responses. When a list call returns items, prefer using the exact identifier delivered in that list (do not try to guess a different id format).
Non‑obvious gotchas and quirks
- groupId vs orgId: group and project are synonymous in Atlas.
groupIdis required for almost every project‑scoped call.orgIdis used for organization‑level resources (API keys assignment, federation connected orgs). Do not mix them. - cluster identity: Atlas uses human‑readable
clusterNamefor most cluster endpoints rather than a separate numeric or hex cluster id. UselistGroupClustersto confirm exact label and casing before calling cluster operations. - Snapshot/restore endpoints vary by cluster family: shared (M2/M5) vs dedicated clusters have different endpoints and response shapes—use list/get to determine which object model your cluster uses and call matching endpoints (e.g., tenant vs disk backup endpoints).
- Identity provider IDs change by API version: some federation APIs expect a 20‑hex legacy id; newer endpoints expect 24‑hex. Discover the id via the list operation you call and pass it through unchanged.
Use-Effective-Instance-Fieldsheader behavior: setting it to true changes how hardware fields are represented in responses (client requested vs effective). When autoscaling is enabled, Atlas may ignore replicationSpec changes if this header is used—be explicit about your intent when updating replication specs.- Database user deletion requires both
databaseNameandusername: the rightdatabaseNamedepends on auth method (adminfor SCRAM/Workforce,$externalfor external methods). Using the wrongdatabaseNamewill not target the intended DB user. - Deleting access list entries: the
entryValuereturned in list responses is the canonical string to use for deletion. Remove using that exact string to avoid mismatches. - Envelope and pretty flags: many endpoints accept
envelopeandpretty.envelope=truewraps the response and adds astatusfield—use it only when the caller expects this wrapper format. - Log/download payloads:
downloadGroupClusterLogand similar download endpoints may return plain text or base64 branches in the response. Inspect which field is present to obtain the text payload.
Quick checklist before calling destructive operations
- Confirm
groupIdfromlistGroupsand verify project membership. - Confirm exact
clusterNamevialistGroupClustersbefore operations that require it. - For snapshot/restore operations, list snapshots first to get
snapshotIdand confirm cluster type (tenant vs disk backup). - For DB user operations, confirm
databaseNameandusernameformats appropriate to the authentication method. - For index or alert work, list the resources first to obtain
indexId/alertConfigId/alertIdbefore delete/acknowledge/update.
Final notes
Workflows in Atlas are discovery → operate → verify. Use the list/get endpoints to discover canonical IDs and names, call the create/update/delete operation that matches the resource type and cluster family, then verify the result with a get/list call. Pay attention to the few header and parameter nuances described above (effective instance fields, auth database for users, identity provider id formats, and backup family differences) — they are the common causes of failed or unexpected operations.