ื“ืœื’ ืœืชื•ื›ืŸ ื”ืจืืฉื™

Role & Permission Endpoints

Manage roles, permissions, and role-permission assignments. Roles define what actions users can perform within a tenant.

Base Pathsโ€‹

ResourcePath
Roles/api/roles
Role Permissions/api/role-permissions

Built-in Rolesโ€‹

RoleDescription
SUPER_ADMINFull system access, tenant management
ADMINOrganization management, user management
DATA_ENTRYData input and basic CRUD operations
EMPLOYEEStandard employee with limited access
CANDIDATEJob candidate with minimal access
MANAGERTeam/department management
VIEWERRead-only access

Role Endpointsโ€‹

List All Rolesโ€‹

GET /api/roles
Authorization: Bearer {token}

Response 200 OK:

{
"items": [
{
"id": "uuid",
"name": "ADMIN",
"isSystem": true,
"tenantId": "uuid"
}
],
"total": 7
}

Find Role by Optionsโ€‹

GET /api/roles/options?name=EMPLOYEE
Authorization: Bearer {token}

Create Roleโ€‹

POST /api/roles
Authorization: Bearer {token}
Content-Type: application/json

{
"name": "CUSTOM_ROLE"
}

Update Roleโ€‹

PUT /api/roles/:id
Authorization: Bearer {token}
Content-Type: application/json

{
"name": "UPDATED_ROLE_NAME"
}

Delete Roleโ€‹

DELETE /api/roles/:id
Authorization: Bearer {token}

Import Roles (Cloud Migration)โ€‹

POST /api/roles/import/migrate
Authorization: Bearer {token}
Content-Type: application/json

[
{ "name": "CUSTOM_ROLE_1", "isSystem": false }
]

Role Permission Endpointsโ€‹

List Permissions for Roleโ€‹

GET /api/role-permissions?roleId={roleId}
Authorization: Bearer {token}

Assign Permission to Roleโ€‹

POST /api/role-permissions
Authorization: Bearer {token}
Content-Type: application/json

{
"roleId": "uuid",
"permission": "ORG_USERS_VIEW",
"enabled": true
}

Update Permissionโ€‹

PUT /api/role-permissions/:id
Authorization: Bearer {token}
Content-Type: application/json

{
"enabled": false
}

Remove Permission from Roleโ€‹

DELETE /api/role-permissions/:id
Authorization: Bearer {token}

Available Permissionsโ€‹

CategoryPermissions
OrganizationORG_USERS_VIEW, ORG_USERS_EDIT, ALL_ORG_VIEW, ALL_ORG_EDIT
EmployeesORG_EMPLOYEES_VIEW, ORG_EMPLOYEES_EDIT
TimeTIME_TRACKER, ALLOW_MANUAL_TIME, ALLOW_DELETE_TIME
TasksORG_TASK_VIEW, ORG_TASK_EDIT, ORG_TASK_ADD
ProjectsORG_PROJECT_VIEW, ORG_PROJECT_EDIT, ORG_PROJECT_ADD
SprintsORG_SPRINT_VIEW, ORG_SPRINT_ADD, ORG_SPRINT_EDIT, ORG_SPRINT_DELETE
InvoicesORG_EXPENSES_VIEW, ORG_EXPENSES_EDIT, INVOICES_VIEW, INVOICES_EDIT
CRMVIEW_SALES_PIPELINES, EDIT_SALES_PIPELINES
RolesCHANGE_ROLES_PERMISSIONS
IntegrationINTEGRATION_VIEW, INTEGRATION_EDIT
SystemMIGRATE_GAUZY_CLOUD, ACCESS_DELETE_ACCOUNT, ACCESS_DELETE_ALL_DATA

Data Modelโ€‹

interface IRole {
id: string;
name: string;
isSystem: boolean;
tenantId: string;
rolePermissions?: IRolePermission[];
}

interface IRolePermission {
id: string;
roleId: string;
permission: string;
enabled: boolean;
tenantId: string;
}

Permissionsโ€‹

ActionRequired Permission
View/manage rolesCHANGE_ROLES_PERMISSIONS
View roles (team)ORG_TEAM_ADD