User management API - PUT user groups
Sets groups membership of a user. Any existing memberships are overwritten.
The request consumes an application/json
payload.
PUT |
|
Authentication
To execute this request, you need the Allow write access for identity resources (users and groups) (account-idm-write
) scope assigned to your token. To learn how to obtain and use it, see OAuth clients.
Parameters
The ID of the required account.
You can find the UUID on the Account Management > Identity & access management > OAuth clients page, during creation of an OAuth client.
The email address of the required user.
The body of the request. Contains a list of groups (specified by UUIDs) where the user is to be a member.
The user will be removed from any group that is not specified here.
Request body objects
The RequestBody
object
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
["string"]
Response
Response codes
Success. The group membership has been set. Response doesn't have a body.
Example
In this example, the request assigned the user with the jane.brown@company.com email address to groups with the following UUIDs:
- b794097-8ad2-4b32-b923-0131da2eeddf
- 56d56aba-c12f-44c1-a0ba-42eba3e3ff84
The response code of 200 indicates that the modification has been successful.
Curl
curl --request PUT \--url 'https://api.dynatrace.com/iam/v1/accounts/9ad20784-76c6-4167-bfba-9b0d8d72a71d/users/jane.brown@company.com' \--header 'Authorization: Bearer abcdefjhij1234567890' \--header 'Content-Type: application/json' \--data '["b794097-8ad2-4b32-b923-0131da2eeddf","56d56aba-c12f-44c1-a0ba-42eba3e3ff84"]'
Request URL
https://api.dynatrace.com/iam/v1/accounts/9ad20784-76c6-4167-bfba-9b0d8d72a71d/users/jane.brown@company.com
Request body
["b794097-8ad2-4b32-b923-0131da2eeddf","56d56aba-c12f-44c1-a0ba-42eba3e3ff84"]
Response code
200