DevKits
200

OK

2xx Success

Last updated:

The request succeeded. The response body contains the requested representation.

Description

The default success code. For GET, the response contains the resource. For POST/PUT, it usually contains the outcome. For DELETE, some APIs return 200 with a body, though 204 is often more appropriate.

When to use

Return 200 for successful reads and successful writes that return a body.

Common pitfalls

Do not return 200 with an error payload — clients will treat it as success. Use a 4xx or 5xx code instead.

Specification

RFC 9110 §15.3.1

Examples

HTTP response
HTTP/1.1 200 OK
Content-Type: application/json

{"ok":true}
Node.js (Express)
res.status(200).json({ error: "OK" });
Go (net/http)
w.WriteHeader(http.StatusOK)
Python (Flask)
return jsonify({"error": "OK"}), 200

Related status codes

All 2xx codes