200

HTTP 200 OK

2xx Success

2xx Success RFC 7231, Section 6.3.1

What is HTTP 200 OK?

The 200 (OK) status code is the standard response for successful HTTP requests. The response body depends on the request method: GET returns the requested resource; POST returns the result of the action; PUT returns the updated resource; DELETE often returns an empty body. This is the most common status code and indicates that everything worked as expected.

Common Use Cases

  • Successful page load
  • API returning requested data
  • Form submission success
  • File download

Usage Example

When building a REST API, return 200 OK for successful GET requests that return data, or for POST/PUT requests where the server returns the modified resource in the body. For DELETE operations, prefer 204 No Content over 200 with an empty body.

// Laravel - returning 200 OK
return response()->json([
    'user' => $user,
    'posts' => $posts,
]); // Returns 200 by default

Common Mistakes

⚠️

Mistake: Returning 200 for creation requests instead of 201 Created

Fix: Use 201 Created for POST requests that create a new resource. Include a Location header pointing to the new resource URL. Reserve 200 for operations that return data without creating new resources.

⚠️

Mistake: Returning 200 with a body for DELETE operations instead of 204

Fix: For successful DELETE requests, return 204 No Content with an empty body. If you need to return a confirmation message, use 200 OK but consider whether a 202 Accepted might be more appropriate.

⚠️

Mistake: Returning 200 for validation errors instead of 422 or 400

Fix: Do not return 200 with error messages in the body for failed validation. Use 422 Unprocessable Content for validation failures and 400 Bad Request for malformed input to make error handling consistent for API clients.

Last updated: 21 Jun 2026