423

Locked

4xx Client Error

ELI5

This file is currently being edited by someone else and they've locked it. You'll have to wait until they're done or unlock it.

Server perspective

Use 423 in WebDAV-style locking systems when the resource is currently locked and the request cannot proceed.

When to use

  • Return 423 when a lock blocks access or modification of the resource
  • Use it in WebDAV or similar lock-aware systems where exclusive access is part of the contract
  • WebDAV resources that are currently locked
  • File editing conflicts where exclusive access is required
  • Collaborative editing systems with file locking
  • Document management systems preventing concurrent edits
  • Version control operations requiring exclusive access

How to respond

  • Include lock details in the response body when the protocol expects them
  • Explain how the client can refresh, release, or wait for the lock when that is supported

Headers to consider

  • No status-specific header is required; still send normal HTTP metadata such as Content-Type, caching, or tracing headers when they help the client.

Response body

  • WebDAV responses commonly include XML lock information to help the client recover

Server-side pitfalls

  • Do not use 423 as a generic permission error
  • Do not use it outside clients that understand your locking model
  • General resource conflicts (use 409 Conflict)
  • Authorization issues (use 403 Forbidden)
  • Resources that don't support locking
  • Non-WebDAV APIs (use appropriate alternative codes)

Examples

Attempting to edit locked document

Request:PUT https://api.example.test/documents/report.doc # Body Updated document content
Response:423 Locked # Headers Content-Type: application/json # Body { "error": "locked" }

Document is locked by another user for editing, modification denied

WebDAV file system operation on locked resource

Request:DELETE https://api.example.test/files/project/readme.txt
Response:423 Locked # Headers Content-Type: application/json # Body { "error": "locked" }

File is locked and requires proper lock token to perform operations

References

Related Status Codes