Get User Roles List
curl --request GET \
--url https://management.scanova.io/multi-users/access-levels/ \
--header 'Authorization: <api-key>'[
{
"id": 1,
"name": "Manager",
"permissions": [
{
"id": 22,
"code": "QR_CODE_CAN_ADD",
"name": "Can Add QR Code",
"description": "Can add QR Code",
"is_boolean": true
},
{
"id": 23,
"code": "QR_CODE_CAN_VIEW",
"name": "Can view QR Code",
"description": "Can view QR Code",
"is_boolean": true
}
],
"is_custom": false
},
{
"id": 2,
"name": "Admin",
"permissions": [
{
"id": 22,
"code": "QR_CODE_CAN_ADD",
"name": "Can Add QR Code",
"description": "Can add QR Code",
"is_boolean": true
},
{
"id": 25,
"code": "QR_CODE_CAN_DELETE",
"name": "Can Delete QR Code",
"description": "Can delete QR code",
"is_boolean": true
}
],
"is_custom": false
},
{
"id": 3,
"name": "Viewer",
"permissions": [
{
"id": 23,
"code": "QR_CODE_CAN_VIEW",
"name": "Can view QR Code",
"description": "Can view QR Code",
"is_boolean": true
}
],
"is_custom": false
}
]User Management
Get User Roles List
Get a list of all user roles available in your account. This includes default roles (Manager, Admin, Viewer) as well as custom created roles with their permissions.
GET
/
multi-users
/
access-levels
Get User Roles List
curl --request GET \
--url https://management.scanova.io/multi-users/access-levels/ \
--header 'Authorization: <api-key>'[
{
"id": 1,
"name": "Manager",
"permissions": [
{
"id": 22,
"code": "QR_CODE_CAN_ADD",
"name": "Can Add QR Code",
"description": "Can add QR Code",
"is_boolean": true
},
{
"id": 23,
"code": "QR_CODE_CAN_VIEW",
"name": "Can view QR Code",
"description": "Can view QR Code",
"is_boolean": true
}
],
"is_custom": false
},
{
"id": 2,
"name": "Admin",
"permissions": [
{
"id": 22,
"code": "QR_CODE_CAN_ADD",
"name": "Can Add QR Code",
"description": "Can add QR Code",
"is_boolean": true
},
{
"id": 25,
"code": "QR_CODE_CAN_DELETE",
"name": "Can Delete QR Code",
"description": "Can delete QR code",
"is_boolean": true
}
],
"is_custom": false
},
{
"id": 3,
"name": "Viewer",
"permissions": [
{
"id": 23,
"code": "QR_CODE_CAN_VIEW",
"name": "Can view QR Code",
"description": "Can view QR Code",
"is_boolean": true
}
],
"is_custom": false
}
]Overview
Retrieves a list of all user roles available in your account, including default roles (Manager, Admin, Viewer) and any custom roles you’ve created. Each role includes its permissions and access levels.Purpose
Role Management
- View Available Roles: See all roles in your account
- Understand Permissions: Review what each role can do
- Plan User Access: Choose appropriate roles when adding users
- Custom Role Reference: Reference custom roles you’ve created
Default Roles
- Manager (ID: 1): Can create, edit, and manage QR codes
- Admin (ID: 2): Full access including user management
- Viewer (ID: 3): Read-only access to QR codes and analytics
Response Structure
The response returns an array of access level objects, each containing:| Field | Type | Description |
|---|---|---|
id | integer | Unique role identifier |
name | string | Role name (e.g., “Manager”, “Admin”, “Viewer”) |
permissions | array | List of permissions for this role |
is_custom | boolean | Whether this is a custom role or default |
Permission Object Structure
Each permission in thepermissions array contains:
| Field | Type | Description |
|---|---|---|
id | integer | Permission identifier |
code | string | Permission code (e.g., “QR_CODE_CAN_ADD”) |
name | string | Human-readable permission name |
description | string | Detailed permission description |
is_boolean | boolean | Whether this is a boolean permission |
Examples
Get All User Roles
curl -X GET "https://management.scanova.io/multi-users/access-levels/" \
-H "Authorization: YOUR_API_KEY"
Response Example
[
{
"id": 1,
"name": "Manager",
"permissions": [
{
"id": 22,
"code": "QR_CODE_CAN_ADD",
"name": "Can Add QR Code",
"description": "Can add QR Code",
"is_boolean": true
},
{
"id": 23,
"code": "QR_CODE_CAN_VIEW",
"name": "Can view QR Code",
"description": "Can view QR Code",
"is_boolean": true
},
{
"id": 24,
"code": "QR_CODE_CAN_EDIT",
"name": "Can edit QR Code",
"description": "Can edit QR Code",
"is_boolean": true
},
{
"id": 26,
"code": "QR_CODE_CAN_DOWNLOAD",
"name": "Can download QR code",
"description": "Can download QR Code",
"is_boolean": true
},
{
"id": 1,
"code": "ANALYTICS_CAN_VIEW",
"name": "Analytics Can View",
"description": "Can view analytics",
"is_boolean": true
}
],
"is_custom": false
},
{
"id": 2,
"name": "Admin",
"permissions": [
{
"id": 22,
"code": "QR_CODE_CAN_ADD",
"name": "Can Add QR Code",
"description": "Can add QR Code",
"is_boolean": true
},
{
"id": 25,
"code": "QR_CODE_CAN_DELETE",
"name": "Can Delete QR Code",
"description": "Can delete QR code",
"is_boolean": true
},
{
"id": 18,
"code": "SHARED_USER_CAN_VIEW",
"name": "Can view shared user",
"description": "Can view user",
"is_boolean": true
},
{
"id": 19,
"code": "SHARED_USER_CAN_ADD",
"name": "Can add shared user",
"description": "Can add user",
"is_boolean": true
}
],
"is_custom": false
},
{
"id": 3,
"name": "Viewer",
"permissions": [
{
"id": 23,
"code": "QR_CODE_CAN_VIEW",
"name": "Can view QR Code",
"description": "Can view QR Code",
"is_boolean": true
},
{
"id": 1,
"code": "ANALYTICS_CAN_VIEW",
"name": "Analytics Can View",
"description": "Can view analytics",
"is_boolean": true
}
],
"is_custom": false
}
]
Common Permission Codes
QR Code Permissions
QR_CODE_CAN_ADD: Can create new QR codesQR_CODE_CAN_VIEW: Can view QR codesQR_CODE_CAN_EDIT: Can edit existing QR codesQR_CODE_CAN_DELETE: Can delete QR codesQR_CODE_CAN_DOWNLOAD: Can download QR codesQR_CODE_CAN_EXPORT: Can export QR codes
Analytics Permissions
ANALYTICS_CAN_VIEW: Can view analytics dataANALYTICS_CAN_EXPORT: Can export analyticsANALYTICS_CAN_EXPORT_RAW: Can export raw analytics dataANALYTICS_CAN_VIEW_ALL_USERS: Can view analytics for all users
User Management Permissions
SHARED_USER_CAN_VIEW: Can view shared usersSHARED_USER_CAN_ADD: Can add new usersSHARED_USER_CAN_EDIT: Can edit user rolesSHARED_USER_CAN_DELETE: Can remove users
Lead Generation Permissions
LEAD_GENERATION_CAN_ADD: Can create lead listsLEAD_GENERATION_CAN_EDIT: Can edit lead listsLEAD_GENERATION_CAN_DELETE: Can delete lead listsLEAD_GENERATION_ENTRY_CAN_VIEW: Can view lead entries
Custom Domain Permissions
CUSTOM_DOMAIN_CAN_VIEW: Can view custom domainsCUSTOM_DOMAIN_CAN_ADD: Can add custom domainsCUSTOM_DOMAIN_CAN_DELETE: Can delete custom domains
Integration Examples
JavaScript - Fetch and Display Roles
async function getUserRoles() {
try {
const response = await fetch('https://management.scanova.io/multi-users/access-levels/', {
method: 'GET',
headers: {
'Authorization': 'YOUR_API_KEY'
}
});
if (response.ok) {
const roles = await response.json();
// Display roles in a dropdown
const roleSelect = document.getElementById('roleSelect');
roles.forEach(role => {
const option = document.createElement('option');
option.value = role.id;
option.textContent = `${role.name} (${role.is_custom ? 'Custom' : 'Default'})`;
roleSelect.appendChild(option);
});
return roles;
} else {
throw new Error('Failed to fetch roles');
}
} catch (error) {
console.error('Error fetching roles:', error);
return [];
}
}
// Usage
getUserRoles().then(roles => {
console.log('Available roles:', roles);
});
Python - Get Roles and Permissions
import requests
def get_user_roles():
url = "https://management.scanova.io/multi-users/access-levels/"
headers = {"Authorization": "YOUR_API_KEY"}
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
roles = response.json()
# Print role information
for role in roles:
print(f"Role: {role['name']} (ID: {role['id']})")
print(f"Custom: {role['is_custom']}")
print("Permissions:")
for permission in role['permissions']:
print(f" - {permission['name']}: {permission['description']}")
print()
return roles
except requests.exceptions.RequestException as e:
print(f"Error fetching roles: {e}")
return []
# Usage
roles = get_user_roles()
PHP - Display Role Options
<?php
function getUserRoles() {
$url = "https://management.scanova.io/multi-users/access-levels/";
$headers = [
"Authorization: YOUR_API_KEY"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$roles = json_decode($response, true);
// Generate HTML select options
echo "<select name='role'>";
foreach ($roles as $role) {
$custom = $role['is_custom'] ? ' (Custom)' : ' (Default)';
echo "<option value='{$role['id']}'>{$role['name']}{$custom}</option>";
}
echo "</select>";
return $roles;
} else {
echo "Error fetching roles";
return [];
}
}
// Usage
$roles = getUserRoles();
?>
Use Cases
User Management Interface
- Role Selection: Populate dropdown menus with available roles
- Permission Display: Show what each role can do
- Access Control: Validate user permissions before actions
- Role Comparison: Compare different roles and their capabilities
API Integration
- Dynamic Role Assignment: Use role IDs when adding users
- Permission Checking: Verify user permissions before operations
- Role Validation: Ensure valid roles are used in requests
- Access Control: Implement role-based access control
Administrative Tools
- Role Audit: Review all roles and their permissions
- Permission Analysis: Understand what each role can access
- Custom Role Management: Manage custom roles and permissions
- Access Planning: Plan user access based on available roles
This endpoint is essential for understanding the available roles and permissions in your account. Use this information when adding new users or planning access control strategies.
Default roles (Manager, Admin, Viewer) cannot be modified, but you can create custom roles with specific permission combinations through the Scanova dashboard.
Authorizations
API key authentication. Enter your API key directly in the Authorization header.
Was this page helpful?
⌘I