Success · 2xx

200 OK

The request succeeded. The response body contains whatever the request was for.

What 200 OK means

200 OK is the most common status code on the web. It means the request was understood, processed successfully, and the response body contains the requested representation. For GET requests, the body is the resource. For POST that returns a result, the body is the result. For HEAD requests, 200 is returned with no body, just the headers.

When servers should return it: Servers return 200 for any successful request that returns content. If you would otherwise return 200 with no body, consider 204 No Content instead, which is more semantically correct.

Example response

curl -i https://api.example.com/users/42

HTTP/2 200
content-type: application/json
{"id":42,"name":"Ada"}

Related status codes

Frequently Asked Questions

Is 200 always JSON?
No. 200 is the status, the body type is whatever Content-Type says: HTML, JSON, image, plain text, or anything else.
Can a POST return 200?
Yes. 201 is preferred when a new resource was created at a specific URL. 200 is appropriate when the POST returns a result (a search query, an action result) without creating a new addressable resource.
What is the difference between 200 and 204?
200 has a response body. 204 explicitly has no body. Use 204 for DELETE confirmations and PUT updates that do not return content.
Defined in: RFC 9110 · Class: 2xx Success

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.