HTTP 423 Locked is a WebDAV extension (RFC 4918) indicating the source or destination resource is locked. In WebDAV, users lock resources for exclusive editing — other users attempting to modify a locked resource receive 423. The concept extends to any system with pessimistic locking: database records, document editing, configuration management. The response should indicate who holds the lock and when it expires.
Response includes the status code, standard headers (including Content-Type), and a small diagnostic JSON body describing the request and returned status.
Simulator URL (copy in the app after load — not a normal link):
https://httpstatus.com/api/status/423
Example request:
curl -i "https://httpstatus.com/api/status/423"The resource that is being accessed is locked.
On this code, Inspector focuses on semantics, headers, and correctness warnings that commonly affect clients and caches.
HTTP 423 Locked has specific technical implications for API design, caching, and client behavior. Understanding the precise semantics helps distinguish it from similar status codes and implement correct error handling. The response should include a descriptive body following a consistent error schema (like RFC 7807 Problem Details) so clients can programmatically handle the error.
// Handle 423 Locked in Express
app.use((err, req, res, next) => {
if (err.status === 423) {
return res.status(423).json({
type: 'https://api.example.com/errors/locked',
title: 'Locked',
status: 423,
detail: err.message
});
}
next(err);
});from fastapi import HTTPException
# Raise 423 Locked
raise HTTPException(
status_code=423,
detail={
'type': 'locked',
'message': 'Descriptive error for 423 Locked'
}
)// Spring Boot 423 Locked handling
@ExceptionHandler(CustomLockedException.class)
public ResponseEntity<ErrorResponse> handleLocked(
CustomLockedException ex) {
return ResponseEntity.status(423)
.body(new ErrorResponse("Locked", ex.getMessage()));
}// Return 423 Locked
func errorHandler(w http.ResponseWriter, message string) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(423)
json.NewEncoder(w).Encode(map[string]any{
"status": 423,
"error": "Locked",
"message": message,
})
}