Docs Menu

Create One Serverless Instance

On this page

  • Required Roles
  • Request
  • Request Path Parameters
  • Request Query Parameters
  • Request Body Parameters
  • Response
  • Example Request
  • Example Response
  • Response Header
  • Response Body
Note

Serverless instances are in a preview release and do not support some Atlas features at this time.

To learn more, see Serverless Instance Limitations.

Creates one serverless instance in the specified project.

Your API Key must have the Organization Owner or Project Owner role to successfully call this resource.

Base URL: https://cloud.mongodb.com/api/atlas/v1.0

POST /groups/{groupId}/serverless
Name
Type
Necessity
Description
groupId
String
Required
Unique 24-hexadecimal digit string that identifies the target project for your new serverless instance.

This endpoint might use any of the HTTP request query parameters available to all Atlas Administration API resources. All of these are optional.

Name
Type
Necessity
Description
Default
pretty
boolean
Optional
Flag indicating whether the response body should be in a prettyprint format.
false
envelope
boolean
Optional

Flag indicating if Atlas should wrap the response in a JSON envelope.

This option may be needed for some API clients. These clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return one result, the response body includes:

status
HTTP response code
envelope
Expected response body
false
Name
Type
Necessity
Description
name
string
Required
Human-readable label that identifies the serverless instance.
providerSettings
object
Required
Group of settings that configure the provisioned MongoDB database.
providerSettings.backingProviderName
string
Required
Cloud service provider on which MongoDB Cloud provisions the serverless instance.
providerSettings.providerName
string
Required
This value must be the string literal SERVERLESS.
providerSettings.regionName
string
Required
Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
Name
Type
Description
connectionStrings
object
Set of connection strings that your applications use to connect to this serverless instance. This resource returns this object after the serverless instance finishes deploying, not during the serverless instance deployment.
connectionStrings.standardSrv
string
Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
createDate
string
Timestamp that indicates when MongoDB Cloud created the serverless instance. The timestamp displays in the ISO 8601 date and time format in UTC.
groupId
string
Unique 24-hexadecimal digit string that identifies the project that contains the serverless instance.
id
string
Unique 24-hexadecimal digit string that identifies the serverless instance.
mongoDBVersion
string
Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
name
string
Human-readable label that identifies the serverless instance.
providerSettings
object
Group of settings that configure the provisioned MongoDB database.
providerSettings.backingProviderName
string
Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
providerSettings.providerName
string
This value will always be the string literal SERVERLESS.
providerSettings.regionName
string
Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
stateName
string
Stage of deployment of this serverless instance when the resource made its request.
curl --user '{PUBLIC-KEY}:{PRIVATE-KEY}' --digest \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--include \
--request POST 'https://cloud.mongodb.com/api/atlas/v1.0/groups/{groupId}/serverless?pretty=true' \
--data '{
"name" : "{instanceName}",
"providerSettings" : {
"providerName": "SERVERLESS",
"backingProviderName": "AWS",
"regionName" : "US_EAST_1"
}
}'
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
1{
2 "connectionStrings" : {
3 "standardSrv" : "mongodb+srv://instanceName1.example.com"
4 },
5 "createDate" : "2021-06-25T21:31:10Z",
6 "groupId" : "{groupId}",
7 "id" : "{instance1}",
8 "links" : [ {
9 "href" : "http://cloud.mongodb.com/api/atlas/v1.0/groups/{groupId}/serverless/{instanceName1}",
10 "rel" : "self"
11 }, {
12 "href" : "http://cloud.mongodb.com/api/atlas/v1.0/groups/{groupId}/serverless/{instanceName1}/backup/restoreJobs",
13 "rel" : "http://cloud.mongodb.com/restoreJobs"
14 }, {
15 "href" : "http://cloud.mongodb.com/api/atlas/v1.0/groups/{groupId}/serverless/{instanceName1}/backup/snapshots",
16 "rel" : "http://cloud.mongodb.com/snapshots"
17 } ],
18 "mongoDBVersion" : "5.0.0",
19 "name" : "{instanceName1}",
20 "providerSettings" : {
21 "providerName" : "SERVERLESS",
22 "backingProviderName" : "AWS",
23 "regionName" : "US_EAST_1"
24 },
25 "stateName" : "IDLE"
26}
←  Return All Serverless InstancesRemove One Serverless Instance →
Give Feedback
© 2022 MongoDB, Inc.

About

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