Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Israel-Perez/Nuxt-Secure/llms.txt

Use this file to discover all available pages before exploring further.

DELETE /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.
This operation is irreversible. The profile record and all its permissions are permanently removed.

Path parameters

id
number
required
Primary key of the profile to delete.

Response

success
boolean
required
true when the profile and its permissions are deleted successfully.
message
string
required
Confirmation string. Always "Perfil eliminado correctamente" on success.

Error responses

StatusMessageCause
400ID de perfil inválidoThe :id path segment is missing or resolves to 0 or NaN.
409No 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.
500Ocurrió un error interno al eliminarAny other unhandled database error.

Examples

curl --request DELETE \
  --url https://your-domain.com/api/perfil/4 \
  --cookie 'auth_token=<your-jwt>'

Success response

200
{
  "success": true,
  "message": "Perfil eliminado correctamente"
}

Error response (409)

409
{
  "statusCode": 409,
  "message": "No puedes eliminar este perfil porque hay usuarios que lo están utilizando."
}