Skip to main content

Permissions

1 API call in this section.

List Permissions​

Platform & Access / Permissions
GET/permissions

Retrieves a paginated list of permissions with optional filtering by role ID, scope, and search term.

Response Behavior

  • When role_id is provided: Returns permissions assigned to the specified role

  • When scope is provided: Returns permissions filtered by the specified scope

  • When search is provided: Returns only permissions whose name or description contains the search term

  • When neither filter is provided: Returns all permissions ordered by name

Frontend Integration Contract

  • Endpoint: GET /permissions

  • To search tenant permissions, call /permissions?language=en&scope=tenant&search=<term>&page=1&limit=100

  • Read filtered results from permissions; use total, page, and limit from the same filtered query for pagination

  • Empty matches return success: true, permissions: [], and total: 0

Query parameters

ParameterTypeDescription
languageOptionalstring

Language code for response localization (Optional, default: en) Language code for localized response messages (e.g., 'en')

Example: en

pageOptionalstring

Page number for pagination (Optional, default: 1) Page number for pagination (default: 1)

Example: 1

limitOptionalstring

Number of records per page (Optional, default: 10) Number of records per page (default: 10)

Example: 10

role_idOptionalstring

Filter permissions by role ID (Optional)

scopeOptionalstring

Filter permissions by scope (Optional, e.g., 'system', 'tenant') Filter permissions by scope (e.g., 'system', 'tenant')

searchOptionalstring

Search permissions by name or description (Optional, case-insensitive, applied before pagination) Case-insensitive search across permission name and description; applies together with role_id and/or scope before pagination and count

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/permissions?language=en&page=1&limit=10&role_id=&scope=&search=" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200OK
Response body
json
1{2  "success": true,3  "message": "Permissions retrieved successfully",4  "permissions": [5    {6      "id": "perm-001",7      "name": "create:users",8      "description": "Create new users",9      "scope": "system"10    },11    {12      "id": "perm-002",13      "name": "delete:users",14      "description": "Delete existing users",15      "scope": "system"16    },17    {18      "id": "perm-003",19      "name": "manage:tenants",20      "description": "Manage tenant organizations",21      "scope": "system"22    }23  ],24  "total": 42,25  "page": 1,26  "limit": 1027}