I know that you can assign a user to groups on creation, e.g.
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
"profile": {
"firstName": "Isaac",
"lastName": "Brock",
"email": "isaac.brock@example.com",
"login": "isaac.brock@example.com",
"mobilePhone": "555-415-1337"
},
"groupIds": [
"00g1emaKYZTWRYYRRTSK",
"00garwpuyxHaWOkdV0g4"
]
}' "https://${yourOktaDomain}/api/v1/users?activate=false"
But is there any way to do the same thing on user update? From the documentation it seems like you have to add user to group
/remove user from group
separately, but I’d like to be able to do it in the same operation as updating the profile. Something like:
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
"profile": {
"firstName": "Isaac",
"email": "isaac.brock@update.example.com",
"mobilePhone": "555-415-1337"
},
"groupIds": [
"00g1emaKYZTWRYYRRTSK",
"00garwpuyxHaWOkdV0g4"
]
}' "https://${yourOktaDomain}/api/v1/users/00ub0oNGTSWTBKOLGLNR"
Thanks!