The Node.js API exposes four user-management endpoints under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juescoryisus/QualityDocD/llms.txt
Use this file to discover all available pages before exploring further.
/users path. Every endpoint requires a valid JWT in the Authorization: Bearer header and a minimum role of COMPANY_ADMIN. The requests a caller can perform — and the data they can see — are automatically scoped to their company and role level, making it safe to expose these endpoints to company-level administrators without risking cross-tenant data access.
Role hierarchy
QualityDocD defines six roles arranged in ascending order of privilege. TherequireMinRole middleware compares a numeric weight assigned to each role, granting access only when the caller’s weight is greater than or equal to the required minimum.
| Role | Weight | Description |
|---|---|---|
VIEWER | 1 | Read-only access to documents |
COMMENTER | 2 | Read access plus the ability to comment |
CONTRIBUTOR | 3 | Can upload documents (land in DRAFT status) |
OPERATOR | 4 | Manages documents within their module |
COMPANY_ADMIN | 5 | Full control within their own company |
SUPER_ADMIN | 6 | Full control across all companies |
COMPANY_ADMIN (weight 5). Callers with VIEWER, COMMENTER, CONTRIBUTOR, or OPERATOR roles receive 403 Forbidden.
GET /users
Lists user accounts. The result set is automatically scoped by the caller’s role: aCOMPANY_ADMIN sees only users belonging to their own company, while a SUPER_ADMIN sees all users across every company.
Authentication: Authorization: Bearer <token> — minimum role COMPANY_ADMIN
No request body or query parameters.
Example request
The user’s primary key in the
users table.The ID of the company this user belongs to.
The user’s display name.
The user’s email address. Unique across all users in the database.
The user’s current role. One of
VIEWER, COMMENTER, CONTRIBUTOR, OPERATOR, COMPANY_ADMIN, SUPER_ADMIN.ISO 8601 timestamp (with timezone) of when the account was created.
| Status | Condition |
|---|---|
401 Unauthorized | Missing or invalid Authorization header |
403 Forbidden | Caller’s role is below COMPANY_ADMIN |
POST /users
Creates a new user account. The new user is associated with acompanyId provided in the request body, but a COMPANY_ADMIN caller is restricted: they can only create users in their own company and only assign roles up to and including OPERATOR. A SUPER_ADMIN may create users in any company with any role.
Authentication: Authorization: Bearer <token> — minimum role COMPANY_ADMIN
The ID of the company the new user will belong to. If the caller is a
COMPANY_ADMIN, this must match their own companyId; any other value results in 403 Forbidden.The new user’s display name.
The new user’s email address. Must be unique across all users in the database.
The new user’s plaintext password. Hashed with bcrypt (10 rounds) before being stored. Never returned in any response.
The role to assign. One of
VIEWER, COMMENTER, CONTRIBUTOR, OPERATOR, COMPANY_ADMIN, SUPER_ADMIN. Defaults to VIEWER if omitted.A COMPANY_ADMIN caller may only assign VIEWER, COMMENTER, CONTRIBUTOR, or OPERATOR. Attempting to assign COMPANY_ADMIN or SUPER_ADMIN returns 403 Forbidden.The newly created user’s primary key.
The company the new user was created in.
The new user’s display name.
The new user’s email address.
The role assigned to the new user.
| Status | Condition |
|---|---|
400 Bad Request | Missing or invalid fields in the request body |
401 Unauthorized | Missing or invalid Authorization header |
403 Forbidden | Caller is COMPANY_ADMIN and the requested role exceeds OPERATOR, or companyId does not match the caller’s own company |
PUT /users/:id/role
Updates the role of an existing user identified by their numericid in the URL path. Role changes are validated against the caller’s own role: a COMPANY_ADMIN cannot promote any user to COMPANY_ADMIN or higher, and can only modify users within their own company.
Authentication: Authorization: Bearer <token> — minimum role COMPANY_ADMIN
URL parameter
| Parameter | Type | Description |
|---|---|---|
id | number | The primary key of the user whose role will be changed |
The new role to assign. Must be one of
VIEWER, COMMENTER, CONTRIBUTOR, OPERATOR, COMPANY_ADMIN, SUPER_ADMIN.A COMPANY_ADMIN caller may only assign roles below COMPANY_ADMIN (weight ≤ 4): VIEWER, COMMENTER, CONTRIBUTOR, or OPERATOR.The updated user’s primary key.
The updated user’s display name.
The updated user’s email address.
The user’s role after the update.
| Status | Condition |
|---|---|
400 Bad Request | The role value is not one of the six valid role strings |
401 Unauthorized | Missing or invalid Authorization header |
403 Forbidden | Caller is COMPANY_ADMIN and the target user is in a different company, or the requested role is COMPANY_ADMIN or higher |
404 Not Found | No user exists with the given id |
DELETE /users/:id
Permanently deletes a user account. The caller cannot delete their own account. ACOMPANY_ADMIN can only delete users within their own company; attempting to delete a user from another company returns 403 Forbidden. A SUPER_ADMIN can delete any user across all companies.
Authentication: Authorization: Bearer <token> — minimum role COMPANY_ADMIN
URL parameter
| Parameter | Type | Description |
|---|---|---|
id | number | The primary key of the user to delete |
Always
true when the request succeeds, confirming the user record was removed from the database.| Status | Condition |
|---|---|
400 Bad Request | The id in the URL matches the caller’s own user ID (self-deletion is not allowed) |
401 Unauthorized | Missing or invalid Authorization header |
403 Forbidden | Caller is COMPANY_ADMIN and the target user belongs to a different company |
404 Not Found | No user exists with the given id |