For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

AtlasGov Programmatic Access

MongoDB Atlas for Government supports programmatic access using the following resources. However, AtlasGov is designed with additional security, compliance, and operational considerations to meet the needs of organizations that handle sensitive data. To learn more about how these considerations impact feature availability, see Atlas for Government Considerations.

AtlasGov supports the following DevOps tools:

Product
Description

Manage Atlas resources alongside your Kubernetes-based applications, through your existing Kubernetes workflow.

Integrate Atlas into your continuous delivery workflows with the HashiCorp Terraform MongoDB Atlas Provider.

The MongoDB Atlas for Government API functions in the same way as the Atlas API, except that it uses the following base URL:

https://cloud.mongodbgov.com/api/atlas/v2

To use the MongoDB Atlas for Government API to manage your clusters, you must authenticate your API requests. The MongoDB Atlas for Government API accepts the following authentication methods:

Important

We recommend you use service accounts instead of API keys to authenticate to the MongoDB Atlas for Government API. API keys are a legacy authentication method.

This curl example retrieves database users for a project. Select the appropriate tab for your preferred method of authentication:

To make an API request using a service account, use the service account to generate an access token, then use the access token in your request:

1

Locate the client secret beginning with mdb_sa_sk_ that you saved immediately after creating the service account. If you didn't save the client secret, you must generate a new client secret.

2

For example, run:

echo -n {clientId}:{clientSecret} | base64
3

Important

The access token is valid for 1 hour (3600 seconds). You can't refresh an access token. When this access token expires, repeat this step to generate a new one.

Replace {base64Auth} in the following example with the output from the preceding step, then run:

curl --request POST \ --url https://cloud.mongodbgov.com/api/oauth/token \ --header 'accept: application/json' \ --header 'cache-control: no-cache' \ --header 'authorization: Basic {base64Auth}' \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'grant_type=client_credentials'
4

Replace {accessToken} in the following example with the output from the preceding step.

The following sample GET request returns all projects in your organization:

curl --request GET \ --url https://cloud.mongodbgov.com/api/atlas/v2/groups \ --header 'Authorization: Bearer {accessToken}' \ --header 'Accept: application/vnd.atlas.2023-02-01+json' \ --header 'Content-Type: application/json'

The following sample POST request takes a request body and creates a project named MyProject in your organization:

curl --header 'Authorization: Bearer {accessToken}' \ --header "Content-Type: application/json" \ --header "Accept: application/vnd.atlas.2023-02-01+json" \ --include \ --request POST "https://cloud.mongodbgov.com/api/atlas/v2/groups" \ --data ' { "name": "MyProject", "orgId": "5a0a1e7e0f2912c554080adc" }'

When you create a project, you must designate it as either a FedRAMP® Class C (Moderate) project or a FedRAMP® Class D (High) project. To create a FedRAMP® Class D (High) project, select FedRAMP Class D (High) - Regions Only. You cannot deploy clusters within the same project across both FedRAMP® Class D (High) and FedRAMP® Class C (Moderate) regions.

By default, the AtlasGov API designates new projects as FedRAMP® Class C (Moderate) projects.

To use the API to create a FedRAMP® Class D (High) project, send a POST request with the following body:

{ "name": "MyProject", "orgId": "5a0a1e7e0f2912c554080adc", "regionUsageRestrictions" : "GOV_REGIONS_ONLY"}

Tip

Atlas documentation

For detailed information on creating a project with the API, including an example request, see Create One Project.

The following cloud providers, MongoDB products, and features are unavailable for all API resources:

  • Atlas Online Archives

  • Atlas Triggers

  • MongoDB Charts

  • Atlas Device SDKs

  • Free, Flex, and M10 clusters

Many of the commercial Atlas API resources are limited or unavailable:

Database users who authenticate with SCRAM must use SCRAM-SHA-256.

AtlasGov clusters must be tier M20 or higher. Atlas doesn't support Free and Flex clusters.

To deploy Azure Government clusters through the API, create the project with "regionUsageRestrictions": "GOV_REGIONS_ONLY".

AtlasGov doesn't support the M20 cluster tier in Azure Government regions. M30 is the minimum cluster tier for Azure Government deployments.

To learn more about supported regions, see Supported Cloud Providers and Regions.

  • Alerts related to payment methods are unavailable.

  • Alerts can come from several different email addresses. For more information, see Alerts and Communications.

You must have the Project Owner role to configure a third-party monitoring integration.

When integrated with Datadog, AtlasGov uses the Datadog for Government site (US1-FED).

To learn more about US1-FED, see the Datadog documentation.

You cannot restore backups between FedRAMP® Class C (Moderate) projects and FedRAMP® Class D (High) projects. If you create a backup from a cluster in a FedRAMP® Class D (High) project, you can restore the data to clusters in FedRAMP® Class D (High) projects. The same restriction applies to FedRAMP® Class C (Moderate) projects.

Cross-cloud restore is supported among AWS GovCloud, GCP Assured Workloads, and Azure Government regions. Azure Government regions support only M30 or higher cluster tiers, so restores to Azure Government require a target cluster of M30 or higher.

Flex clusters are unavailable in AtlasGov.

Online Archives are unavailable in AtlasGov.

  • You can peer AWS GovCloud regions with MongoDB clusters only in AWS GovCloud regions. You can peer AWS Commercial regions with MongoDB clusters only in AWS Commercial regions.

  • You can peer GCP Assured Workloads regions with MongoDB clusters only in GCP Assured Workloads regions.

  • You can peer Azure Government regions with MongoDB clusters only in Azure Government regions.

  • You can link AWS GovCloud regions with MongoDB clusters only in AWS GovCloud regions. You can link AWS Commercial regions with MongoDB clusters only in AWS Commercial regions.

  • You can link GCP Assured Workloads regions with MongoDB clusters only in GCP Assured Workloads regions.

  • You can link Azure Government regions with MongoDB clusters only in Azure Government regions.

In addition to the standard Atlas logging, AtlasGov logs the username and IP address associated with all failed login attempts, temporary lockouts and failed API digest authentications.

If you choose to enable customer-managed keys (CMK), you must use KMS keys in AWS GovCloud, GCP Assured Workloads, or Azure Government regions for AtlasGov projects restricted to FedRAMP® Class D (High) regions. For AWS Commercial region-only projects, you must use KMS keys in AWS Commercial regions.

You cannot create MongoDB Atlas for Government users. MongoDB Atlas for Government is available by invitation only.

Atlas Stream Processing is unavailable in AtlasGov.

Triggers are unavailable in AtlasGov.