204

No Content

2xx Success

Back to list

Server perspective

Use 204 when the request succeeded and the client does not need a response body.

When to use

  • Return 204 for successful deletes or updates when the representation is unnecessary
  • Use headers for metadata such as validators or caching information

How to respond

  • Do not send a message body
  • Include metadata headers like ETag when they help the client understand the new state

Headers to consider

  • ETag

Response body

  • Do not include a response body in a 204 response

Server-side pitfalls

  • Do not send body content with 204
  • Do not use 204 when the API contract expects a representation or action result

Examples

Silent successful update

Request:PATCH /api/profile
Response:204 No Content

The server confirms success while keeping the response minimal.

References

Related 2xx Success Codes