Patch a MongoDB User by ID
Patches a MongoDB user specified by its ID.
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
The unique ID of the cluster.
The authentication username.
MongoDB database user patch request.
The user identified by the username and database parameters will be patched.
MongoDB database user.
The resource type.
Any erroneous status code: 400 (parse error), 401 (authorization error), 402 (trial access), 403 (insufficient permissions), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type), 422 (validation error), 429 (request rate limit exceeded), 500 (server error), 503 (maintenance)
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?