Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/TheSerchCp/SEAM-API/llms.txt

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

The DELETE /api/v1/sidebar/:idItem endpoint permanently removes a sidebar navigation item from the sidebarItems table. The endpoint first checks that the item exists, returning 404 if not found, then performs the deletion. Because the roleXItem table is defined with ON DELETE CASCADE on its foreign key to sidebarItems, all role-to-item assignments for the deleted item are automatically cleaned up by the database — no orphaned rows are left behind.

Authentication

Requires a valid JWT in the Authorization header. The authenticated user’s role must also have the permission DELETE /api/v1/sidebar/:idItem registered in the permissions table and assigned via permissionXRole.
Authorization: Bearer <token>

Request

Method: DELETE
Path: /api/v1/sidebar/:idItem
This endpoint accepts no request body.

Path Parameters

idItem
string
required
Numeric ID of the sidebar item to delete. Must match the pattern ^\d+$ (digits only). Corresponds to the idItem primary key in the sidebarItems table.

Response

200 — Success

The item was found and deleted. The response data is null since there is nothing to return for a deletion.
{
  "success": true,
  "message": "Sidebar item eliminado exitosamente",
  "data": null
}
success
boolean
Always true for successful responses.
message
string
Human-readable confirmation: "Sidebar item eliminado exitosamente".
data
null
Always null for delete operations.

400 — Bad Request

Returned when the idItem path parameter is not a valid numeric string.
{
  "success": false,
  "message": "idItem must match pattern ^\\d+$"
}

401 — Unauthorized

Returned when the Authorization header is missing or the token is invalid/expired.
{
  "success": false,
  "message": "Token requerido"
}

403 — Forbidden

Returned when the authenticated user’s role does not have the DELETE /api/v1/sidebar/:idItem permission.
{
  "success": false,
  "message": "No tienes permisos para acceder a este recurso"
}

404 — Not Found

Returned when no sidebar item with the given idItem exists in the database. The existence check is performed by findItemById before the deletion is attempted.
{
  "success": false,
  "message": "Sidebar item con id 9 no encontrado"
}

Example

curl -X DELETE http://localhost:{PORT}/api/v1/sidebar/9 \
  -H "Authorization: Bearer <your_jwt_token>"
Deleting a sidebar item is permanent and irreversible. Because the roleXItem table uses ON DELETE CASCADE, every role assignment for this item is also deleted automatically. Users whose roles had this item assigned will no longer see it in their sidebar — the change takes effect at their next login, since sidebar items are delivered as part of the POST /api/v1/auth/login response.

Real-time Events

This endpoint emits Socket.IO events throughout the deletion lifecycle:
EventStageDescription
sidebar:deletestartDeletion process initiated for the given item ID
sidebar:deleteprocessingChecking existence, then removing item and cascade assignments
sidebar:deletesuccessItem deleted, payload includes the deleted idItem

Build docs developers (and LLMs) love