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.

Finds and returns permission records whose nameUri matches the supplied query parameter. The lookup is case-insensitive (backed by LOWER() in SQL), so GET /api/v1/users and get /api/v1/users resolve to the same records. If no match is found, a 404 is returned. This endpoint is useful when you need to check whether a route is already protected before calling Register Permission, or to retrieve the idPermission for use in Assign Permission.

Authentication

Requires a valid JWT in the Authorization header. No specific role permission is needed.

Request

Method: GET Path: /api/v1/permission/getByNameUri

Headers

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

Query Parameters

nameUri
string
required
The route pattern to look up. Must be between 2 and 100 characters. URL-encode any spaces as %20 or +. Example: GET%20/api/v1/users.

Response

200 OK

Returns the matching permission records as an array.
success
boolean
Always true for successful responses.
message
string
Human-readable status message. Value: "Permiso obtenido por nombre.".
data
array
Array of permission objects whose nameUri matches the query (case-insensitive). Typically contains one element.
Example Response
{
  "success": true,
  "message": "Permiso obtenido por nombre.",
  "data": [
    {
      "idPermission": 5,
      "nameUri": "DELETE /api/v1/roles/:idRole",
      "description": "Allows deleting a role by its numeric ID"
    }
  ]
}

Error Responses

StatusDescription
400 Bad RequestnameUri is missing or fails the 2–100 character length constraint.
401 UnauthorizedMissing or invalid JWT token.
404 Not FoundNo permission with the given nameUri exists in the system.
404 Not Found
{
  "success": false,
  "message": "El permiso 'DELETE /api/v1/roles/:idRole' no existe.",
  "data": null
}

Code Example

cURL — URL-encoded nameUri
curl -X GET \
  -H "Authorization: Bearer <your_token>" \
  "http://localhost:3000/api/v1/permission/getByNameUri?nameUri=DELETE%20%2Fapi%2Fv1%2Froles%2F%3AidRole"
cURL — Using shell quoting
curl -X GET \
  -H "Authorization: Bearer <your_token>" \
  --get \
  --data-urlencode "nameUri=DELETE /api/v1/roles/:idRole" \
  "http://localhost:3000/api/v1/permission/getByNameUri"

Socket.IO Events

This is a read-only endpoint. A data:changed broadcast is not emitted. The requesting client receives operation:progress events for the permissions:fetchByUri operation on their own socket only.
EventTargetOperationStatus sequence
operation:progressRequesting socketpermissions:fetchByUristartsuccess

Build docs developers (and LLMs) love