GET /api/usergroups 200 { "total": 1, "subtotal": 1, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": [ { "admin": false, "created_at": "2020-11-04 14:03:24 UTC", "updated_at": "2020-11-04 14:03:24 UTC", "name": "usergroup18", "id": 21 } ] }
Param name | Description |
---|---|
location_id optional |
Set the current location context for the request Validations:
|
organization_id optional |
Set the current organization context for the request Validations:
|
search optional |
filter results Validations:
|
order optional |
Sort field and order, eg. ‘id DESC’ Validations:
|
page optional |
Page number, starting at 1 Validations:
|
per_page optional |
Number of results per page to return, ‘all’ to return all results Validations:
|
Field name | Type | Possible values |
---|---|---|
name | string | |
role | string | |
role_id | integer |
GET /api/usergroups/26-usergroup22 200 { "admin": false, "created_at": "2020-11-04 14:03:24 UTC", "updated_at": "2020-11-04 14:03:24 UTC", "name": "usergroup22", "id": 26, "external_usergroups": [], "usergroups": [], "users": [], "roles": [] }
Param name | Description |
---|---|
location_id optional |
Set the current location context for the request Validations:
|
organization_id optional |
Set the current organization context for the request Validations:
|
id required |
Validations:
|
POST /api/usergroups { "usergroup": { "name": "test_usergroup" } } 201 { "admin": false, "created_at": "2020-11-04 14:03:23 UTC", "updated_at": "2020-11-04 14:03:23 UTC", "name": "test_usergroup", "id": 10, "external_usergroups": [], "usergroups": [], "users": [], "roles": [] }
Param name | Description |
---|---|
location_id optional |
Set the current location context for the request Validations:
|
organization_id optional |
Set the current organization context for the request Validations:
|
usergroup required |
Validations:
|
usergroup[name] required |
Validations:
|
usergroup[admin] optional , nil allowed |
is an admin user group Validations:
|
usergroup[user_ids] optional , nil allowed |
Validations:
|
usergroup[usergroup_ids] optional , nil allowed |
Validations:
|
usergroup[role_ids] optional , nil allowed |
Validations:
|
User groups linked to external groups (LDAP) are automatically synced with these groups on update. Remember this synchronization will remove any LDAP users manually added to the Foreman user group. Only LDAP users in the external groups will remain. Internal users can be added or removed freely.
PUT /api/usergroups/11 { "usergroup": { "name": "" } } 422 { "error": { "id": 11, "errors": { "name": [ "can't be blank" ] }, "full_messages": [ "Name can't be blank" ] } }
Param name | Description |
---|---|
location_id optional |
Set the current location context for the request Validations:
|
organization_id optional |
Set the current organization context for the request Validations:
|
id required |
Validations:
|
usergroup required |
Validations:
|
usergroup[name] optional |
Validations:
|
usergroup[admin] optional , nil allowed |
is an admin user group Validations:
|
usergroup[user_ids] optional , nil allowed |
Validations:
|
usergroup[usergroup_ids] optional , nil allowed |
Validations:
|
usergroup[role_ids] optional , nil allowed |
Validations:
|
DELETE /api/usergroups/25-usergroup21 { "usergroup": {} } 200 { "id": 25, "name": "usergroup21", "created_at": "2020-11-04T14:03:24.482Z", "updated_at": "2020-11-04T14:03:24.482Z", "admin": false }
Param name | Description |
---|---|
location_id optional |
Set the current location context for the request Validations:
|
organization_id optional |
Set the current organization context for the request Validations:
|
id required |
Validations:
|