Navigation

Create a Project

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.

The Atlas API uses HTTP Digest Authentication. Provide your Atlas username and group API key as the username and password when constructing the HTTP request.

For complete documentation on configuring API access for an Atlas group, see Configure Atlas API Access.

Base URL: https://cloud.mongodb.com/

Syntax

POST /api/atlas/v1.0/groups

Request Body Parameters

Name Type Description
name string The name of the project you want to create.
orgId ObjectId Optional The ID of the organization you want to create the project within. If you do not specify an orgId, Atlas creates an organization using the name value and places the project within that organization.

Request Query Parameters

Field Required/Optional Description
envelope Optional.

A boolean that specifies whether or not to wrap the response in an envelope.

Defaults to false.

pretty Optional.

A boolean that specifies whether or not to return a “pretty-printed” JSON document.

Defaults to false.

HTTP Response Elements

Name Description
clusterCount The number of Atlas clusters deployed in the project.
created The ISO-8601-formatted timestamp of when Atlas created the project.
id The unique identifier of the project. You can use this value for populating the {GROUP-ID} parameter of other Atlas API endpoints.
links

An array of documents. Each element represents a link to one of the following resources:

  • /api/atlas/v1.0/groups/{GROUP-ID}/

    A self-referential link to the project.

  • /api/atlas/v1.0/groups/{GROUP-ID}/containers

    A link to the VPC container resource.

  • /api/atlas/v1.0/groups/{GROUP-ID}/clusters

    A link to the Clusters resource.

  • /api/atlas/v1.0/groups/{GROUP-ID}/databaseUsers

    A link to the Database Users resource.

  • /api/atlas/v1.0/groups/{GROUP-ID}/peers

    A link to the VPC peering resource.

  • /api/atlas/v1.0/groups/{GROUP-ID}/processes

    A link to the Monitoring and Logs resource.

  • /api/atlas/v1.0/groups/{GROUP-ID}/whitelist

    A link to the Group IP Whitelist resource.

name The name of the project. You can use this value for populating the {GROUP-NAME} parameter of the /groups/byName/{GROUP-NAME} endpoint.
orgId The unique identifier of the Atlas organization to which the project belongs.

Example

Request

curl -u "username:apiKey" --digest -H "Content-Type: application/json" -X POST "https://cloud.mongodb.com/api/atlas/v1.0/groups" --data '{ "name" : "ProjectFoobar", "orgId" : "5a0a1e7e0f2912c554080adc" }'

Response

HTTP/1.1 200 OK

{
  "clusterCount" : 0,
  "created" : "2016-07-14T14:19:33Z",
  "id" : "5a0a1e7e0f2912c554080ae6",
  "links" : [ {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6",
    "rel" : "self"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6/containers",
    "rel" : "http://mms.mongodb.com/containers"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6/clusters",
    "rel" : "http://mms.mongodb.com/clusters"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6/databaseUsers",
    "rel" : "http://mms.mongodb.com/databaseUsers"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6/peers",
    "rel" : "http://mms.mongodb.com/peers"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6/processes",
    "rel" : "http://mms.mongodb.com/processes"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5a0a1e7e0f2912c554080ae6/whitelist",
    "rel" : "http://mms.mongodb.com/whitelist"
  } ],
  "name" : "ProjectFoobar",
  "orgId" : "5a0a1e7e0f2912c554080adc"
}
←   Get One Project Clusters  →