Navigation

Get All Organization Users

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

The Atlas API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.

To learn how to configure API access for an Atlas project, see Configure Atlas API Access.

GET /api/atlas/v1.0/orgs/{ORG-ID}/users
ParameterRequired/OptionalDescription
ORG-IDRequired.The unique identifier for the organization whose user information you want to retrieve.
FieldRequired/OptionalDescription
pageNumOptional.

The page to return.

Defaults to 1.

itemsPerPageOptional.

Number of items to return per page, up to a maximum of 500.

Defaults to 100.

includeCountOptional.

Specifies whether the response returns the totalCount field.

Defaults to true.

envelopeOptional.

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

Defaults to false.

prettyOptional

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

Defaults to false.

If you set the query element envelope to true, the response is wrapped by the content object.

The HTTP response returns a JSON document that includes the following objects:

An array of documents, each representing one Organization user.

NameDescription
countryThe country where the user lives.
emailAddressThe user's email address.
firstNameThe user's first name.
lastNameID of the Atlas project the user belongs to.
idThe user's id.
linksOne or more links to sub-resources and/or related resources.
mobileNumberThe user's mobile phone number.
usernameThe username for authenticating to MongoDB.
rolesAn array of the user's roles within the Organization and for each Project to which the user belongs.
roles.{ENTITY-ID}The {ENTITY-ID} represents the Organization or Project to which this role applies. Possible values are: orgId or groupId.
roles.roleName

The name of the role. The users resource returns all the roles the user has in Atlas. Possible values are:

  • Organization Roles

    • ORG_OWNER
    • ORG_MEMBER
    • ORG_GROUP_CREATOR
    • ORG_BILLING_ADMIN
    • ORG_READ_ONLY
  • Project Roles

    Info With Circle IconCreated with Sketch.Note

    Groups and projects are synonymous terms.

    • GROUP_OWNER
    • GROUP_CLUSTER_MANAGER
    • GROUP_READ_ONLY
    • GROUP_DATA_ACCESS_ADMIN
    • GROUP_DATA_ACCESS_READ_WRITE
    • GROUP_DATA_ACCESS_READ_ONLY
    • GROUP_AUTOMATION_ADMIN (Cloud Manager)
    • GROUP_BACKUP_ADMIN (Cloud Manager)
    • GROUP_MONITORING_ADMIN (Cloud Manager)
    • GROUP_OWNER (Cloud Manager)
    • GROUP_USER_ADMIN (Cloud Manager)
teamIdsAn array of the team ids for the organization.

An array of documents, representing a link to one or more sub-resources and/or related resources such as list pagination. See Linking for more information.

The total number of items in the result set. This value may be higher than the number of objects in the results array if the entire result set is paginated.

Important With Circle IconCreated with Sketch.Important

You must modify the following code block with the appropriate credentials and organization ID.

curl -i -u "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest "https://cloud.mongodb.com/api/atlas/v1.0/orgs/59db8d1d87d9d6420df0613f/users?pretty=true"
HTTP/1.1 200 OK
{
"links" : [ ... ],
"results" : [
{
"country": "US",
"emailAddress": "someone@example.com",
"firstName": "John",
"id": "59db8d1d87d9d6420df0613a",
"lastName": "Smith",
"links": [ ... ],
"mobileNumber": "123-456-7890",
"roles": [{
"groupId": "59ea02e087d9d636b587a967",
"roleName": "GROUP_OWNER"
}, {
"groupId": "59db8d1d87d9d6420df70902",
"roleName": "GROUP_OWNER"
}, {
"orgId": "59db8d1d87d9d6420df0613f",
"roleName": "ORG_OWNER"
}],
"teamIds" : [ "5aeeed020bd6ef9d00033291", "5ac2aeadcabceef96172be31" ],
"username": "someone@example.com"
},
...
],
"totalCount" : 2
}
Give Feedback