| 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 |
|---|---|---|
| builtin | true, false | |
| description | text | |
| name | string | |
| permission | string |
GET /api/roles/1-Manager
200
{
"builtin": 0,
"cloned_from_id": null,
"name": "Manager",
"id": 1,
"description": null,
"origin": "foreman",
"filters": [
{
"id": 139728896
},
{
"id": 169533705
},
{
"id": 170801529
},
{
"id": 222559602
},
{
"id": 225912082
},
{
"id": 255448041
},
{
"id": 291325508
},
{
"id": 321349837
},
{
"id": 340438230
},
{
"id": 343831726
},
{
"id": 372277853
},
{
"id": 503111935
},
{
"id": 528928374
},
{
"id": 557298380
},
{
"id": 595149887
},
{
"id": 643462867
},
{
"id": 679608033
},
{
"id": 721145960
},
{
"id": 943645556
},
{
"id": 977587707
},
{
"id": 980424071
},
{
"id": 1025364382
},
{
"id": 1026099682
},
{
"id": 1062414187
}
],
"locations": [],
"organizations": []
}
| 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:
|
|
description optional |
Validations:
|
POST /api/roles
{
"role": {
"name": "Test Role",
"location_ids": [
255093256
],
"organization_ids": [
447626438
]
}
}
201
{
"builtin": 0,
"cloned_from_id": null,
"name": "Test Role",
"id": 21,
"description": null,
"origin": null,
"filters": [],
"locations": [
{
"id": 255093256,
"name": "Location 1",
"title": "Location 1",
"description": null
}
],
"organizations": [
{
"id": 447626438,
"name": "Organization 1",
"title": "Organization 1",
"description": null
}
]
}
| 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:
|
|
role required |
Validations:
|
|
role[name] required |
Validations:
|
|
role[description] optional , nil allowed |
Role description Validations:
|
|
role[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
|
role[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
PUT /api/roles/27
{
"role": {
"location_ids": [
255093256
],
"organization_ids": [
447626438
]
}
}
200
{
"builtin": 0,
"cloned_from_id": null,
"name": "New Role",
"id": 27,
"description": null,
"origin": null,
"filters": [
{
"id": 1062414341
}
],
"locations": [
{
"id": 255093256,
"name": "Location 1",
"title": "Location 1",
"description": null
}
],
"organizations": [
{
"id": 447626438,
"name": "Organization 1",
"title": "Organization 1",
"description": null
}
]
}
| 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:
|
|
role required |
Validations:
|
|
role[name] optional |
Validations:
|
|
role[description] optional , nil allowed |
Role description Validations:
|
|
role[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
|
role[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
DELETE /api/roles/26
{
"role": {}
}
200
{
"id": 26,
"name": "new_org_admin",
"builtin": 0,
"description": null,
"origin": null,
"cloned_from_id": 13
}
| 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/roles/13-Organization%20admin/clone
{
"new_name": "Org Admin",
"role": {
"name": "Org Admin"
}
}
201
{
"id": 25,
"name": "Org Admin",
"builtin": 0,
"description": "Role granting all permissions except for managing organizations. It can be used to delegate administration of specific organization to a user. In order to create such role, clone this role and assign desired organizations",
"origin": null,
"cloned_from_id": 13
}
| 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:
|
|
role required |
Validations:
|
|
role[name] optional |
Validations:
|
|
role[description] optional , nil allowed |
Role description Validations:
|
|
role[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
|
role[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|