The Roles API provides full CRUD operations for managing user roles within TechStore Explorer. Because roles control access across the application, this resource is restricted exclusively to users with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Emmanuel-Mtz-777/TechStore-Explorer/llms.txt
Use this file to discover all available pages before exploring further.
admin role. All five endpoints require both a valid Laravel Sanctum Bearer token (auth:sanctum) and admin privileges (admin.api) — unauthenticated requests and regular authenticated users are both denied access.
401 Unauthorized — returned by admin.api when no user is present on the request:
admin.api when the authenticated user does not hold the admin role:
GET /api/roles
Returns a list of every role currently defined in the system. Authentication: Bearer token + admin role Request body: None Success response — 200 OKArray of all role objects in the system.
POST /api/roles
Creates a new role with the provided name. Authentication: Bearer token + admin role Request bodyThe name of the new role. Must be a string with a maximum length of 255 characters.
Human-readable confirmation string:
"Rol creado correctamente".The newly created role record, including its generated
id and timestamps.GET /api/roles/
Returns a single role by its ID. Uses Laravel’s implicit route model binding — a non-existent ID returns a 404 response automatically. Authentication: Bearer token + admin role Path parameterThe ID of the role to retrieve.
The role object matching the supplied
id. Contains id, name, created_at, and updated_at.PUT /api/roles/
Updates the name of an existing role. Uses Laravel’s implicit route model binding — a non-existent ID returns a 404 response automatically. Authentication: Bearer token + admin role Path parameterThe ID of the role to update.
The new name for the role. Must be a string with a maximum length of 255 characters.
Human-readable confirmation string:
"Rol actualizado correctamente".The updated role record reflecting the new
name and a refreshed updated_at timestamp.DELETE /api/roles/
Permanently deletes a role by its ID. Uses Laravel’s implicit route model binding — a non-existent ID returns a 404 response automatically. Authentication: Bearer token + admin role Path parameterThe ID of the role to delete.
Human-readable confirmation string:
"Rol eliminado correctamente".