/api/perfil/:id
Permanently removes a profile and all its associated permisos_perfil records. Before deleting, the endpoint checks whether any users are assigned to this profile. If any users are found, the operation is rejected with a 409 Conflict error.
Path parameters
Primary key of the profile to delete.
Response
true when the profile and its permissions are deleted successfully.Confirmation string. Always
"Perfil eliminado correctamente" on success.Error responses
| Status | Message | Cause |
|---|---|---|
400 | ID de perfil inválido | The :id path segment is missing or resolves to 0 or NaN. |
409 | No puedes eliminar este perfil porque hay usuarios que lo están utilizando. | One or more users in the usuario table have idPerfil set to this profile’s id. Reassign or delete those users first. |
500 | Ocurrió un error interno al eliminar | Any other unhandled database error. |
Examples
Success response
200
Error response (409)
409