GET /api/roles
List all roles

Params

Param name Description
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


GET /api/roles/:id
Show a role

Params

Param name Description
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
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
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
id
required

Validations:

  • String


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

Params

Param name Description
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