6 min read2026-05-09

How to debug API JSON responses

A developer workflow for inspecting API JSON responses, status fields, error objects, timestamps, IDs, and nested payloads.

Start with the response shape

When an API response looks wrong, do not jump straight to business logic. First inspect the response shape. Format the JSON, identify the top-level status or error object, and find the nested area that changed. Many bugs become obvious once the response is readable.

Check whether the response contains an error code, message, trace ID, validation details, pagination metadata, or an empty data array. These fields often explain the failure before you need server logs.

Compare headers, body, and status

A JSON body does not tell the whole story. The HTTP status code, content type, cache headers, authorization behavior, and correlation ID are part of the same debugging picture. A 200 response with an error object is different from a 401, 403, 409, or 500 response.

If a response works in one client but fails in another, compare request headers and query parameters. Authentication, content negotiation, locale, tenant, and cache headers are frequent causes of inconsistent results.

Turn the response into a useful note

A good bug note includes the endpoint, method, status code, sanitized request input, formatted response, timestamp, environment, and correlation ID if available. Remove tokens, personal data, account numbers, and internal URLs before sharing.

For repeatable cases, save a compact fixture for tests and a formatted version for review. The fixture helps automation, while the formatted version helps humans understand the failure quickly.

Related tools

Browse all developer tools

Related workflows