# 424 Failed Dependency

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

**Family:** 4xx Client Error

## Rationale

The request failed due to failure of a previous request in the same transaction (WebDAV).

## In Plain Terms

I couldn't do what you asked because something else you wanted me to do first didn't work out. It's like a domino effect - one failure caused this one.

## Description

The HTTP 424 Failed Dependency status code indicates that the method could not be performed on the resource because the requested action depended on another action and that action failed.

## Server Perspective

### Usage
- Return 424 when one command in a compound request depends on another command that already failed
- Use it to explain cascading failure in dependency-aware operations
- WebDAV transaction failures with dependencies
- Multi-step operations where earlier steps failed
- Atomic operations that must succeed or fail together
- File system operations with prerequisite failures
- Batch operations with interdependent steps

### Implementation
- Identify the failed prerequisite action clearly in the response body
- Keep the dependency chain understandable so clients know which step actually broke first

### 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 typically describe the original failed dependency in XML details

### Pitfalls
- Do not use 424 as a vague batch-failure shortcut without identifying the broken dependency
- Do not use it for standalone requests with no real prerequisite action
- Single operation failures (use appropriate 4xx/5xx codes)
- Independent operation failures (use 207 Multi-Status)
- Non-WebDAV APIs (use appropriate error codes)
- Simple validation errors (use 422 Unprocessable Content)

## Client Perspective

### Pitfalls
- Do not debug 424 in isolation from the original failing operation

## Examples

### PROPPATCH with failed lock dependency

A PROPPATCH request to update resource properties fails because the preceding LOCK operation it depended on was denied, making the property update impossible.

**Request:**
```
PROPPATCH https://api.example.test/documents/report.doc
Content-Type: application/xml

<?xml version="1.0"?>
<D:propertyupdate xmlns:D="DAV:">
  <D:set><D:prop><D:displayname>Q4 Report</D:displayname></D:prop></D:set>
</D:propertyupdate>
```

**Response:**
```
424 Failed Dependency
Content-Type: application/xml

<?xml version="1.0"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/documents/report.doc</D:href>
    <D:status>HTTP/1.1 424 Failed Dependency</D:status>
  </D:response>
</D:multistatus>
```

### Atomic file system operation

Property update failed because the file move operation it depended on failed

**Request:**
```
MOVE https://api.example.test/resource
```

**Response:**
```
424 Failed Dependency
Content-Type: application/json

{
  "error": "failed_dependency"
}
```

## Related Codes

- [423 Locked](/docs/423.md)
- [409 Conflict](/docs/409.md)
- [422 Unprocessable Content](/docs/422.md)

