# 204 No Content

> https://http-status.org/docs/204

**Family:** 2xx Success

## Rationale

Request succeeded and there is no response content to send.

## In Plain Terms

Success. The server did what you asked, but there’s nothing useful to send back in the body.

## Description

The HTTP 204 No Content status code indicates that the server successfully fulfilled the request and there is no additional content to send in the response body.

## Server Perspective

### Usage
- Return 204 for successful deletes or updates when the representation is unnecessary
- Use headers for metadata such as validators or caching information
- DELETE requests that succeed without needing to return a representation
- PUT or PATCH requests that succeed but do not need to echo updated data
- Settings changes or control actions where headers are enough

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

### Common Headers
- ETag

### Body
- Do not include a response body in a 204 response

### Pitfalls
- Do not send body content with 204
- Do not use 204 when the API contract expects a representation or action result
- When the client needs a representation or action result in the body
- When creating a new resource and 201 Created communicates the contract better
- When a browser or client should reset its document view and 205 is the better signal

## Client Perspective

### Pitfalls
- Do not try to parse a response body from 204

## Examples

### Deleting a user account

The delete succeeded and the server does not need to send anything else back.

**Request:**
```
DELETE https://api.example.test/api/users/123
```

**Response:**
```
204 No Content
```

### Updating user preferences

The update succeeded, and any useful metadata can travel in headers without a response body.

**Request:**
```
PUT https://api.example.test/api/users/123/preferences
```

**Response:**
```
204 No Content
ETag: "prefs-v2"
```

## Related Codes

- [200 OK](/docs/200.md)
- [205 Reset Content](/docs/205.md)

