# 423 Locked

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

**Family:** 4xx Client Error

## Rationale

The resource is locked and cannot be accessed or modified (WebDAV).

## In Plain Terms

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.

## Description

The HTTP 423 Locked status code indicates that the resource that is being accessed is locked. The response should contain information about the lock in the response body.

## Server Perspective

### Usage
- 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

### Implementation
- 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

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

### Body
- WebDAV responses commonly include XML lock information to help the client recover

### 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)

## Client Perspective

### Pitfalls
- Do not treat 423 like a generic retry-immediately error

## Examples

### Attempting to edit locked document

Document is locked by another user for editing, modification denied

**Request:**
```
PUT https://api.example.test/documents/report.doc

Updated document content
```

**Response:**
```
423 Locked
Content-Type: application/json

{
  "error": "locked"
}
```

### WebDAV file system operation on locked resource

File is locked and requires proper lock token to perform operations

**Request:**
```
DELETE https://api.example.test/files/project/readme.txt
```

**Response:**
```
423 Locked
Content-Type: application/json

{
  "error": "locked"
}
```

## Related Codes

- [409 Conflict](/docs/409.md)
- [424 Failed Dependency](/docs/424.md)
- [428 Precondition Required](/docs/428.md)

