API routes

Overview

Manage access to WordPress REST routes. Routes use /wp-json/aam/v2 on a standard WordPress installation.

Endpoints

Method Route Input Purpose
GET /api-route/{id} id Get item.
PATCH /api-route/{id} id, effect Update item permissions.
DELETE /api-route/{id} id Reset item permissions.
GET /api-routes — Get items.
PATCH (Premium) /api-routes effect, endpoint, method Set access mode.
DELETE /api-routes — Reset permissions.

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 Either route is restricted or not.
endpoint string Access mode to a specific RESTful API endpoint.
id string Based64 encoded API route + method.
method string Access mode to specific HTTP verb.

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_api_routes. See Authentication and Error handling.

The id path parameter is AAM’s encoded route identifier. Fetch the collection first and use the returned ID.

Example

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

This lists REST routes and their access decisions for Editors.