API for Product Managers
HTTP Responses: Status Codes, Headers and JSON
In this lesson
You'll learn how to read what an API sends back: the status code, the headers and the body, which is usually in JSON.
The three parts of a response
Status code: Tells you whether the request worked.
Headers: Carry extra information about the response.
Body: Holds the actual data.
Status codes
Range | Meaning | Common examples |
|---|---|---|
2xx | Success | 200 OK, 201 Created |
3xx | Redirection | 301 Moved Permanently |
4xx | A problem with the request | 400 Bad Request, 401 Unauthorized, 404 Not Found |
5xx | A problem on the server | 500 Internal Server Error, 503 Service Unavailable |
Headers
Response headers describe the response itself, such as the format of the data (Content-Type) or how long it can be stored in a cache (Cache-Control).
JSON
Most modern APIs send data as JSON (JavaScript Object Notation), a simple text format made of keys and values.
Example
Here's a response body for an order, sent along with a 200 OK status code:
{
"order_id": 123,
"status": "shipped",
"delivery_date": "2026-12-01"
}
Even without coding, you can read it: order 123 has shipped and should arrive on 1 December.
Why this matters for you as a PM
Status codes help you understand bugs, since a 4xx usually points to the request and a 5xx points to the server.
Reading JSON lets you check what data an API returns before you design a feature around it.
Common mistakes to avoid
Treating every error the same, when 4xx and 5xx errors need different fixes.
Designing a screen around data you haven't confirmed the API returns.