Skip to the content.

📌 200 vs 201 vs 202 HTTP Status Codes

These codes are all 2xx Success responses, meaning the request was successful, but their meaning differs.


1️⃣ 200 OK

Definition:

The request was successful, and the response contains the requested data (for GET) or confirms the action (for POST/PUT/DELETE).

Key Points:

Example:


2️⃣ 201 Created

Definition:

The request was successful, and as a result, a new resource has been created.

Key Points:

Example:


3️⃣ 202 Accepted

Definition:

The request has been accepted for processing, but the processing is not complete yet.

Key Points:

Example:


4️⃣ Comparison Table

Status Code Meaning Typical Use Case Response Body / Headers
200 OK Request successful GET, PUT, DELETE Requested data or confirmation
201 Created Resource successfully created POST Location header with URL
202 Accepted Request accepted, processing pending Async operations, background jobs Status URL or info about progress

5️⃣ Analogy


💡 Key takeaway: