Data API

Manage your app's generated Data API endpoints.

Construct a Data API Base URL

Data API requests use a base URL that's specific to your App and deployment model.

For a globally deployed app, the base URL has the following format:

https://data.mongodb-api.com/app/{ClientAppID}/endpoint/data/{DataAPIVersion}

A locally deployed app uses a similar base URL also includes the App's deployment region and cloud provider:

https://{Region}.{Cloud}.data.mongodb-api.com/app/{ClientAppID}/endpoint/data/{DataAPIVersion}

You can find an App's Region, Cloud, and ClientAppId in the App Configuration:

curl -X GET https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId} \
  -h 'Authorization: Bearer <AccessToken>'

You can see a list of all DataAPIVersion values supported by an App in the versions field of its Data API Configuration:

curl -X GET "https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/data_api/config" \
  -h 'Authorization: Bearer <AccessToken>'

For example, consider an App that has the following configuration:

{
  "client_app_id": "myapp-abcde",
  "deployment_model": "LOCAL",
  "provider_region": "aws-us-east-1",
  ...
}

This App would use the following base URL for Data API v1 requests:

https://us-east-1.aws.data.mongodb-api.com/app/myapp-abcde/endpoint/data/v1