User and role governance

Overview

Manage which target users and roles an access level may see or use. Routes use /wp-json/aam/v2 on a standard WordPress installation.

Endpoints

Method Route Input Purpose
GET /identity/role/{slug} slug Get role.
PATCH /identity/role/{slug} slug, permissions Set role permissions.
DELETE /identity/role/{slug} slug Reset role permissions.
PATCH /identity/role/{slug}/{permission} slug, permission, effect Set role permission.
GET /identity/roles — Get roles.
DELETE /identity/roles — Reset roles permissions.
GET (Premium) /identity/roles/default — Get roles permissions.
PATCH (Premium) /identity/roles/default permissions Set roles permissions.
DELETE (Premium) /identity/roles/default — Reset roles permissions.
PATCH (Premium) /identity/roles/default/{permission} permission, effect Set roles permission.
GET /identity/user/{id} id Get user.
PATCH /identity/user/{id} id, permissions Set user permissions.
DELETE /identity/user/{id} id Reset user permissions.
PATCH /identity/user/{id}/{permission} id, permission, effect Set user permission.
GET /identity/users search, offset, per_page, role Get users.
DELETE /identity/users — Reset users permissions.
GET (Premium) /identity/users/default — Get users permissions.
PATCH (Premium) /identity/users/default permissions Set users permissions.
DELETE (Premium) /identity/users/default — Reset users permissions.
PATCH (Premium) /identity/users/default/{permission} permission, effect Set users permission.

PATCH rows also accept POST and PUT because WordPress registers them as editable routes. The Input column lists route-specific parameters. A path parameter in {braces} is required. WordPress validates body and query parameters against the registered route schema. Premium rows require the Complete Package add-on.

Parameter guide

The route table shows which operation uses each parameter. Path parameters are required; other requirements depend on the operation.

Parameter Type Meaning
effect string Permission effect.
id string Id.
offset number Pagination offset.
per_page number Pagination limit per page.
permission string Role identity permission.
permissions array Permission objects for a bulk update.
role string Return users only for given role.
search string Search string.
slug string Slug.

Access level and authorization

Most routes accept access_level=role&role_id=editor, access_level=user&user_id=42, access_level=visitor, or access_level=default. This selects whose rules you read or change. A path ID or body value selects the target.

Required permission: aam_manager and aam_manage_identities. See Authentication and Error handling.

The access-level arguments choose whose rules change. Path id and slug identify the target user or role.

Example

GET /wp-json/aam/v2/identity/users?access_level=role&role_id=editor
Authorization: Basic <base64 username:application-password>

This lists target-user governance rules for Editors. The target users are separate from the Editor subject.