Add User Group

To create a user group, use the following request:

POST /user_groups.xml
POST /user_groups.json


XML Request Example

curl -i -X POST -u user_email:api_key --url http://onapp.test/user_groups.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<user_group><label>TEST</label><role_ids type="array"><role_id>1</role_id><role_id>2</role_id><role_id>3</role_id></role_ids><user_bucket_ids type="array"><user_bucket_id>1</user_bucket_id><user_bucket_id>2</user_bucket_id></user_bucket_ids></user_group>'


JSON Request Example

curl -i -X POST -u user_email:api_key --url http://onapp.test/user_groups.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"user_group": {"label": "test", "role_ids": [1, 2, 3], "user_bucket_ids": [1, 2]}}'


Where:

label - the name of the user group

role_ids - an array of IDs of the roles you assign to the user group

user_bucket_ids - an array of IDs of the user buckets that will be available to the users within this user group