Add One MongoDB Cloud User to One Organization
/api/atlas/v2/orgs/{orgId}/users Invites one new or existing MongoDB Cloud user to join the organization. The invitation to join the organization will be sent to the username provided and must be accepted within 30 days. To use this resource, the requesting Service Account or API Key must have the Organization Owner role.
Note: If the user does not have an existing MongoDB Cloud account, they will be prompted to finish setting up an account upon accepting the invitation. If the user already has an account, they will still receive an invitation to access the organization.
Parameters
path Path Parameters
| Name | Type |
|---|---|
orgId
required
Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access. | string |
query Query Parameters
| Name | Type |
|---|---|
envelope Flag that indicates whether Application wraps the response in an | boolean |
pretty Flag that indicates whether the response body should be in the prettyprint format. | boolean |
Request Body
Represents the MongoDB Cloud user to be created within the organization.
roles:
teamIds?: string[];
username: string;
}
Responses
Created
Client Errors
Bad Request.
badRequestDetail?:
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
Unauthorized.
badRequestDetail?:
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
Forbidden.
badRequestDetail?:
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
Not Found.
badRequestDetail?:
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
Conflict.
badRequestDetail?:
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}
Server Errors
Internal Server Error.
badRequestDetail?:
detail?: string;
error: number;
errorCode: string;
parameters?: readonly {}[];
reason?: string;
}