PlatformXeDocs
Get API Key

Modules API

Register and list permission modules.

Modules represent functional areas of your application. They are used by the Full authorization model to define action sets that can be assigned to roles.

Scope: permissions:manage

Rate limit: 500/hr

List modules

GET /api/v1/permissions/modules

Returns all registered modules for the tenant.

curl https://api.platformxe.com/api/v1/permissions/modules \
  -H "x-api-key: pxk_live_your_api_key_here"
const modules = await px.permissions.listModules();

Response

{
  "success": true,
  "data": {
    "modules": [
      {
        "id": "mod_bookings",
        "name": "BOOKINGS",
        "description": "Booking management",
        "actions": ["READ", "CREATE", "UPDATE", "DELETE", "LIST", "APPROVE"],
        "createdAt": "2026-03-15T08:00:00.000Z"
      }
    ]
  }
}

Register a module

POST /api/v1/permissions/modules

Registration is durable — processed via a background job to ensure consistency across the system.

FieldTypeRequiredDescription
namestringYesModule name (uppercase, e.g., BOOKINGS)
descriptionstringNoHuman-readable description
actionsstring[]YesSupported actions for this module
curl -X POST https://api.platformxe.com/api/v1/permissions/modules \
  -H "Content-Type: application/json" \
  -H "x-api-key: pxk_live_your_api_key_here" \
  -d '{
    "name": "PROPERTIES",
    "description": "Property listing management",
    "actions": ["READ", "CREATE", "UPDATE", "DELETE", "LIST", "PUBLISH"]
  }'
await px.permissions.registerModule({
  name: 'PROPERTIES',
  description: 'Property listing management',
  actions: ['READ', 'CREATE', 'UPDATE', 'DELETE', 'LIST', 'PUBLISH'],
});

Module limits by plan

PlanMax modules
Free5
Basic20
Pro50
EnterpriseUnlimited

Attempting to register a module beyond your plan limit returns a BILLING_LIMIT error.

Module registration is idempotent. Registering a module with the same name updates its description and action set rather than creating a duplicate.

Error responses

CodeDescription
BAD_REQUESTMissing name or empty actions array
BILLING_LIMITModule count exceeds plan limit
FORBIDDENAPI key missing permissions:manage scope