PingOne Platform APIs

Create a Group and Add a User

This activity shows you how to create a group and assign a user to that group.

Prerequisites

Get an access token from the worker application that you created in Create an admin Worker app connection. To get a token from a different worker application in an alternate sandbox environment, run the token request endpoint using the client ID and client secret of your chosen worker app to authenticate the request. For more information, refer to Get a PingOne admin access token.

Workflow order of operations

To create a group and add a user, you must complete the following tasks:

  1. Make a POST request to /environments/{{envID}}/groups to create a new group.

  2. Make a POST request to /environments/{{envID}}/populations to create a new population resource.

  3. Make a POST request to /environments/{{envID}}/users to create a user to assign to the new population resource.

  4. Make a POST request to /environments/{{envID}}/users/{{GroupUseCaseUserID}}/memberOfGroups to add the new user to the group.

  5. Make a GET request to /environments/{{envID}}/users?filter=memberOfGroups[id eq "{{UseCaseGroupID}}"] to return a list of all users in the group.

  6. Make a GET request to /environments/{{envID}}/users/{{GroupUseCaseUserID}}?include=memberOfGroupNames to return a list of all groups associated with the specified user.

Click the Run in Postman button below to fork, or download and import, the Postman collection for this workflow to your workspace.