Search + K

Command Palette

Search for a command to run...

Sign In

Add One MongoDB Cloud User to One Project

Deprecated
POST /api/atlas/v2/groups/{groupId}/access
Copy endpoint
https://cloud.mongodb.com

Adds one MongoDB Cloud user to the specified project. If the MongoDB Cloud user is not a member of the project's organization, then the user must accept their invitation to the organization to access information within the specified project. If the MongoDB Cloud User is already a member of the project's organization, then they will be added to the project immediately and an invitation will not be returned by this resource. To use this resource, the requesting Service Account or API Key must have the Group User Admin role.

Parameters

path Path Parameters

Name Type
groupId required

Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.

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.

string

query Query Parameters

Name Type
pretty

Flag that indicates whether the response body should be in the prettyprint format.

boolean
envelope

Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.

boolean

Request Body

application/vnd.atlas.2023-02-01+json required

Adds one MongoDB Cloud user to the specified project.

interface GroupInvitationRequest {
roles?: string[];
username?: string;
}

Responses

200 application/vnd.atlas.2023-02-01+json

OK

interface OrganizationInvitation {
createdAt?: string;
expiresAt?: string;
groupRoleAssignments?: GroupRole
interface GroupRole {
groupId?: string;
groupRole?: "GROUP_BACKUP_MANAGER" | "GROUP_CLUSTER_MANAGER" | "GROUP_DATA_ACCESS_ADMIN" | "GROUP_DATA_ACCESS_READ_ONLY" | "GROUP_DATA_ACCESS_READ_WRITE" | "GROUP_DATABASE_ACCESS_ADMIN" | "GROUP_OBSERVABILITY_VIEWER" | "GROUP_OWNER" | "GROUP_READ_ONLY" | "GROUP_SEARCH_INDEX_EDITOR" | "GROUP_STREAM_PROCESSING_OWNER";
}
[]
;
id?: string;
inviterUsername?: string;
links?: readonly Link
interface Link {
href?: string;
rel?: string;
}
[]
;
orgId?: string;
orgName: string;
roles?: ("ORG_OWNER" | "ORG_MEMBER" | "ORG_GROUP_CREATOR" | "ORG_BILLING_ADMIN" | "ORG_BILLING_READ_ONLY" | "ORG_STREAM_PROCESSING_ADMIN" | "ORG_READ_ONLY")[];
teamIds?: readonly string[];
username?: string;
}
204 application/vnd.atlas.2023-02-01+json

No Content

unknown

Client Errors

401 application/json

Unauthorized.

interface ApiError {
badRequestDetail?: BadRequestDetail

Bad request detail.

interface BadRequestDetail {
fields?: FieldViolation[];
}
;
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
403 application/json

Forbidden.

interface ApiError {
badRequestDetail?: BadRequestDetail

Bad request detail.

interface BadRequestDetail {
fields?: FieldViolation[];
}
;
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
404 application/json

Not Found.

interface ApiError {
badRequestDetail?: BadRequestDetail

Bad request detail.

interface BadRequestDetail {
fields?: FieldViolation[];
}
;
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}

Server Errors

500 application/json

Internal Server Error.

interface ApiError {
badRequestDetail?: BadRequestDetail

Bad request detail.

interface BadRequestDetail {
fields?: FieldViolation[];
}
;
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}