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.

Permanently removes a permission from the system by its numeric id. The deletion runs inside a database transaction: all entries in the permissionXRole pivot table referencing this permission are deleted first, then the permission record itself is removed. If the permission does not exist, a 404 is returned.
Deleting a permission cascades — all role-permission assignments for this permission are automatically removed within the same transaction. Any role that previously held this permission will immediately lose access to the associated route. This operation is irreversible. Consider using Unassign Permission to revoke the permission from individual roles without permanently removing the permission record.

Authentication

Requires a valid JWT and the DELETE /api/v1/permission/:id permission assigned to the caller’s role.

Request

Method: DELETE Path: /api/v1/permission/:id

Headers

Authorization
string
required
Bearer token obtained from the login endpoint. Format: Bearer <token>

Path Parameters

id
string
required
The numeric ID of the permission to delete. Must match ^\d+$ (digits only, no decimals or negative values).

Response

200 OK

Returns null for data on a successful deletion.
success
boolean
Always true for successful responses.
message
string
Human-readable confirmation message. Value: "Permiso eliminado exitosamente".
data
null
Always null for delete operations.
Example Response
{
  "success": true,
  "message": "Permiso eliminado exitosamente",
  "data": null
}

Error Responses

StatusDescription
400 Bad Requestid path parameter is not a valid numeric string.
401 UnauthorizedMissing or invalid JWT token.
403 ForbiddenAuthenticated user’s role lacks the DELETE /api/v1/permission/:id permission.
404 Not FoundNo permission with the given id exists.
404 Not Found
{
  "success": false,
  "message": "Permiso con id 99 no encontrado",
  "data": null
}

Code Example

cURL
curl -X DELETE http://localhost:3000/api/v1/permission/5 \
  -H "Authorization: Bearer <your_token>"

Socket.IO Events

On success, the server emits the following events:
EventTargetOperationStatus sequence
operation:progressRequesting socketpermissions:deletestartsuccess
data:changedAll connected clientspermissions:deleteBroadcast with no data payload (null)
Clients listening to data:changed can use the initiatorSocketId field in the payload to skip redundant UI updates if they already know the result from the HTTP response.

Build docs developers (and LLMs) love