
4xlhp (4xlhp) asked a question.
I have a list of users(say 500) added to group that are assigned to an App in Okta via group rule. The list is dynamic and changes everyday so I need to update the users in group so that access could me maintained. Is there a way I can assign a new list of user to group in bulk everyday and remove all before re-assignment. Would be better if can be done via API call.

Hi Rahul,
Pretty sure this is the api call you are looking for: https://developer.okta.com/docs/reference/api/groups/#add-user-to-group
You can find a reference to all available endpoints here: https://developer.okta.com/docs/reference/
Hi @rohern (Okta) , I did go through the doc but was looking to add users to group in a list/array form. This one's for individual user I guess. Thanks.
Hi Rahul,
I'm assuming that when a user is not found in that list, that you would want that user disabled?
Hi Tim,
That's correct, the access will only be granted to the ones present in the list. I can do by iterating over the list one by one but that will take separate API call for each member and if the list goes on increasing the performance will degrade with so many calls.
The CSV Directory Integration may be what you're looking for. Check it out here: https://help.okta.com/en/prod/Content/Topics/Directory/csv-integration-get-started.htm
Let me know if this helps!
You can make use of the PowerShell module available - https://github.com/mbegan/Okta-PSModule.
use this oktaAddUseridtoGroupid cmdlet to add users (using foreach loop) to the group