Examples

POST /api/roles
{
  "role": {
    "name": "staff",
    "organizations": [],
    "locations": []
  }
}
201
{
  "builtin": 0,
  "cloned_from_id": null,
  "name": "staff",
  "id": 18,
  "description": null,
  "origin": null,
  "filters": [],
  "locations": [],
  "organizations": []
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organisations

Validations:

  • Must be a Integer

role
required

Validations:

  • Must be a Hash

role[name]
required

Validations:

  • Must be a String

role[description]
optional , nil allowed

Role description

Validations:

  • Must be a 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 organisations with given ids.

Validations:

  • Must be an array of any type