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

Patch a MongoDB User by ID

Patches a MongoDB user specified by its ID.

patch
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.

usernamestringRequired

The authentication username.

Body

MongoDB database user patch request.

Responses
200

The user identified by the username and database parameters will be patched.

application/json

MongoDB database user.

typestring · enumOptional

The resource type.

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

{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "john.doe@example.com",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
  },
  "properties": {
    "password": "text",
    "roles": [
      {
        "role": "read",
        "database": "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?