| Status code | 200 |
|---|---|
| Status text | OK |
| Category | 2xx Success |
| Response has body | Usually |
| Specification | RFC 9110 |
What does 200 OK mean?
The request succeeded and the response body contains the result. It belongs to the 2xx Success class, which means the request was received, understood and accepted.
When do APIs return 200?
The standard success response for GET, and for PUT, PATCH or DELETE when the server returns a representation.
How to fix a 200 OK
Nothing to fix. If you get 200 but the body is not what you expected, check the Content-Type response header and whether you hit the right environment.
Reproduce a 200 response
The fastest way to understand a status code is to trigger one and read the full response. Open the
API tester and send a request to https://httpbin.org/status/200 — you will
see the 200 status along with every response header the server sent. Comparing those headers against
a working request is often what reveals the cause.
When you are debugging a real endpoint, check the response headers as carefully as the body, and confirm you are using the right HTTP method for the operation.
Related 2xx status codes
201 Created
The request succeeded and a new resource was created as a result.
202 Accepted
The request was accepted for processing, but the processing has not finished.
204 No Content
The request succeeded and there is deliberately no response body.
206 Partial Content
The server is delivering only part of the resource, as requested by a Range header.
200 OK FAQ
Does 200 OK mean the request did what I wanted?
Not necessarily. It means the server handled the request and is returning a representation. Some APIs, GraphQL in particular, return 200 with an error described in the body, so check the body as well as the status.
What is the difference between 200 and 201?
201 Created says a new resource now exists and normally includes a Location header pointing to it. 200 says the request succeeded without making that claim. A POST that creates something should answer 201.
Should a successful DELETE return 200 or 204?
Either is correct. Use 204 No Content when there is nothing to send back, and 200 when the response includes a body such as the deleted record or a status message.
See also
- 201 Created — The request succeeded and a new resource was created as a result.
- 204 No Content — The request succeeded and there is deliberately no response body.
References
- RFC 9110, 200 OK — The specification that defines this status code.
- MDN: 200 OK — MDN's reference page for this status code.