Skip to main content

GET /api/permissions/search

Performs a paginated search for permissions with optional filtering by name. Supports partial name matching.

Authentication

This endpoint requires authentication with a valid Bearer token.

Query Parameters

name
string
Optional filter for partial name matching. Returns permissions whose name contains this value.
page
integer
default:"0"
Zero-based page number for pagination.
size
integer
default:"10"
Number of elements per page. Determines the page size for pagination.

Response

content
array
Array of permission objects matching the search criteria
id
uuid
Unique identifier of the permission
name
string
The name of the permission
description
string
Description of the permission
status
string
Current status of the permission
pageNumber
integer
Current page number (zero-based)
pageSize
integer
Number of elements per page
totalElements
long
Total number of elements matching the search criteria
totalPages
integer
Total number of pages available
isLast
boolean
Indicates whether this is the last page

Status Codes

  • 200 OK - Search completed successfully
  • 400 Bad Request - Invalid query parameters

Example Request

curl -X GET "https://api.example.com/api/permissions/search?name=user&page=0&size=10" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "content": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "users:read",
      "description": "Permission to read user data",
      "status": "ACTIVE"
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "users:write",
      "description": "Permission to create and update user data",
      "status": "ACTIVE"
    }
  ],
  "pageNumber": 0,
  "pageSize": 10,
  "totalElements": 2,
  "totalPages": 1,
  "isLast": true
}

Search Without Filter

You can retrieve all permissions with pagination by omitting the name parameter:
curl -X GET "https://api.example.com/api/permissions/search?page=0&size=20" \
  -H "Authorization: Bearer YOUR_TOKEN"

Error Response

{
  "timestamp": "2026-03-04T10:30:00Z",
  "status": 400,
  "error": "Bad Request",
  "message": "Parámetros inválidos",
  "path": "/api/permissions/search"
}

Build docs developers (and LLMs) love