StockManager stores every user account in a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/InnoDev69/StockManager/llms.txt
Use this file to discover all available pages before exploring further.
users table. Administrators and root users can list, create, update, and deactivate accounts through the REST API while vendors interact with the system using the credentials assigned to them. All write operations are recorded automatically in the audit log via the @audit_action decorator.
User Fields
Each user record exposes the following fields in API responses:| Field | Type | Description |
|---|---|---|
id | integer | Auto-incremented primary key |
username | string | Unique display name (max 30 chars) |
email | string | Unique email address (max 100 chars) |
role | string | One of root, admin, or vendedor |
status | integer | 1 = active, 0 = disabled |
created_at | string | ISO 8601 creation timestamp |
CRUD Operations
List Users
admin or root role.
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
search | string | "" | Filters by username or email (partial match) |
page | integer | 1 | Page number |
limit | integer | 10 | Results per page (max 100) |
Get a Single User
admin or root role.
Response: 200 OK with the user object, or 404 if not found.
Create a User
status=1 and application="accepted". Requires admin or root role.
Required body fields:
| Field | Constraint |
|---|---|
username | Unique, max 30 chars |
email | Valid format, unique, max 100 chars |
password | Max 128 chars, stored as a Werkzeug hash |
role | One of root, admin, vendedor |
201 on success, 400 for missing/invalid fields, 409 if the email or username already exists.
Update a User
admin or root role.
Accepted fields: username, email, role, status, password.
Response: 200 OK. The target user receives an in-app notification when their account is updated. Returns 200 with "No hay cambios que aplicar" if all submitted values match the current record.
Disable a User
admin or root role. You cannot disable your own account; doing so returns 400.
Response:
Password Reset Flow
The reset flow is a three-step process that does not require the user to be authenticated. A 6-digit numeric code is generated, stored temporarily, and delivered by email. The code expires after 15 minutes.Request a Reset Code
Send the user’s email address to receive a 6-digit code.Response:Status codes:
200 on success, 400 for missing/invalid email, 404 if no account exists.Validate the Code
Submit the email and the 6-digit code that was delivered to the inbox.Response:Status codes:
200 on success, 401 if the code is invalid or expired.Vendor Autocomplete
vendedor or admin role whose username or email contains the search string. Requires any authenticated session.
Query parameters:
| Parameter | Description |
|---|---|
q | Partial username or email to match |
data array when q is blank.
Validation Limits
Field length constraints
Field length constraints
| Field | Max length |
|---|---|
username | 30 characters |
email | 100 characters |
password | 128 characters |
generate_password_hash before writing to the database.