423 Locked means the resource being accessed is locked (a WebDAV lock), so the request cannot proceed. WebDAV provides an explicit LOCK mechanism so collaborators do not overwrite each other's edits to the same file.
When one user has locked a file and another tries to write to it (PUT/DELETE/MOVE) without a valid lock token, the server returns 423. It mainly appears in document-collaboration setups (Microsoft Office, Nextcloud, ownCloud).
PUT /docs/report.docx HTTP/1.1
Host: dav.example.com
Content-Type: application/octet-stream
<file body>HTTP/1.1 423 Locked
Content-Type: application/xml
<?xml version="1.0"?>
<D:error xmlns:D="DAV:"><D:lock-token-submitted/></D:error>app.put('/docs/:name', (req, res) => {
const lock = locks.get(req.params.name);
if (lock && lock.token !== req.headers['if']) {
return res.status(423).type('xml')
.send('<D:error xmlns:D="DAV:"><D:lock-token-submitted/></D:error>');
}
// write the file...
});# Supply the lock token in the If header to edit a locked WebDAV resource
curl -X PUT https://dav.example.com/docs/report.docx \
-H 'If: (<urn:uuid:lock-token-here>)' \
--data-binary @report.docx