API Error Response Explainer and Debug Checklist
Paste an API status code, JSON error body, response headers, endpoint, or raw error text and turn it into a plain-English debugging report. This browser-based tool helps you understand common API failures such as 400, 401, 403, 404, 422, 429, 500, 502, and 503 without sending your data to a server.
- Decode common HTTP status meanings.
- Extract useful fields from JSON error bodies.
- Find hints in headers such as retry limits.
- Create a clean checklist before asking for help.
Paste your API error response
Enter whatever you have: a status code, JSON response body, raw text, response headers, request method, or endpoint URL. The tool uses client-side checks to generate a practical debugging summary.
Your API debugging report will appear here. Paste a status code, response body, or headers, then click Analyze Error.
What this API error explainer does
An API error response often contains the answer, but it is not always written for beginners. A failed request may show a short status code such as 401, a JSON body with a vague message, an HTML error page from a proxy, or a group of headers that only make sense after you know what to look for. This tool takes the pieces you already have and turns them into a practical debugging report. It looks at the HTTP status code, request method, endpoint URL, response headers, body format, and common error words such as unauthorized, forbidden, validation, expired, malformed, rate limit, timeout, not found, and internal server error.
The goal is not to magically fix every API problem. The goal is to help you slow down and check the right things in the right order. A 401 error usually points toward authentication. A 403 error means the server understood the request but rejected access. A 422 response often means the server received your JSON but rejected one or more fields. A 429 response usually means the client is being rate limited. A 500 level response is more likely to be a server-side failure, but the client can still check whether the request body, headers, endpoint, or account state triggered the issue.
This is especially useful when you are debugging with Postman, building a JavaScript frontend, connecting a WordPress site to an external API, testing a webhook, fixing a student project, or preparing an issue report for a teammate. Instead of sending someone a messy screenshot and saying “API not working,” you can copy a clean report that includes the likely meaning, first checks, and safer next steps.
How to use the tool correctly
Start with the status code if you have one. The status code gives the fastest clue because it tells you which broad category the error belongs to. A 400 level error usually means the request is not acceptable from the client side. A 500 level error usually means the server or upstream service failed while handling the request. After that, paste the response body. If the body is JSON, the tool will try to parse it and extract common fields such as error, message, detail, errors, code, title, traceId, and requestId.
Next, add response headers when available. Headers can reveal important clues that are not visible in the body. For example, retry-after may tell you how long to wait after a 429 error. www-authenticate may show the authentication scheme expected by the API. content-type can explain why a JSON parser failed when the server actually returned an HTML error page. Rate limit headers can explain why a request worked five minutes ago but is now blocked.
If the endpoint contains query parameters, check whether the URL values are encoded correctly. Spaces, ampersands, equal signs, slashes, and special characters can break an endpoint when they are pasted directly into a query string. For that situation, the CodeZips URL Encoder and Decoder can help you inspect or prepare encoded URL values before testing again. If your API error appears inside a WordPress article, HTML page, or documentation block and special characters are displaying incorrectly, use the CodeZips HTML Entity Encoder and Decoder to display examples safely instead of letting the browser interpret them as markup.
Common API error patterns explained
| Status or pattern | What it usually means | What to check first |
|---|---|---|
| 400 Bad Request | The server could not accept the request format, syntax, parameter value, or body structure. | Check malformed JSON, wrong field names, invalid query parameters, missing required fields, and incorrect content type. |
| 401 Unauthorized | The request needs authentication, or the provided token, key, session, or signature is missing or invalid. | Check bearer token, API key placement, expired tokens, login session, environment variables, and authorization header format. |
| 403 Forbidden | The server understood the request but the authenticated user, token, app, role, or origin is not allowed. | Check account permissions, plan limits, API scopes, organization access, IP restrictions, and origin restrictions. |
| 404 Not Found | The endpoint, resource ID, route, version, or environment URL is wrong or unavailable. | Check base URL, API version, route spelling, resource ID, staging vs production environment, and deleted resources. |
| 409 Conflict | The request conflicts with the current state of the resource. | Check duplicate records, already completed actions, version conflicts, idempotency keys, and repeated webhook processing. |
| 422 Validation Error | The server understood the request but rejected one or more fields. | Check required fields, date formats, enum values, nested object shape, array format, and field-level error messages. |
| 429 Too Many Requests | The client has hit a rate limit or abuse protection rule. | Check retry-after headers, request frequency, batch size, background jobs, loops, and duplicate retries. |
| 500, 502, 503, 504 | The server, gateway, upstream service, deployment, or timeout path failed. | Retry carefully, check provider status, inspect logs, reduce payload size, confirm the request is valid, and capture request IDs. |
The important thing is to avoid treating every API failure the same way. Re-sending the same failed request repeatedly is rarely the best first step. If the error is a 401, refreshing the token is more useful than changing the JSON body. If the error is a 422, changing the token will not fix a missing email field. If the error is a 429, aggressive retries can make the problem worse. If the error is a 500, you may need server logs or provider support, but a clean report with request ID, endpoint, method, timestamp, and sanitized body can save a lot of time.
Example API error response
Here is a common validation-style response. The request reached the API and the JSON was readable, but the server rejected the submitted fields:
{
"error": "Validation failed",
"message": "The request body contains invalid fields.",
"errors": {
"email": "A valid email address is required.",
"plan": "Plan must be one of free, pro, or business."
},
"status": 422
}
For this kind of error, the fix is usually not in the server URL or API key. The useful move is to inspect the field-level errors and compare your request body against the API documentation. Check whether the API expects email or emailAddress, whether enum values are case-sensitive, whether the JSON body is nested correctly, and whether the content-type header is set to application/json. Many beginners waste time changing the endpoint when the real issue is one invalid field inside the payload.
Before asking for help, collect these details
- The HTTP method and endpoint path, with private hostnames or secrets removed if needed.
- The status code and exact error message.
- The sanitized request body or query parameters.
- The response headers that mention content type, authentication, retry timing, request ID, or rate limit.
- The environment where it failed, such as browser, Postman, backend server, WordPress plugin, mobile app, or webhook.
- What already worked before, such as a successful request to a different endpoint or the same request in another environment.
API debugging workflow for beginners
A calm debugging workflow is better than random guessing. First, confirm whether the request is reaching the API at all. A browser CORS error, local network error, DNS failure, or mixed-content issue may mean your application never received a normal API response. Second, confirm the status code. Third, read the body and headers together. Fourth, isolate the smallest request that reproduces the error. If a full checkout request fails, try a simpler read request. If a complex filter fails, remove optional parameters and add them back one by one.
For authentication problems, test with the simplest endpoint that requires the same token. If that fails too, the problem is probably the token, key, scope, account, or environment. For validation problems, copy the exact request body and compare it to the documented schema. For rate limits, stop automatic retries before testing more. For server errors, capture request IDs and timestamps because the provider or backend team may need those values to search logs.
In WordPress or PHP projects, also check whether the hosting environment blocks outbound requests, whether SSL verification is failing, whether the API key is stored correctly, and whether a plugin is changing headers. In frontend browser apps, check the Network tab instead of only reading the console. The Network tab shows the method, URL, status, headers, request payload, and response body in one place, which is often enough to find the real issue.
Common mistakes that make API errors harder to solve
Only reading the message and ignoring the status code
An error message can be vague, translated, customized, or reused across multiple failures. The status code gives you the category. “Request failed” with a 401 is very different from “Request failed” with a 500. Always save the status code before changing code.
Sending JSON without the right content type
Many APIs expect content-type: application/json when you send a JSON body. If you send JSON text with a form content type, the server may treat the body as missing or malformed. This often creates 400 or 422 errors that look confusing until you inspect the headers.
Confusing 401 and 403
A 401 often means the API does not accept your authentication. A 403 usually means the API recognizes the request but refuses permission. With 403 errors, check scopes, roles, plan restrictions, account ownership, allowed origins, IP allowlists, and organization membership. Generating a new token may not fix a permission issue if the new token has the same limited scope.
Testing production and staging with mixed credentials
It is common to call a production endpoint with a sandbox token, or a sandbox endpoint with a production token. The error may look like invalid key, not found, forbidden, or unauthorized depending on the provider. Always confirm the base URL, environment, account, and key belong together.
Sharing screenshots instead of text
Screenshots are difficult to search, copy, sanitize, or compare. A clean text report with status code, endpoint path, headers, and error body is much more useful. Use this tool to generate a report, then remove anything sensitive before sharing it.
Troubleshooting when the error response is confusing
If the response body is empty, do not assume the API returned nothing useful. Check the status code and headers first. Some APIs return useful details in headers, while some proxies return an empty body for blocked requests. If the body looks like a full HTML page instead of JSON, the request may be hitting a web server, CDN, firewall, login page, or wrong route instead of the expected API endpoint. In that case, inspect the final URL and confirm whether a redirect happened.
If your frontend says “CORS error,” remember that the browser may hide the real response from JavaScript. Open the Network tab and inspect the request directly. If the same request works in Postman but fails in the browser, the API may not allow your site origin, may not respond to preflight requests, or may require server-side proxying. If the same request works locally but fails on hosting, compare environment variables, server IP restrictions, SSL settings, and outgoing network rules.
If you see a request ID, trace ID, correlation ID, or similar value, save it. That value can help the API provider or backend team find the exact request in logs. A message like “Internal server error” is not enough for a support ticket, but “POST /v1/orders returned 500 at 2026-06-16 14:22 with request ID abc123” is much easier to investigate.
When to use this tool vs related tools
FAQ
Does this tool send my API error response to a server?
No. The tool is designed to run in your browser with client-side JavaScript. Your pasted status code, headers, endpoint, and response body are processed on the page. You should still remove secrets before copying the final report anywhere else.
Can this tool fix my API error automatically?
No. It explains likely causes and gives you a checklist. Some API problems require server logs, provider documentation, account permissions, valid credentials, or backend code changes. The tool helps you narrow the problem instead of guessing randomly.
Why does a 401 API error happen?
A 401 response usually means the API request is missing valid authentication. Check the authorization header, bearer token, API key, token expiry, login session, environment variables, and whether the key belongs to the same environment as the endpoint.
What is the difference between 401 and 403?
A 401 usually means authentication is missing or invalid. A 403 usually means the server understood who you are but refuses access. For 403, check permissions, scopes, roles, IP restrictions, plan limits, origin rules, or organization access.
Why does an API return 422 validation error?
A 422 error usually means the server could read the request but rejected one or more fields. Check required fields, field names, nested JSON structure, enum values, date formats, array format, and field-level error messages inside the response body.
What should I do after a 429 rate limit error?
Stop rapid retries, check for a retry-after header, reduce request frequency, batch requests safely, and look for loops or repeated background jobs. Retrying too aggressively can extend the rate limit or make debugging harder.
Why does my API return HTML instead of JSON?
An HTML response may mean you reached a website page, login page, CDN block page, firewall page, redirect, or wrong route instead of the expected API endpoint. Check the final URL, redirects, content type header, base URL, and environment.
What information should I include in an API support ticket?
Include the sanitized method, endpoint path, status code, error body, important headers, timestamp, request ID or trace ID, environment, and steps to reproduce. Do not include private tokens, passwords, cookies, customer data, or full secret URLs.
Final practical note
The fastest API debugging usually comes from matching the error category to the right next action. Authentication errors need credential checks. Permission errors need scope and role checks. Validation errors need request body checks. Rate limit errors need retry discipline. Server errors need logs, request IDs, and careful reproduction. Use this tool to create a cleaner first pass, then compare the result with the official API documentation and your own request history.

