For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a MongoDB User

Creates a MongoDB user.

post
Authorizations
AuthorizationstringRequired

For 'Basic' authentication, take your credentials by first combining the username and password with a colon (username:password) and then encoding the resulting string in base64 (YWxhZGRpbjpvcGVuc2VzYW1l).

Example Request Header

Authorization: Basic YWxhZGRpbjpvcGVuc2Vzl

More details: https://en.wikipedia.org/wiki/Basic_access_authentication

Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Body

MongoDB database user post request.

Responses
200

The created user is returned with metadata indicating when the user was created and by whom.

application/json

MongoDB database user.

typestring · enumOptional

The resource type.

Possible values:
post/clusters/{clusterId}/users
POST /databases/mongodb/clusters/{clusterId}/users HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 243

{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "john.doe@example.com",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
  },
  "properties": {
    "username": "text",
    "roles": [
      {
        "role": "read",
        "database": "text"
      }
    ],
    "password": "text"
  }
}
{
  "type": "user",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "john.doe@example.com",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
  },
  "properties": {
    "username": "text",
    "roles": [
      {
        "role": "read",
        "database": "text"
      }
    ]
  }
}

Last updated

Was this helpful?