The admin user management endpoints allow administrators to view all registered users, change their roles, and permanently delete accounts. All three endpoints require a valid JWT from an account with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/akibanks/tienda_musica_web/llms.txt
Use this file to discover all available pages before exploring further.
admin role — requests from cliente or vendedor accounts are rejected. The VinylVibes admin panel (admin.html) exposes these endpoints through a searchable user table with inline role selectors and deletion controls.
GET /admin/usuarios
Authentication: Required — admin JWT Returns all registered users across all roles. This is the data source for the admin panel’s user table and the stats card showing total user count.cURL Example
Response
Returns an array of user objects.Unique user ID.
Username chosen at registration.
Email address, or
null if not provided.The user’s current role. One of:
cliente, vendedor, or admin.ISO 8601 timestamp of account creation.
Response Example
PUT /admin/usuarios/{id}/rol
Authentication: Required — admin JWT Changes the role of a specific user. The new role takes effect immediately and is reflected in the user’s access permissions on their next authenticated request.Path Parameter
| Parameter | Type | Description |
|---|---|---|
id | integer | Target user’s ID |
Request Body
The new role to assign. Must be one of:
cliente, vendedor, admin.cURL Example
Success Response (200)
How the Frontend Enforces the Self-Demotion Guard
The following code is taken directly fromadmin.js (cambiarRol function). The current user’s ID is parsed from the JWT payload before the request is made:
DELETE /admin/usuarios/{id}
Authentication: Required — admin JWT Permanently deletes a user account from the system. This action cannot be undone.Path Parameter
| Parameter | Type | Description |
|---|---|---|
id | integer | Target user’s ID |