Troubleshooting
Practical debugging steps, self-test pointers, and what to capture.
Troubleshooting and self-test
This playbook helps you move from symptom to root cause quickly.
Always capture
Before you escalate, capture these details:
- Route and method
- Full HTTP status
meta.correlationId(orX-Correlation-Idresponse header)- Auth mode used (
cookie,Bearer, or API key) - Whether the request came from a browser (CORS/nonce checks apply)
First checks (90 seconds)
Run these checks in order:
GET /wp-json/headlesswp/v1/healthGET /wp-json/headlesswp/v1/config/appGET /wp-json/headlesswp/v1/nonce
If any of these fail, fix routing/platform basics first (permalinks, REST availability, SSL, and cache layers).
Common failures by status
401 (authentication)
Most common cause: missing, invalid, or expired credentials.
Check:
- Cookie auth: login succeeded and session cookies are present/sent
- Bearer auth:
Authorization: Bearer <token>is present and valid - API key auth:
Authorization: HeadlessWPProKey <token>is present and valid - Endpoint actually requires auth for that method
403 (forbidden)
A 403 usually means policy denial, not malformed JSON.
Check for common cases:
CSRF_FAILED: cookie/session flow missingX-WP-Nonceon a mutationSERVICE_ACCOUNT_SCOPE_DENIED: API key exists but required scope is missingTOKEN_AUTH_DISABLEDorAPI_KEY_AUTH_DISABLED: header sent for a disabled auth mode- Browser-blocked CORS request before WordPress receives it
413 (REQUEST_TOO_LARGE)
Payload exceeded configured request size limits.
Check:
- Payload size vs configured cap
- Whether large binary/blob data should use an upload-specific flow instead of JSON
429 (RATE_LIMITED)
Retry loops or bursty clients can trip endpoint rate limits.
Check:
- Client retry behavior includes backoff and jitter
- No accidental infinite retry integration
- Bucket sizing is appropriate for legitimate traffic
422 (validation)
Request body shape does not satisfy endpoint schema.
Check:
Content-Type: application/jsonfor JSON requests- Field-level details in the error payload
- Request shape against endpoint docs before retrying
CORS checklist
For browser-originated issues:
- Request
Originexactly matches a configured allowed origin - Preflight (
OPTIONS) includes expectedAccess-Control-*response headers - Site/app protocol mismatch (
httpvshttps) is not causing browser policy failures - Cookie-based calls use
fetch(..., { credentials: "include" })and compatible cookie policy
Nonce checklist
For cookie/session auth flows:
- Login first (session cookies must be present)
- Call
GET /wp-json/headlesswp/v1/nonce - Send
X-WP-Noncefor state-changing calls (POST,PATCH,DELETE)
If you are using API keys, nonce is not the mechanism. Verify auth mode selection and avoid mixing modes.
Self Test and Environment page
Use Admin → Self Test & Environment to validate environment wiring:
- Enabled/disabled auth modes
- Provider/dependency readiness
- Payment/webhook prerequisites (if relevant)
- Required database tables for logs/events/metrics
Use export/import to replicate known-good configuration between environments.
What to include in a support ticket
Site URL:
Environment: local / staging / production
Endpoint + method:
HTTP status:
Correlation ID:
Auth mode: cookie / bearer / api key
Request headers (redact secrets):
Request body (redact secrets):
Self Test export (if config-related):