GET /api/roles
List all roles

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

search
optional

filter results

Validations:

  • String

order
optional

sort results

Validations:

  • String

page
optional

paginate results

Validations:

  • String

per_page
optional

number of entries per request

Validations:

  • String

Search fields

Field name Type Possible values
builtin true, false
description text
name string
permission string

GET /api/roles/:id
Show a role

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, ‘‘, ‘-’ with no leading or trailing space..

description
optional

Validations:

  • String


POST /api/roles
Create a role

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

role
required

Validations:

  • Hash

role[name]
required

Validations:

  • String

role[description]
optional , nil allowed

Role description

Validations:

  • String

role[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

role[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/roles/:id
Update a role

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

id
required

Validations:

  • String

role
required

Validations:

  • Hash

role[name]
optional

Validations:

  • String

role[description]
optional , nil allowed

Role description

Validations:

  • String

role[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

role[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


DELETE /api/roles/:id
Delete a role

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

id
required

Validations:

  • String


POST /api/roles/:id/clone
Clone a role

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

id
required

Validations:

  • String

role
required

Validations:

  • Hash

role[name]
optional

Validations:

  • String

role[description]
optional , nil allowed

Role description

Validations:

  • String

role[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

role[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type