A 401 usually means usable authentication is absent; a 403 means the server understood the request but refuses it. Plugins and proxies sometimes replace those meanings, so read the JSON error code and response path rather than status alone.
The reliable route is not the longest checklist; establish the failing boundary, keep one clean reproduction, and change one layer at a time until the evidence lets you separate authentication, capability, nonce, Authorization-header, security-plugin, and proxy failures in WordPress REST requests.
Read the failure at the right layer
- The request lacks a valid cookie/nonce or Application Password credentials.
- Apache or Nginx does not forward the Authorization header to PHP.
- A security plugin or custom rest_authentication_errors filter blocks the route or anonymous API.
The branches are ordered to protect the strongest evidence around this possibility: the request lacks a valid cookie/nonce or Application Password credentials. The observed scope and logs—not a familiar-looking error screen—decide which one applies.
Integration failures happen at custody boundaries; wordPress can format a request successfully while DNS, TLS, a proxy, remote service, authentication layer, or receiving provider rejects the next step; record what each boundary accepted—not just what the WordPress screen announced; in this guide, the practical goal is to separate authentication, capability, nonce, Authorization-header, security-plugin, and proxy failures in WordPress REST requests.
Build a clean diagnostic record
- Request
/wp-json/and the exact route withcurl -i; save status, JSON code, and headers. - Confirm route method, required capability, user, and authentication mechanism.
- Check whether Authorization reaches PHP using a safe diagnostic endpoint on staging.
- Review security/firewall logs before disabling protections.
The sequence moves from observation toward intervention. Preserve the result of the final check—review security/firewall logs before disabling protections—because it provides a useful comparison after the repair.
One practical branch through the failure
Treat “The request lacks a valid cookie/nonce or Application Password credentials” as a working hypothesis, not a conclusion. Establish a baseline first: request /wp-json/ and the exact route with curl -i; save status, JSON code, and headers. Record both the result you expected and the result you actually saw.
A supporting result justifies a staging test of the narrowest repair: use the authentication method appropriate to the client and HTTPS transport. A result that contradicts “The request lacks a valid cookie/nonce or Application Password credentials” is useful too: it rules out one layer without disturbing production and gives the next operator a clean starting point.
Repair the cause—not the message
- Use the authentication method appropriate to the client and HTTPS transport.
- Forward Authorization using the official Apache/Nginx guidance.
- Narrow custom restrictions so WordPress admin functions and intended public endpoints still work.
Before applying “Use the authentication method appropriate to the client and HTTPS transport,” name its rollback point and the evidence that will count as success. Afterward, repeat the original request and specifically check whether you can test unauthenticated, authorized, and insufficient-role requests; each should return the intended result; a changed symptom at that point is new evidence, not permission to make several more changes at once.
Compare public discovery with the failing REST route
The index should normally be public. Save both the HTTP status and the JSON error code from the exact method and route that fails.
curl -sS -i https://example.com/wp-json/
curl -sS -i https://example.com/wp-json/wp/v2/types
curl -sS -i -X OPTIONS https://example.com/wp-json/your-namespace/v1/route
Interpretation and safety: Do not place Application Passwords in URLs or publish Authorization headers. Test authenticated requests from a protected client after the public boundary is understood.
Verification checklist
- Test unauthenticated, authorized, and insufficient-role requests; each should return the intended result.
- Confirm editor functions that depend on REST still work.
- Remove diagnostic endpoints and secrets.
One successful refresh is not closure. Keep the incident open until you can also confirm editor functions that depend on REST still work, adjacent paths have not regressed, temporary diagnostics are gone, and another operator can explain what changed.
Prepare a useful escalation if the boundary is outside your control
A useful escalation contains the UTC timestamp, destination host or route, sanitized request/response headers, status and application error code, correlation ID, retry behavior, and the source IP when relevant; never send live credentials in a ticket; include the result of this first observation: request /wp-json/ and the exact route with curl -i; save status, JSON code, and headers.
State what was tested, including the result of “Request `/wp-json/` and the exact route with `curl -i`; save status, JSON code, and headers,” and what changed between attempts; evidence tied to that observation is safer and more actionable than granting broad access or sending an unnecessary full database export.
Tempting moves to avoid
- WordPress documentation warns that disabling the REST API breaks admin features.
- Do not place Application Passwords in URLs or front-end JavaScript.
Change record
Primary references
- WordPress REST API FAQ — official reference consulted for this guide.
- REST API handbook — official reference consulted for this guide.
Editorial note: The scenario above illustrates how to approach “Use the authentication method appropriate to the client and HTTPS transport”; it is a documented example, not a claim about a reader’s server, so verify the cited documentation, take the appropriate backup, and follow the real environment’s access and change-control rules.