Access denied redirect

Overview

Read or change the fallback response used when AAM denies access. Routes use /wp-json/aam/v2 on a standard WordPress installation.

Endpoints

Method Route Input Purpose
GET /redirect/access-denied area Get redirect.
POST /redirect/access-denied area, type, http_status_code, redirect_page_id, redirect_page_slug, redirect_url, callback, message Set redirect.
DELETE /redirect/access-denied area Reset redirect.

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.

Parameter guide

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

Parameter Type Meaning
area string Access area (frontend, backend or api).
callback string Custom callback function.
http_status_code number HTTP Status Code.
message string Custom access denied message.
redirect_page_id number Existing page ID to redirect to.
redirect_page_slug string Existing page slug to redirect to.
redirect_url string Valid URL to redirect to.
type string Redirect type.

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

Example

GET /wp-json/aam/v2/redirect/access-denied?access_level=visitor&area=frontend
Authorization: Basic <base64 username:application-password>

This reads the frontend access-denied response configured for visitors.