Skip to content

List Roles

GET /api/role

Required privilege: Users / View

Returns all roles defined in the organisation with their privilege summary.


Response

{
  "data": {
    "headers": [
      { "key": "Role Name", "format": "string-link" },
      { "key": "Role Description", "format": "string" },
      { "key": "Number of Privileges", "format": "number" },
      { "key": "Has Granular Privileges", "format": "boolean" }
    ],
    "rows": [
      {
        "id": 1,
        "Role Name": "Superuser",
        "Role Description": "Full system access",
        "Number of Privileges": 30,
        "Has Granular Privileges": false
      },
      {
        "id": 3,
        "Role Name": "Procurement Manager",
        "Role Description": "Full procurement read/write, demand read",
        "Number of Privileges": 5,
        "Has Granular Privileges": true
      }
    ]
  }
}
Field Type Description
id integer Internal role identifier - use in Create User
Role Name string Display name
Role Description string Description
Number of Privileges integer Count of assigned privileges
Has Granular Privileges boolean Whether the role uses column-level include/exclude filters

Code Examples

curl -b cookies.txt "https://acme.knosc.com/api/role"
roles = session.get("https://acme.knosc.com/api/role").json()["data"]["rows"]
for r in roles:
    print(r["id"], r["Role Name"])