User management API - POST user groups
Adds a user to groups. Any existing group membership remains unaffected.
The request consumes an application/json
payload.
POST |
|
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 Authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
accountUuid | string | The ID of the required account. You can find the UUID on the Account > Account management API page, during creation of an OAuth client. | path | required |
string | The email address of the required user. | path | required | |
body | string[] | The body of the request. Contains a list of groups (specified by UUIDs) to which the user is to be added. Any existing group membership remains unaffected. | body | required |
Request body objects
The RequestBody
object
The object doesn't provide any parameters.
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
Code | Description |
---|---|
201 | Success. The user has been added to the groups. Response doesn't have a body. |
Example
In this example, the request adds the user with the james.johnson@company.com email address to the group with the UUID of b794097-8ad2-4b32-b923-0131da2eeddf. The response code of 201 indicates that the modification has been successful.
Curl
curl --request POST \
--url 'https://api.dynatrace.com/iam/v1/accounts/9ad20784-76c6-4167-bfba-9b0d8d72a71d/users/james.johnson@company.com' \
--header 'Authorization: Bearer abcdefjhij1234567890' \
--header 'Content-Type: application/json' \
--data '
[
"b794097-8ad2-4b32-b923-0131da2eeddf"
]
'
Request URL
https://api.dynatrace.com/iam/v1/accounts/9ad20784-76c6-4167-bfba-9b0d8d72a71d/users/james.johnson@company.com
Request body
[
"b794097-8ad2-4b32-b923-0131da2eeddf"
]
Response code
201