PlatformXeDocs
Get API Key

Batch Permission Check

Check up to 100 permissions in a single request.

The batch check endpoint evaluates multiple permissions for a single user in one request. It deduplicates by adminId internally for efficiency.

Endpoint

POST /api/v1/permissions/check-batch

Scope: permissions:check

Rate limit: 5,000/hr

Request body

FieldTypeRequiredDescription
adminIdstringYesThe user to check permissions for
checksarrayYesArray of checks (max 100)
checks[].pathstringYesPermission path
checks[].actionstringYesAction to check
checks[].resourceobjectNoResource attributes for ABAC/ReBAC
contextobjectNoShared request context for all checks

curl

curl -X POST https://api.platformxe.com/api/v1/permissions/check-batch \
  -H "Content-Type: application/json" \
  -H "x-api-key: pxk_live_your_api_key_here" \
  -d '{
    "adminId": "user_xyz789",
    "checks": [
      { "path": "articles", "action": "read" },
      { "path": "articles", "action": "delete" },
      { "path": "settings", "action": "manage" }
    ]
  }'

SDK

const result = await px.permissions.checkBatch({
  adminId: 'user_xyz789',
  checks: [
    { path: 'articles', action: 'read' },
    { path: 'articles', action: 'delete' },
    { path: 'settings', action: 'manage' },
  ],
});

for (const check of result.data.results) {
  console.log(`${check.path}:${check.action} → ${check.allowed}`);
}

Response

{
  "success": true,
  "data": {
    "results": [
      { "path": "articles", "action": "read", "allowed": true, "source": "role" },
      { "path": "articles", "action": "delete", "allowed": false, "source": "none" },
      { "path": "settings", "action": "manage", "allowed": false, "source": "override_deny" }
    ]
  }
}

Each result includes the same source field as a single check. See Permission Check for the full list of source values.

Use batch checks when rendering UI that depends on multiple permissions — for example, showing or hiding action buttons in a toolbar. A single batch request is significantly faster than making 10+ individual checks.

Error responses

CodeDescription
BAD_REQUESTMore than 100 checks, or missing required fields
FORBIDDENAPI key missing permissions:check scope
RATE_LIMITEDExceeded 5,000 checks/hr limit