📚 Quick Definition
The server has successfully fulfilled the request and there is no additional content to send in the response. The response has no body. This status code is ideal for operations where the client does not need any data back, such as deleting a resource or saving a setting.
⏱ When It Occurs
A 204 No Content response is returned when the server has processed the request successfully but intentionally has nothing to return in the response body. The operation completed, but the server determined that no content needs to be sent back to the client. The client's current view does not need to change.
🛠 Common Use Cases
- DELETE operation successfully removing a resource
- PUT/PATCH update that doesn't need to return the updated data
- Form submission with no display change needed on the page
- Auto-save operations where the UI doesn't need confirmation data
- Toggle or switch actions (e.g., mark as read, favorite)
- Acknowledgment endpoints (e.g., webhook receivers, heartbeats)
✅ Best Practices
- Never include a response body with a 204 - clients may ignore or reject it
- Use 204 for DELETE operations where you don't need to return the deleted resource
- Common for fire-and-forget API patterns where the client just needs a success signal
- Headers can still be sent with 204 (e.g., Cache-Control, ETag for caching)
- Consider using 200 instead if the client needs confirmation data or the updated resource
📡 HTTP Example
DELETE /api/users/123 HTTP/1.1 Host: api.example.com Authorization: Bearer eyJhbGci...
HTTP/1.1 204 No Content Date: Thu, 20 Feb 2026 10:30:00 GMT (no body)