Service accounts (oauth2)
Learn more about Service Accounts.
Flow type | clientCredentials |
---|---|
Token URL | https://cloud.mongodb.com/api/oauth/token |
The API accepts 2 different authentication methods:
Learn more about Service Accounts.
Flow type | clientCredentials |
---|---|
Token URL | https://cloud.mongodb.com/api/oauth/token |
Returns one Export Bucket associated with the specified Project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}
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})$
.
Unique 24-hexadecimal character string that identifies the Export Bucket.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
atlas api getExportBucket --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.GetExportBucketApiParams{}
sdkResp, httpResp, err := client.CloudBackupsApi.
GetExportBucketWithParams(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}/backup/exportBuckets/{exportBucketId}?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}/backup/exportBuckets/{exportBucketId}?pretty=true"
{
"_id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/atlas"
}
],
"iamRoleId": "668c5f0ed436263134491592",
"bucketName": "export-bucket",
"cloudProvider": "AWS"
}
{
"_id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/atlas"
}
],
"roleId": "668c5f0ed436263134491592",
"tenantId": "4297fc77-1592-4de8-a6d5-a8c32401df87",
"bucketName": "examplecontainer",
"serviceUrl": "https://examplestorageaccount.blob.core.windows.net/examplecontainer",
"cloudProvider": "AZURE"
}
{
"_id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"rel": "self",
"href": "https://cloud.mongodb.com/api/atlas"
}
],
"roleId": "668c5f0ed436263134491592",
"bucketName": "export-bucket",
"cloudProvider": "GCP"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Updates the Backup Compliance Policy settings for 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}
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})$
.
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
.
Flag that indicates whether to overwrite non complying backup policies with the new data protection settings or not.
Default value is true
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
The new Backup Compliance Policy settings.
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
.
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
.
Specifications for on-demand policy.
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
.
Unique 24-hexadecimal digit string that identifies the project for the Backup Compliance Policy.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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.
List that contains the specifications for one scheduled policy.
Specifications for scheduled policy.
atlas api updateDataProtectionSettings --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.UpdateDataProtectionSettingsApiParams{}
sdkResp, httpResp, err := client.CloudBackupsApi.
UpdateDataProtectionSettingsWithParams(ctx, params).
Execute()
}
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2025-03-12+json" \
--header "Content-Type: application/json" \
-X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest \
--header "Accept: application/vnd.atlas.2025-03-12+json" \
--header "Content-Type: application/json" \
-X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy" \
-d '{ <Payload> }'
{
"authorizedEmail": "hello@example.com",
"authorizedUserFirstName": "string",
"authorizedUserLastName": "string",
"copyProtectionEnabled": false,
"encryptionAtRestEnabled": false,
"onDemandPolicyItem": {
"frequencyInterval": 0,
"frequencyType": "ondemand",
"retentionUnit": "days",
"retentionValue": 42
},
"pitEnabled": false,
"projectId": "32b6e34b3d91647abb20e7b8",
"restoreWindowDays": 42,
"scheduledPolicyItems": [
{
"frequencyInterval": 1,
"frequencyType": "daily",
"retentionUnit": "days",
"retentionValue": 42
}
]
}
{
"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"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns all cloud backup restore jobs for one cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role.
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 cluster with the restore jobs you want to return.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api listBackupRestoreJobs --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.ListBackupRestoreJobsApiParams{}
sdkResp, httpResp, err := client.CloudBackupsApi.
ListBackupRestoreJobsWithParams(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/restoreJobs?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/restoreJobs?pretty=true"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"cancelled": true,
"components": [
{
"downloadUrl": "string",
"privateDownloadDeliveryUrls": [
{
"deliveryUrl": "string",
"endpointId": "vpce-3bf78b0ddee411ba1"
}
],
"replicaSetName": "string"
}
],
"deliveryType": "automated",
"deliveryUrl": [
"string"
],
"desiredTimestamp": {
"date": "2025-05-04T09:42:00Z",
"increment": 1199145600
},
"expired": true,
"expiresAt": "2025-05-04T09:42:00Z",
"failed": true,
"finishedAt": "2025-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"oplogInc": 1,
"oplogTs": 42,
"pointInTimeUTCSeconds": 42,
"privateDownloadDeliveryUrls": [
{
"deliveryUrl": "string",
"endpointId": "vpce-3bf78b0ddee411ba1"
}
],
"snapshotId": "32b6e34b3d91647abb20e7b8",
"targetClusterName": "string",
"targetGroupId": "32b6e34b3d91647abb20e7b8",
"timestamp": "2025-05-04T09:42:00Z"
}
],
"totalCount": 42
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
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}
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 cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
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"
{
"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
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns all snapshots of one cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role or Project Backup Manager role.
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 cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api listReplicaSetBackups --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.ListReplicaSetBackupsApiParams{}
sdkResp, httpResp, err := client.CloudBackupsApi.
ListReplicaSetBackupsWithParams(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/snapshots?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/snapshots?pretty=true"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"cloudProvider": "AWS",
"copyRegions": [
"string"
],
"createdAt": "2025-05-04T09:42:00Z",
"description": "string",
"expiresAt": "2025-05-04T09:42:00Z",
"frequencyType": "hourly",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"masterKeyUUID": "string",
"mongodVersion": "string",
"policyItems": [
"32b6e34b3d91647abb20e7b8"
],
"replicaSetName": "string",
"snapshotType": "onDemand",
"status": "queued",
"storageSizeBytes": 42,
"type": "replicaSet"
}
],
"totalCount": 42
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one snapshot from the specified cluster. To use this resource, the requesting Service Account or API Key must have the Project Read Only role or Project Backup Manager role.
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 cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
Unique 24-hexadecimal digit string that identifies the desired snapshot.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getReplicaSetBackup --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.GetReplicaSetBackupApiParams{}
sdkResp, httpResp, err := client.CloudBackupsApi.
GetReplicaSetBackupWithParams(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/snapshots/{snapshotId}?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/snapshots/{snapshotId}?pretty=true"
{
"cloudProvider": "AWS",
"copyRegions": [
"string"
],
"createdAt": "2025-05-04T09:42:00Z",
"description": "string",
"expiresAt": "2025-05-04T09:42:00Z",
"frequencyType": "hourly",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"masterKeyUUID": "string",
"mongodVersion": "string",
"policyItems": [
"32b6e34b3d91647abb20e7b8"
],
"replicaSetName": "string",
"snapshotType": "onDemand",
"status": "queued",
"storageSizeBytes": 42,
"type": "replicaSet"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns the list of regions available for the specified cloud provider at the specified tier. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
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})$
.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
Cloud providers whose regions to retrieve. When you specify multiple providers, the response can return only tiers and regions that support multi-cloud clusters.
Cluster tier for which to retrieve the regions.
atlas api listCloudProviderRegions --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.ListCloudProviderRegionsApiParams{}
sdkResp, httpResp, err := client.ClustersApi.
ListCloudProviderRegionsWithParams(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/provider/regions?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/provider/regions?pretty=true"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"instanceSizes": [
{
"availableRegions": [
{
"default": true,
"name": "string"
}
],
"name": "string"
}
],
"provider": "AWS"
}
],
"totalCount": 42
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
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.
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 this cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
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"
{
"autoScalingMode": "INDEPENDENT_SHARD_SCALING"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one custom role for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
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 role for the request. This name must be unique for this custom role in this project.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getCustomDatabaseRole --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.GetCustomDatabaseRoleApiParams{}
sdkResp, httpResp, err := client.CustomDatabaseRolesApi.
GetCustomDatabaseRoleWithParams(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}/customDBRoles/roles/{roleName}?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}/customDBRoles/roles/{roleName}?pretty=true"
{
"actions": [
{
"action": "FIND",
"resources": [
{
"cluster": true,
"collection": "string",
"db": "string"
}
]
}
],
"inheritedRoles": [
{
"db": "string",
"role": "string"
}
],
"roleName": "string"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Removes one Data Lake Pipeline.
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 Data Lake Pipeline.
Format should match the following pattern: ^[^/\\ "$]{1,64}$
.
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
.
atlas api deletePipeline --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.DeletePipelineApiParams{}
httpResp, err := client.DataLakePipelinesApi.
DeletePipelineWithParams(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}/pipelines/{pipelineName}"
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}/pipelines/{pipelineName}"
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one database user that belong to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
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})$
.
The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be $external
. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be admin
.
Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication:
Authentication Method | Parameter Needed | Parameter Value | username Format |
---|---|---|---|
AWS IAM | awsIAMType | ROLE | ARN |
AWS IAM | awsIAMType | USER | ARN |
x.509 | x509Type | CUSTOMER | RFC 2253 Distinguished Name |
x.509 | x509Type | MANAGED | RFC 2253 Distinguished Name |
LDAP | ldapAuthType | USER | RFC 2253 Distinguished Name |
LDAP | ldapAuthType | GROUP | RFC 2253 Distinguished Name |
OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name |
OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name |
SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string |
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getDatabaseUser --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.GetDatabaseUserApiParams{}
sdkResp, httpResp, err := client.DatabaseUsersApi.
GetDatabaseUserWithParams(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}/databaseUsers/{databaseName}/{username}?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}/databaseUsers/{databaseName}/{username}?pretty=true"
{
"awsIAMType": "NONE",
"databaseName": "admin",
"deleteAfterDate": "2025-05-04T09:42:00Z",
"description": "string",
"labels": [
{
"key": "string",
"value": "string"
}
],
"ldapAuthType": "NONE",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"oidcAuthType": "NONE",
"roles": [
{
"collectionName": "string",
"databaseName": "string",
"roleName": "atlasAdmin"
}
],
"scopes": [
{
"name": "string",
"type": "CLUSTER"
}
],
"username": "string",
"x509Type": "NONE"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Creates a private endpoint in the specified region for encryption at rest using customer key management.
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 cloud provider for the private endpoint to create.
Values are AZURE
or AWS
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
Creates a private endpoint in the specified region.
Azure Key Vault Encryption At Rest Private Endpoint.
Cloud provider region in which the Encryption At Rest private endpoint is located.
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
.
Cloud provider region in which the Encryption At Rest private endpoint is located.
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
.
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> }'
{
"regionName": "US_CENTRAL"
}
{
"regionName": "US_CENTRAL"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns a list of all event types, along with a description and additional metadata about each event.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api listEventTypes --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.ListEventTypesApiParams{}
sdkResp, httpResp, err := client.EventsApi.
ListEventTypesWithParams(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/eventTypes?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/eventTypes?pretty=true"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"alertable": true,
"description": "string",
"eventType": "string"
}
],
"totalCount": 42
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one event for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return Events from One Project endpoint to retrieve all events to which the authenticated user has access.
This resource remains under revision and may change.
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})$
.
Unique 24-hexadecimal digit string that identifies the event that you want to return.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
Flag that indicates whether to include the raw document in the output. The raw document contains additional meta information about the event.
Default value is false
.
OK
Other events which don't have extra details beside of basic one.
Unauthorized.
Forbidden.
Not Found.
Internal Server Error.
atlas api getProjectEvent --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.GetProjectEventApiParams{}
sdkResp, httpResp, err := client.EventsApi.
GetProjectEventWithParams(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}/events/{eventId}?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}/events/{eventId}?pretty=true"
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "AUTO_INDEXING_ENABLED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"alertId": "32b6e34b3d91647abb20e7b8",
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "ALERT_ACKNOWLEDGED_AUDIT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "ALERT_CONFIG_ADDED_AUDIT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "API_KEY_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "SERVICE_ACCOUNT_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "AUTOMATION_CONFIG_PUBLISHED_AUDIT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "DEPLOYMENT_FAILURE",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
}
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "CREDIT_CARD_CURRENT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"invoiceId": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"paymentId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "CLUSTER_MONGOS_IS_PRESENT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"shardName": "event-sh-01"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"collection": "test_collection",
"created": "2025-05-04T09:42:00Z",
"database": "test_db",
"eventTypeName": "DATA_EXPLORER",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"opType": "insertDocument",
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "DATA_EXPLORER_SESSION_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"sessionId": "32b6e34b3d91647abb20e7b8",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "FTS_INDEX_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"deskLocation": "string",
"employeeIdentifier": "string",
"eventTypeName": "HOST_DOWN",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"port": 27017,
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"replicaSetName": "event-replica-set",
"shardName": "event-sh-01",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"currentValue": {
"number": 42.0,
"units": "bits"
},
"deskLocation": "string",
"employeeIdentifier": "string",
"eventTypeName": "OUTSIDE_METRIC_THRESHOLD",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"metricName": "string",
"orgId": "32b6e34b3d91647abb20e7b8",
"port": 27017,
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"replicaSetName": "event-replica-set",
"shardName": "event-sh-01",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"dbUserUsername": "user1",
"eventTypeName": "CLUSTER_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com",
"whitelistEntry": "0.0.0.0"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "COMPUTE_AUTO_SCALE_INITIATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "SERVERLESS_INSTANCE_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"endpointId": "32b6e34b3d91647abb20e7b8",
"eventTypeName": "TENANT_ENDPOINT_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"providerEndpointId": "vpce-0d6c248dedef65a25",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "PRIMARY_ELECTED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"port": 27017,
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"replicaSetName": "event-replica-set",
"shardName": "event-sh-01"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "SEARCH_DEPLOYMENT_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "TEAM_ADDED_TO_GROUP",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"teamId": "32b6e34b3d91647abb20e7b8",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "JOINED_GROUP",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"targetUsername": "test.user@mongodb.com",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "TAGS_MODIFIED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"resourceId": "32b6e34b3d91647abb20e7b8",
"resourceType": "cluster",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "MAX_PROCESSOR_COUNT_REACHED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"instanceName": "foobar",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
}
}
{
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "STREAM_PROCESSOR_STATE_IS_FAILED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"instanceName": "foobar",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"processorErrorMsg": "invalid auth",
"processorName": "foobar",
"processorState": "FAILED",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
}
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "CHARTS_API_SUCCESS",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "RESOURCE_POLICY_VIOLATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"resourcePolicyId": "32b6e34b3d91647abb20e7b8",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com",
"violatedPolicies": [
"string"
],
"violationAction": "string"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one event for the specified organization. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting Service Account or API Key must have the Organization Member role. Use the Return Events from One Organization endpoint to retrieve all events to which the authenticated user has access.
This resource remains under revision and may change.
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})$
.
Unique 24-hexadecimal digit string that identifies the event that you want to return.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
Flag that indicates whether to include the raw document in the output. The raw document contains additional meta information about the event.
Default value is false
.
OK
Other events which don't have extra details beside of basic one.
Unauthorized.
Forbidden.
Not Found.
Internal Server Error.
atlas api getOrganizationEvent --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.GetOrganizationEventApiParams{}
sdkResp, httpResp, err := client.EventsApi.
GetOrganizationEventWithParams(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}/events/{eventId}?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}/events/{eventId}?pretty=true"
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "FEDERATION_SETTINGS_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"alertId": "32b6e34b3d91647abb20e7b8",
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "ALERT_ACKNOWLEDGED_AUDIT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "ALERT_CONFIG_ADDED_AUDIT",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "API_KEY_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "SERVICE_ACCOUNT_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "CHARGE_SUCCEEDED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"invoiceId": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"paymentId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"dbUserUsername": "user1",
"eventTypeName": "ORG_LIMIT_UPDATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com",
"whitelistEntry": "0.0.0.0"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "ORG_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"invoiceId": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "TEAM_ADDED_TO_GROUP",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"teamId": "32b6e34b3d91647abb20e7b8",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "JOINED_ORG",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"targetUsername": "test.user@mongodb.com",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "GROUP_TAGS_MODIFIED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"resourceId": "32b6e34b3d91647abb20e7b8",
"resourceType": "cluster",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"apiKeyId": "32b6e34b3d91647abb20e7b8",
"created": "2025-05-04T09:42:00Z",
"eventTypeName": "RESOURCE_POLICY_CREATED",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"orgId": "32b6e34b3d91647abb20e7b8",
"publicKey": "string",
"raw": {
"_t": "ALERT_AUDIT",
"alertConfigId": "32b6e34b3d91647abb20e7b8",
"cid": "32b6e34b3d91647abb20e7b8",
"cre": "2025-05-04T09:42:00Z",
"description": "Alert Acknowledged",
"gn": "Test Project",
"id": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"orgName": "Test Organization",
"severity": "INFO"
},
"remoteAddress": "216.172.40.186",
"resourcePolicyId": "32b6e34b3d91647abb20e7b8",
"userId": "32b6e34b3d91647abb20e7b8",
"username": "hello@example.com"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns details for one flex cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
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 flex cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getFlexCluster --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.GetFlexClusterApiParams{}
sdkResp, httpResp, err := client.FlexClustersApi.
GetFlexClusterWithParams(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}/flexClusters/{name}?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}/flexClusters/{name}?pretty=true"
{
"backupSettings": {
"enabled": true
},
"clusterType": "REPLICASET",
"connectionStrings": {
"standard": "string",
"standardSrv": "string"
},
"createDate": "2025-05-04T09:42:00Z",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"mongoDBVersion": "string",
"name": "string",
"providerSettings": {
"backingProviderName": "AWS",
"diskSizeGB": 42.0,
"providerName": "FLEX",
"regionName": "string"
},
"stateName": "IDLE",
"tags": [
{
"key": "string",
"value": "string"
}
],
"terminationProtectionEnabled": false,
"versionReleaseSystem": "LTS"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one invoice that MongoDB issued to the specified organization in CSV format. A unique 24-hexadecimal digit string identifies the invoice. To use this resource, the requesting Service Account or API Key have at least the Organization Billing Viewer, Organization Billing Admin, or Organization Owner role. If you have a cross-organization setup, you can query for a linked invoice if you have the Organization Billing Admin or Organization Owner Role. To compute the total owed amount of the invoice - sum up total owed amount of each payment included into the invoice. To compute payment's owed amount - use formula totalBilledCents * unitPrice + salesTax - startingBalanceCents.
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})$
.
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: [0-9a-f]+
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api downloadInvoiceCsv --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.DownloadInvoiceCsvApiParams{}
sdkResp, httpResp, err := client.InvoicesApi.
DownloadInvoiceCsvWithParams(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/{invoiceId}/csv?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/{invoiceId}/csv?pretty=true"
Invoice Number,666acb8787ba43606905dcae,
Billing Period,"June 1, 2024 - July 1, 2024",
Organization Name,Test 2,
Organization ID,666acb8787ba43606905dcac,
Date,Usage Date,Description,Note,Organization Name,Organization ID,Project,Project ID,SKU,Region,Cluster,Replica Set,Config Server,Application,Unit,Unit Price,Quantity,Discount Percent,Amount
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
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.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
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"
{
"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"
}
]
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns all legacy backup snapshots for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only 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.
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 cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
Human-readable label that specifies whether to return only completed, incomplete, or all snapshots. By default, MongoDB Cloud only returns completed snapshots.
Values are all
, true
, or false
. Default value is true
.
atlas api listLegacySnapshots --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.ListLegacySnapshotsApiParams{}
sdkResp, httpResp, err := client.LegacyBackupApi.
ListLegacySnapshotsWithParams(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}/snapshots?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}/snapshots?pretty=true"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"clusterId": "32b6e34b3d91647abb20e7b8",
"clusterName": "string",
"complete": true,
"created": {
"date": "2025-05-04T09:42:00Z",
"increment": 1199145600
},
"doNotDelete": true,
"expires": "2025-05-04T09:42:00Z",
"groupId": "32b6e34b3d91647abb20e7b8",
"id": "32b6e34b3d91647abb20e7b8",
"incremental": true,
"lastOplogAppliedTimestamp": {
"date": "2025-05-04T09:42:00Z",
"increment": 1199145600
},
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"parts": [
{
"clusterId": "32b6e34b3d91647abb20e7b8",
"completedTime": "2025-05-04T09:42:00Z",
"compressionSetting": "NONE",
"dataSizeBytes": 42,
"encryptionEnabled": true,
"fcv": "string",
"fileSizeBytes": 42,
"machineId": "string",
"masterKeyUUID": "string",
"mongodVersion": "string",
"replicaSetName": "string",
"replicaState": "string",
"storageSizeBytes": 42,
"typeName": "REPLICA_SET"
}
]
}
],
"totalCount": 42
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Creates one MongoDB Cloud user account. A MongoDB Cloud user account grants access to only the MongoDB Cloud application. To grant database access, create a database user. MongoDB Cloud sends an email to the users you specify, inviting them to join the project. Invited users don't have access to the project until they accept the invitation. Invitations expire after 30 days.
MongoDB Cloud limits MongoDB Cloud user membership to a maximum of 250 MongoDB Cloud users per team. MongoDB Cloud limits MongoDB Cloud user membership to 500 MongoDB Cloud users per project and 500 MongoDB Cloud users per organization, which includes the combined membership of all projects in the organization. MongoDB Cloud raises an error if an operation exceeds these limits. For example, if you have an organization with five projects, and each project has 100 MongoDB Cloud users, and each MongoDB Cloud user belongs to only one project, you can't add any MongoDB Cloud users to this organization without first removing existing MongoDB Cloud users from the organization.
To use this resource, the requesting Service Account or API Key can have any role.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
MongoDB Cloud user account to create.
Two alphabet characters that identifies MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.
Format should match the following pattern: ^([A-Z]{2})$
.
First or given name that belongs to the MongoDB Cloud user.
Last name, family name, or surname that belongs to the MongoDB Cloud user.
Mobile phone number that belongs to the MongoDB Cloud user.
Format should match the following pattern: (?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$
.
Password applied with the username to log in to MongoDB Cloud. MongoDB Cloud does not return this parameter except in response to creating a new MongoDB Cloud user. Only the MongoDB Cloud user can update their password after it has been set from the MongoDB Cloud console.
Minimum length is 8
.
List of objects that display the MongoDB Cloud user's roles and the corresponding organization or project to which that role applies. A role can apply to one organization or one project but not both.
MongoDB Cloud user's roles and the corresponding organization or project to which that role applies. Each role can apply to one organization or one project but not both.
Email address that represents the username of the MongoDB Cloud user.
atlas api createUser --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.CreateUserApiParams{}
sdkResp, httpResp, err := client.MongoDBCloudUsersApi.
CreateUserWithParams(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/users" \
-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/users" \
-d '{ <Payload> }'
{
"country": "string",
"firstName": "string",
"lastName": "string",
"mobileNumber": "string",
"password": "string",
"roles": [
{
"groupId": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"roleName": "ORG_MEMBER"
}
],
"username": "hello@example.com"
}
{
"country": "string",
"createdAt": "2025-05-04T09:42:00Z",
"emailAddress": "hello@example.com",
"firstName": "string",
"id": "32b6e34b3d91647abb20e7b8",
"lastAuth": "2025-05-04T09:42:00Z",
"lastName": "string",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"mobileNumber": "string",
"password": "string",
"roles": [
{
"groupId": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"roleName": "ORG_MEMBER"
}
],
"teamIds": [
"32b6e34b3d91647abb20e7b8"
],
"username": "hello@example.com"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Removes one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role.
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})$
.
Unique 24-hexadecimal digit string that identifies the online archive to delete.
Format should match the following pattern: ^([a-f0-9]{24})$
.
Human-readable label that identifies the cluster that contains the collection from which you want to remove an online archive.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api deleteOnlineArchive --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.DeleteOnlineArchiveApiParams{}
httpResp, err := client.OnlineArchiveApi.
DeleteOnlineArchiveWithParams(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}/onlineArchives/{archiveId}"
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}/onlineArchives/{archiveId}"
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns details about the specified organization's settings. To use this resource, the requesting Service Account or API Key must have the Organization Member role.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getOrganizationSettings --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.GetOrganizationSettingsApiParams{}
sdkResp, httpResp, err := client.OrganizationsApi.
GetOrganizationSettingsWithParams(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}/settings?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}/settings?pretty=true"
{
"apiAccessListRequired": true,
"genAIFeaturesEnabled": true,
"maxServiceAccountSecretValidityInHours": 42,
"multiFactorAuthRequired": true,
"restrictEmployeeAccess": true,
"securityContact": "string",
"streamsCrossGroupEnabled": true
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Get whether the Managed Slow MS feature is enabled.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
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"
true
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 429,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Too Many Requests",
"errorCode": "RATE_LIMITED"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Disables the slow operation threshold that MongoDB Cloud calculated for the specified project. The threshold determines which operations the Performance Advisor and Query Profiler considers slow. When enabled, MongoDB Cloud uses the average execution time for operations on your cluster to determine slow-running queries. As a result, the threshold is more pertinent to your cluster workload. The slow operation threshold is enabled by default for dedicated clusters (M10+). When disabled, MongoDB Cloud considers any operation that takes longer than 100 milliseconds to be slow. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api disableSlowOperationThresholding --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.DisableSlowOperationThresholdingApiParams{}
httpResp, err := client.PerformanceAdvisorApi.
DisableSlowOperationThresholdingWithParams(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}/managedSlowMs/disable"
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}/managedSlowMs/disable"
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 429,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Too Many Requests",
"errorCode": "RATE_LIMITED"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns the indexes that the Performance Advisor suggests. The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
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})$
.
Combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address 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})$
.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
Length of time expressed during which the query finds suggested indexes among the managed namespaces in the cluster. This parameter expresses its value in milliseconds.
Namespaces from which to retrieve suggested indexes. A namespace consists of one database and one collection resource written as .
: <database>.<collection>
. To include multiple namespaces, pass the parameter multiple times delimited with an ampersand (&
) between each namespace. Omit this parameter to return results for all namespaces.
Maximum number of example queries that benefit from the suggested index.
Default value is 5
.
Number that indicates the maximum indexes to suggest.
Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the UNIX epoch.
Minimum value is 1199145600000
.
atlas api listSuggestedIndexes --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.ListSuggestedIndexesApiParams{}
sdkResp, httpResp, err := client.PerformanceAdvisorApi.
ListSuggestedIndexesWithParams(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}/performanceAdvisor/suggestedIndexes?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}/performanceAdvisor/suggestedIndexes?pretty=true"
{
"shapes": [
{
"avgMs": 42,
"count": 42,
"id": "32b6e34b3d91647abb20e7b8",
"inefficiencyScore": 42,
"namespace": "string",
"operations": [
{
"predicates": [
{}
],
"stats": {
"ms": 42,
"nReturned": 42,
"nScanned": 42,
"ts": 42
}
}
]
}
],
"suggestedIndexes": [
{
"avgObjSize": 42.0,
"id": "32b6e34b3d91647abb20e7b8",
"impact": [
"string"
],
"index": [
{
"additionalProperty1": 1,
"additionalProperty2": 1
}
],
"namespace": "string",
"weight": 42.0
}
]
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 429,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Too Many Requests",
"errorCode": "RATE_LIMITED"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Set whether the Serverless Auto Indexing feature is enabled. This endpoint sets a value for Flex clusters that were created with the createServerlessInstance endpoint or Flex clusters that were migrated from Serverless instances. However, the value returned is not indicative of the Auto Indexing state as Auto Indexing is unavailable for Flex clusters. This endpoint will be sunset in January 2026.
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 cluster.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
Value that we want to set for the Serverless Auto Indexing toggle.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api setServerlessAutoIndexing --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.SetServerlessAutoIndexingApiParams{}
sdkResp, httpResp, err := client.PerformanceAdvisorApi.
SetServerlessAutoIndexingWithParams(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}/serverless/{clusterName}/performanceAdvisor/autoIndexing" \
-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}/serverless/{clusterName}/performanceAdvisor/autoIndexing" \
-d '{ <Payload> }'
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 429,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Too Many Requests",
"errorCode": "RATE_LIMITED"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one organization API key. The organization API keys grant programmatic access to an organization. You can't use the API key to log into MongoDB Cloud through the user interface. To use this resource, the requesting Service Account or API Key must have the Organization Member role.
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})$
.
Unique 24-hexadecimal digit string that identifies this organization API key that you want to update.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getApiKey --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.GetApiKeyApiParams{}
sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi.
GetApiKeyWithParams(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}/apiKeys/{apiUserId}?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}/apiKeys/{apiUserId}?pretty=true"
{
"desc": "string",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"privateKey": "55c3bbb6-b4bb-0be1-e66d20841f3e",
"publicKey": "zmmrboas",
"roles": [
{
"groupId": "32b6e34b3d91647abb20e7b8",
"orgId": "32b6e34b3d91647abb20e7b8",
"roleName": "ORG_MEMBER"
}
]
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns one access list entry for the specified organization API key. Resources require all API requests originate from IP addresses on the API access list. To use this resource, the requesting Service Account or API Key must have the Organization Member role.
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})$
.
One IP address or multiple IP addresses represented as one CIDR block to limit requests to API resources in the specified organization. When adding a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /.
Format should match the following pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$
.
Unique 24-hexadecimal digit string that identifies this organization API key for which you want to return access list entries.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getApiKeyAccessList --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.GetApiKeyAccessListApiParams{}
sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi.
GetApiKeyAccessListWithParams(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}/apiKeys/{apiUserId}/accessList/{ipAddress}?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}/apiKeys/{apiUserId}/accessList/{ipAddress}?pretty=true"
{
"cidrBlock": "203.0.113.0/24",
"count": 42,
"created": "2025-05-04T09:42:00Z",
"ipAddress": "203.0.113.10",
"lastUsed": "2025-05-04T09:42:00Z",
"lastUsedAddress": "203.0.113.10",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
]
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Adds one or more access list entries to the specified project. MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. Write each entry as either one IP address or one CIDR-notated block of IP addresses. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Charts Admin roles. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. The /groups/{GROUP-ID}/accessList
endpoint manages the database IP access list. This endpoint is distinct from the orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist
endpoint, which manages the access list for MongoDB Cloud organizations. This endpoint doesn't support concurrent POST
requests. You must submit multiple POST
requests synchronously.
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})$
.
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
.
Flag that indicates whether the response returns the total number of items (totalCount) in the response.
Default value is true
.
Number of items that the response returns per page.
Minimum value is 1
, maximum value is 500
. Default value is 100
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
One or more access list entries to add to the specified project.
Unique string of the Amazon Web Services (AWS) security group that you want to add to the project's IP access list. Your IP access list entry can be one awsSecurityGroup, one cidrBlock, or one ipAddress. You must configure Virtual Private Connection (VPC) peering for your project before you can add an AWS security group to an IP access list. You cannot set AWS security groups as temporary access list entries. Don't set this parameter if you set cidrBlock or ipAddress.
Format should match the following pattern: ^([0-9]*/)?sg-([0-9]*)
.
Range of IP addresses in Classless Inter-Domain Routing (CIDR) notation that you want to add to the project's IP access list. Your IP access list entry can be one awsSecurityGroup, one cidrBlock, or one ipAddress. Don't set this parameter if you set awsSecurityGroup or ipAddress.
Format should match the following pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$
.
Remark that explains the purpose or scope of this IP access list entry.
Maximum length is 80
.
Date and time after which MongoDB Cloud deletes the temporary access list entry. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. The date must be later than the current date but no later than one week after you submit this request. The resource returns this parameter if you specified an expiration date when creating this IP access list entry.
IP address that you want to add to the project's IP access list. Your IP access list entry can be one awsSecurityGroup, one cidrBlock, or one ipAddress. Don't set this parameter if you set awsSecurityGroup or cidrBlock.
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}$
.
atlas api createProjectIpAccessList --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.CreateProjectIpAccessListApiParams{}
sdkResp, httpResp, err := client.ProjectIPAccessListApi.
CreateProjectIpAccessListWithParams(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}/accessList" \
-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}/accessList" \
-d '{ <Payload> }'
[
{
"awsSecurityGroup": "string",
"cidrBlock": "string",
"comment": "string",
"deleteAfterDate": "2025-05-04T09:42:00Z",
"ipAddress": "string"
}
]
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"awsSecurityGroup": "string",
"cidrBlock": "string",
"comment": "string",
"deleteAfterDate": "2025-05-04T09:42:00Z",
"groupId": "32b6e34b3d91647abb20e7b8",
"ipAddress": "string",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
]
}
],
"totalCount": 42
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Updates the human-readable label that identifies the specified project, or the tags associated with the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api updateProject --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.UpdateProjectApiParams{}
sdkResp, httpResp, err := client.ProjectsApi.
UpdateProjectWithParams(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}" \
-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}" \
-d '{ <Payload> }'
{
"name": "string",
"tags": [
{
"key": "string",
"value": "string"
}
]
}
{
"clusterCount": 42,
"created": "2025-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"name": "string",
"orgId": "32b6e34b3d91647abb20e7b8",
"regionUsageRestrictions": "COMMERCIAL_FEDRAMP_REGIONS_ONLY",
"tags": [
{
"key": "string",
"value": "string"
}
]
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Updates the details of one pending invitation to the specified project. To specify which invitation to update, provide the unique identification string for that invitation. Use the Return All Project Invitations endpoint to retrieve IDs for all pending project invitations. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
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})$
.
Unique 24-hexadecimal digit string that identifies the invitation.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Updates the details of one pending invitation to the specified project.
One or more project-level roles to assign to the MongoDB Cloud user.
Values are 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
.
atlas api updateProjectInvitationById --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.UpdateProjectInvitationByIdApiParams{}
sdkResp, httpResp, err := client.ProjectsApi.
UpdateProjectInvitationByIdWithParams(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}/invites/{invitationId}" \
-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}/invites/{invitationId}" \
-d '{ <Payload> }'
{
"roles": [
"GROUP_BACKUP_MANAGER"
]
}
{
"createdAt": "2025-05-04T09:42:00Z",
"expiresAt": "2025-05-04T09:42:00Z",
"groupId": "32b6e34b3d91647abb20e7b8",
"groupName": "string",
"id": "32b6e34b3d91647abb20e7b8",
"inviterUsername": "hello@example.com",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"roles": [
"GROUP_BACKUP_MANAGER"
],
"username": "hello@example.com"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Returns the specified limit for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role.
Human-readable label that identifies this project limit.
Limit Name | Description | Default | API Override Limit |
---|---|---|---|
atlas.project.deployment.clusters | Limit on the number of clusters in this project if the org is not sales-sold (If org is sales-sold, the limit is 100) | 25 | 90 |
atlas.project.deployment.nodesPerPrivateLinkRegion | Limit on the number of nodes per Private Link region in this project | 50 | 90 |
atlas.project.security.databaseAccess.customRoles | Limit on the number of custom roles in this project | 100 | 1400 |
atlas.project.security.databaseAccess.users | Limit on the number of database users in this project | 100 | 900 |
atlas.project.security.networkAccess.crossRegionEntries | Limit on the number of cross-region network access entries in this project | 40 | 220 |
atlas.project.security.networkAccess.entries | Limit on the number of network access entries in this project | 200 | 20 |
dataFederation.bytesProcessed.query | Limit on the number of bytes processed during a single Data Federation query | N/A | N/A |
dataFederation.bytesProcessed.daily | Limit on the number of bytes processed across all Data Federation tenants for the current day | N/A | N/A |
dataFederation.bytesProcessed.weekly | Limit on the number of bytes processed across all Data Federation tenants for the current week | N/A | N/A |
dataFederation.bytesProcessed.monthly | Limit on the number of bytes processed across all Data Federation tenants for the current month | N/A | N/A |
atlas.project.deployment.privateServiceConnectionsPerRegionGroup | Number of Private Service Connections per Region Group | 50 | 100 |
atlas.project.deployment.privateServiceConnectionsSubnetMask | Subnet mask for GCP PSC Networks. Has lower limit of 20. | 27 | 27 |
atlas.project.deployment.salesSoldM0s | Limit on the number of M0 clusters in this project if the org is sales-sold | 100 | 100 |
Values are atlas.project.security.databaseAccess.users
, atlas.project.deployment.clusters
, atlas.project.deployment.serverlessMTMs
, atlas.project.security.databaseAccess.customRoles
, atlas.project.security.networkAccess.entries
, atlas.project.security.networkAccess.crossRegionEntries
, atlas.project.deployment.nodesPerPrivateLinkRegion
, dataFederation.bytesProcessed.query
, dataFederation.bytesProcessed.daily
, dataFederation.bytesProcessed.weekly
, dataFederation.bytesProcessed.monthly
, atlas.project.deployment.privateServiceConnectionsPerRegionGroup
, atlas.project.deployment.privateServiceConnectionsSubnetMask
, or atlas.project.deployment.salesSoldM0s
.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api getProjectLimit --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.GetProjectLimitApiParams{}
sdkResp, httpResp, err := client.ProjectsApi.
GetProjectLimitWithParams(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}/limits/{limitName}?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}/limits/{limitName}?pretty=true"
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Sets the specified project limit. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
NOTE: Increasing the following configuration limits might lead to slower response times in the MongoDB Cloud UI or increased user management overhead leading to authentication or authorization re-architecture. If possible, we recommend that you create additional projects to gain access to more of these resources for a more sustainable growth pattern.
Human-readable label that identifies this project limit.
Limit Name | Description | Default | API Override Limit |
---|---|---|---|
atlas.project.deployment.clusters | Limit on the number of clusters in this project if the org is not sales-sold (If org is sales-sold, the limit is 100) | 25 | 90 |
atlas.project.deployment.nodesPerPrivateLinkRegion | Limit on the number of nodes per Private Link region in this project | 50 | 90 |
atlas.project.security.databaseAccess.customRoles | Limit on the number of custom roles in this project | 100 | 1400 |
atlas.project.security.databaseAccess.users | Limit on the number of database users in this project | 100 | 900 |
atlas.project.security.networkAccess.crossRegionEntries | Limit on the number of cross-region network access entries in this project | 40 | 220 |
atlas.project.security.networkAccess.entries | Limit on the number of network access entries in this project | 200 | 20 |
dataFederation.bytesProcessed.query | Limit on the number of bytes processed during a single Data Federation query | N/A | N/A |
dataFederation.bytesProcessed.daily | Limit on the number of bytes processed across all Data Federation tenants for the current day | N/A | N/A |
dataFederation.bytesProcessed.weekly | Limit on the number of bytes processed across all Data Federation tenants for the current week | N/A | N/A |
dataFederation.bytesProcessed.monthly | Limit on the number of bytes processed across all Data Federation tenants for the current month | N/A | N/A |
atlas.project.deployment.privateServiceConnectionsPerRegionGroup | Number of Private Service Connections per Region Group | 50 | 100 |
atlas.project.deployment.privateServiceConnectionsSubnetMask | Subnet mask for GCP PSC Networks. Has lower limit of 20. | 27 | 27 |
atlas.project.deployment.salesSoldM0s | Limit on the number of M0 clusters in this project if the org is sales-sold | 100 | 100 |
Values are atlas.project.security.databaseAccess.users
, atlas.project.deployment.clusters
, atlas.project.deployment.serverlessMTMs
, atlas.project.security.databaseAccess.customRoles
, atlas.project.security.networkAccess.entries
, atlas.project.security.networkAccess.crossRegionEntries
, atlas.project.deployment.nodesPerPrivateLinkRegion
, dataFederation.bytesProcessed.query
, dataFederation.bytesProcessed.daily
, dataFederation.bytesProcessed.weekly
, dataFederation.bytesProcessed.monthly
, atlas.project.deployment.privateServiceConnectionsPerRegionGroup
, atlas.project.deployment.privateServiceConnectionsSubnetMask
, or atlas.project.deployment.salesSoldM0s
.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api setProjectLimit --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.SetProjectLimitApiParams{}
sdkResp, httpResp, err := client.ProjectsApi.
SetProjectLimitWithParams(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}/limits/{limitName}" \
-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}/limits/{limitName}" \
-d '{ <Payload> }'
{
"value": 42
}
{
"value": 42
}
{
"value": 42
}
{
"value": 42
}
{
"value": 42
}
{
"value": 42
}
{
"value": 42
}
{
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"currentUsage": 42,
"defaultLimit": 42,
"maximumLimit": 42,
"name": "atlas.project.security.networkAccess.entries",
"value": 42
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Configures the project level settings for the push-based log export feature.
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})$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
The project configuration details. The S3 bucket name, IAM role ID, and prefix path fields are required.
The name of the bucket to which the agent will send the logs to.
ID of the AWS IAM role that will be used to write to the S3 bucket.
Format should match the following pattern: ^([a-f0-9]{24})$
.
S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory.
atlas api createPushBasedLogConfiguration --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.CreatePushBasedLogConfigurationApiParams{}
sdkResp, httpResp, err := client.Push - BasedLogExportApi.
CreatePushBasedLogConfigurationWithParams(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}/pushBasedLogExport" \
-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}/pushBasedLogExport" \
-d '{ <Payload> }'
{
"bucketName": "string",
"iamRoleId": "32b6e34b3d91647abb20e7b8",
"prefixPath": "string"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Updates one private endpoint for one serverless instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
This feature does not work for Flex clusters. To continue using Private Endpoints once Serverless is replaced by Flex, please use a Dedicated cluster instead.
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 serverless instance associated with the tenant endpoint that will be updated.
Format should match the following pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$
.
Unique 24-hexadecimal digit string that identifies the tenant endpoint which will be updated.
Format should match the following pattern: ^([a-f0-9]{24})$
.
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
.
Object used for update.
Updates to a serverless AWS tenant endpoint.
Human-readable comment associated with the private endpoint.
Maximum length is 80
.
Human-readable label that identifies the cloud provider of the tenant endpoint.
Value is AWS
.
Unique string that identifies the private endpoint's network interface.
Format should match the following pattern: ^vpce-[0-9a-f]{17}$
.
atlas api updateServerlessPrivateEndpoint --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.UpdateServerlessPrivateEndpointApiParams{}
sdkResp, httpResp, err := client.ServerlessPrivateEndpointsApi.
UpdateServerlessPrivateEndpointWithParams(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}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}" \
-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}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}" \
-d '{ <Payload> }'
{
"comment": "string",
"providerName": "AWS",
"cloudProviderEndpointId": "string"
}
{
"comment": "string",
"providerName": "AWS",
"cloudProviderEndpointId": "string",
"privateEndpointIpAddress": "string"
}
{
"_id": "32b6e34b3d91647abb20e7b8",
"cloudProviderEndpointId": "string",
"comment": "string",
"endpointServiceName": "string",
"errorMessage": "string",
"status": "RESERVATION_REQUESTED",
"providerName": "AWS"
}
{
"_id": "32b6e34b3d91647abb20e7b8",
"cloudProviderEndpointId": "string",
"comment": "string",
"endpointServiceName": "string",
"errorMessage": "string",
"status": "RESERVATION_REQUESTED",
"privateEndpointIpAddress": "string",
"privateLinkServiceResourceId": "string",
"providerName": "AZURE"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Removes the specified access list entry from the specified Service Account for the project. You can't remove the requesting IP address from the access list.
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})$
.
The Client ID of the Service Account.
Format should match the following pattern: ^mdb_sa_id_[a-fA-F\d]{24}$
.
One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /.
Format should match the following pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$
.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api deleteProjectServiceAccountAccessListEntry --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.DeleteProjectServiceAccountAccessListEntryApiParams{}
httpResp, err := client.ServiceAccountsApi.
DeleteProjectServiceAccountAccessListEntryWithParams(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}/serviceAccounts/{clientId}/accessList/{ipAddress}"
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}/serviceAccounts/{clientId}/accessList/{ipAddress}"
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Requests one snapshot for the specified shared cluster. This resource returns a snapshotURL
that you can use to download the snapshot. This snapshotURL
remains active for four hours after you make the request. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
This endpoint can also be used on Flex clusters that were created using the createCluster endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026, after which this endpoint will be sunset. Please use the downloadFlexBackup endpoint instead.
atlas api downloadSharedClusterBackup --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.DownloadSharedClusterBackupApiParams{}
sdkResp, httpResp, err := client.Shared - TierSnapshotsApi.
DownloadSharedClusterBackupWithParams(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}/clusters/{clusterName}/backup/tenant/download" \
-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}/clusters/{clusterName}/backup/tenant/download" \
-d '{ <Payload> }'
{
"snapshotId": "32b6e34b3d91647abb20e7b8",
"targetDeploymentItemName": "string",
"targetProjectId": "32b6e34b3d91647abb20e7b8"
}
{
"clusterName": "string",
"deliveryType": "RESTORE",
"expirationDate": "2025-05-04T09:42:00Z",
"id": "32b6e34b3d91647abb20e7b8",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"projectId": "32b6e34b3d91647abb20e7b8",
"restoreFinishedDate": "2025-05-04T09:42:00Z",
"restoreScheduledDate": "2025-05-04T09:42:00Z",
"snapshotFinishedDate": "2025-05-04T09:42:00Z",
"snapshotId": "32b6e34b3d91647abb20e7b8",
"snapshotUrl": "string",
"status": "PENDING",
"targetDeploymentItemName": "string",
"targetProjectId": "32b6e34b3d91647abb20e7b8"
}
{
"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"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}
Delete one connection of the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role.
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 stream instance.
Human-readable label that identifies the stream connection.
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
.
Flag that indicates whether the response body should be in the prettyprint format.
Default value is false
.
atlas api deleteStreamConnection --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.DeleteStreamConnectionApiParams{}
httpResp, err := client.StreamsApi.
DeleteStreamConnectionWithParams(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}/streams/{tenantName}/connections/{connectionName}"
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}/streams/{tenantName}/connections/{connectionName}"
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"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"
}
{
"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"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}