Skip to main content
DELETE /api/modulo/:id Permanently removes a module and cascades the deletion to all related records. The endpoint deletes in this order:
  1. All permisos_perfil rows where idModulo matches the given id.
  2. All menu rows where idModulo matches the given id.
  3. The modulo record itself.
This operation is irreversible. The module and all associated permissions and menu entries are permanently removed.

Path parameters

id
number
required
Primary key of the module to delete.

Response

success
boolean
required
true when the module and all related records are deleted successfully.
message
string
required
Confirmation string. Always "Módulo y sus permisos asociados eliminados correctamente." on success.

Error responses

StatusMessageCause
200 (with success: false)ID de módulo inválido.The :id path segment is missing or resolves to 0 or NaN.
200 (with success: false)Ocurrió un error al intentar eliminar el módulo.Any unhandled database error during the delete sequence.
Errors for this endpoint return HTTP 200 with success: false in the body rather than a 4xx/5xx HTTP status code.

Examples

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

Success response

200
{
  "success": true,
  "message": "Módulo y sus permisos asociados eliminados correctamente."
}

Error response (invalid ID)

200
{
  "success": false,
  "message": "ID de módulo inválido."
}

Build docs developers (and LLMs) love