Delete a role (Admin only)
curl --request DELETE \
--url https://api.example.com/api/roles/:id{
"success": true,
"message": "<string>",
"data": null
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/David9604/BackMaqagr/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <admin_jwt_token>
curl -X DELETE "http://localhost:4000/api/roles/3" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json"
{
"success": true,
"message": "Role deleted successfully",
"data": null
}
{
"success": false,
"message": "Token no proporcionado o inválido"
}
{
"success": false,
"message": "Access denied. Admin privileges required"
}
{
"success": false,
"message": "Role not found"
}
| Status Code | Description |
|---|---|
| 400 | Invalid role ID |
| 401 | Missing or invalid authentication token |
| 403 | User does not have admin privileges |
| 404 | Role not found |
| 500 | Internal server error |
src/routes/role.routes.js:deletesrc/controllers/roleController.js:deleteRolecurl --request DELETE \
--url https://api.example.com/api/roles/:id{
"success": true,
"message": "<string>",
"data": null
}