GET /api/usergroups 200 { "total": 0, "subtotal": 0, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": [] }
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 and order by a searchable field, e.g. '<field> 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 |
---|---|---|
id | integer | |
name | string | |
role | string | |
role_id | integer |
GET /api/usergroups/2-usergroup258 200 { "admin": false, "created_at": "2022-03-29 08:50:12 UTC", "updated_at": "2022-03-29 08:50:12 UTC", "name": "usergroup258", "id": 2, "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", "role_ids": [ 1, 3, 4 ] } } 201 { "admin": false, "created_at": "2022-03-29 08:50:12 UTC", "updated_at": "2022-03-29 08:50:12 UTC", "name": "test_usergroup", "id": 4, "external_usergroups": [], "usergroups": [], "users": [], "roles": [ { "name": "Manager", "id": 1, "description": null, "origin": "foreman" }, { "name": "View hosts", "id": 3, "description": null, "origin": "foreman" }, { "name": "Edit hosts", "id": 4, "description": null, "origin": "foreman" } ] }
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, can be modified by admins only 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/1-usergroup257 { "usergroup": { "name": "test_usergroup", "user_ids": [ 980190962 ] } } 200 { "admin": false, "created_at": "2022-03-29 08:50:12 UTC", "updated_at": "2022-03-29 08:50:12 UTC", "name": "test_usergroup", "id": 1, "external_usergroups": [], "usergroups": [], "users": [ { "id": 980190962, "login": "one", "description": null } ], "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:
|
usergroup required |
Validations:
|
usergroup[name] optional |
Validations:
|
usergroup[admin] optional , nil allowed |
is an admin user group, can be modified by admins only 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/5-usergroup260 { "usergroup": {} } 200 { "id": 5, "name": "usergroup260", "created_at": "2022-03-29T08:50:12.794Z", "updated_at": "2022-03-29T08:50:12.794Z", "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:
|