Docs Menu

Docs HomeAtlas App Services

Create an App with Atlas App Services API

On this page

  • Prerequisites
  • Procedure
  • Authenticate a MongoDB Atlas User
  • Get the Group ID
  • Create a new App

You can use the App Services Admin API to create a new server-side App.

  • A MongoDB Atlas programmatic API key for the MongoDB Cloud account you wish to log in with. You must be a Project Owner to create an App.

  • An Atlas cluster. If you do not have one set up, follow this guide: Create a New Cluster.

1

Use your MongoDB Cloud API key pair to call the authentication endpoint:

curl --request POST \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{"username": "<Public API Key>", "apiKey": "<Private API Key>"}' \
https://realm.mongodb.com/api/admin/v3.0/auth/providers/mongodb-cloud/login

If authentication succeeds, Atlas App Services returns an access token as part of the JSON response document:

{
"access_token": "<access_token>",
"refresh_token": "<refresh_token>",
"user_id": "<user_id>",
"device_id": "<device_id>"
}

Save the access_token, which you'll use as the Bearer token to authenticate in the upcoming steps.

Tip

See also:

2

To create a App you need the Project ID (sometimes referred to as the Group ID) of the MongoDB Atlas project that contains the app. You will include this ID in the URL of API requests.

3

You can create a new App through the create endpoint.

Your request should include:

  • The access_token from step 1 in a Bearer token Authorization header.

  • The Group ID from step 2.

  • A name for your new app.

If creation succeeds, App Services returns a 201 response and a JSON document.

←  Create an App with Realm CLIConfigure Apps →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.