These endpoints let admins manage the operator role within ECE-BOT. Operators are users granted access to machine monitoring dashboards. Admins can invite new users by email, promote existing accounts, toggle access, and permanently delete deactivated operators.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Kr-Yogsa/ECE-BOT/llms.txt
Use this file to discover all available pages before exploring further.
All four endpoints require an admin-role Bearer token. Operator invitation and promotion emails are sent automatically using
APP_BASE_URL to construct the signup link.GET /admin/operators
Lists all accounts currently holding theoperator role, along with the authenticated admin’s own account details.
Headers
Bearer token for an admin account. Example:
Bearer <token>.Response
Profile of the authenticated admin making the request.
Array of operator account objects. Empty array when no operators exist.
200
POST /admin/operators
Invites or promotes a user to the operator role by email address. The server inspects the email and applies the appropriate action automatically. The behavior varies depending on whether the email is already registered:| Scenario | Action | Email sent | Status |
|---|---|---|---|
| New email address | Creates a pending operator account | Invitation with signup link | 201 |
| Existing non-operator user | Promotes account to operator role | Promotion notification | 200 |
| Existing operator (verified) | Confirms existing operator access | Promotion notification | 200 |
| Existing operator (unverified) | Resends invitation | Invitation with signup link | 200 |
| Existing admin account | Rejected — admins cannot be downgraded | None | 409 |
Headers
Bearer token for an admin account.
Body
Email address of the user to invite or promote. Must be a valid email format.
Response
Description of the action taken (e.g.,
"Operator invited successfully. Invitation email has been sent.").The created or updated operator account.
201 — new operator invited
200 — existing user promoted
409
PATCH /admin/operators//status
Activates or deactivates an operator account. Settingis_active to false downgrades the account role to user and sends the operator a removal notification email. The account record is retained and can be re-invited later.
Path parameters
Numeric ID of the operator account to update.
Headers
Bearer token for an admin account.
Body
Pass
false to remove operator access (role is changed to user, removal email sent). Pass true to re-activate an operator.Response
Description of the change (e.g.,
"Operator access removed successfully. The account is now a normal user.").The updated account reflecting the new role and status.
When
is_active is set to false, the account’s role is immediately changed to user. To restore operator access, use POST /admin/operators with the same email address.200 — deactivated
200 — activated
404
DELETE /admin/operators/
Permanently deletes an operator account. The operator must be deactivated first usingPATCH /admin/operators/{user_id}/status with is_active: false. Attempting to delete an active operator returns a 400 error.
Path parameters
Numeric ID of the operator account to delete.
Headers
Bearer token for an admin account.
Response
Confirmation:
"Operator deleted successfully."200
400
404