Skip to content

424 Failed Dependency

Description

The 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. This status code is primarily used in WebDAV (Web Distributed Authoring and Versioning) environments.

This status code is commonly used when: - A client attempts an operation that depends on a previous operation that failed - A client attempts to modify a resource that depends on another resource that couldn't be modified - A complex transaction fails partially, causing dependent operations to fail - A chain of operations has a broken link that prevents subsequent operations from succeeding

The 424 Failed Dependency status helps clients understand that their request failed not because of an issue with the request itself, but because of a dependency that couldn't be satisfied.

Syntax

The server responds with a 424 Failed Dependency status:

HTTP/1.1 424 Failed Dependency
Content-Type: application/xml
Content-Length: [length in bytes]

<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV:">
  <d:failed-dependency/>
</d:error>

For non-WebDAV applications, a JSON response might be used:

HTTP/1.1 424 Failed Dependency
Content-Type: application/json
Content-Length: [length in bytes]

{
  "error": "Failed Dependency",
  "message": "The requested action failed because it relied on another action that failed"
}

Examples

WebDAV Collection Move Example

A client attempts to move a collection that contains a locked resource:

Client Request:

MOVE /collection HTTP/1.1
Host: webdav.example.com
Destination: /new-location
Overwrite: F

Server Response:

HTTP/1.1 424 Failed Dependency
Content-Type: application/xml
Content-Length: 423

<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV:">
  <d:failed-dependency/>
  <d:detail>
    <d:resource>
      <d:href>/collection/locked-document.docx</d:href>
      <d:status>HTTP/1.1 423 Locked</d:status>
      <d:error><d:lock-token-submitted/></d:error>
    </d:resource>
  </d:detail>
</d:error>

API Transaction Example

A client attempts an operation that is part of a larger transaction that partially failed:

Client Request:

POST /api/orders/123/finalize HTTP/1.1
Host: api.example.com
Content-Type: application/json
Content-Length: 45
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

{
  "send_confirmation_email": true
}

Server Response:

HTTP/1.1 424 Failed Dependency
Content-Type: application/json
Content-Length: 287

{
  "error": "Failed Dependency",
  "message": "Cannot finalize order because payment processing failed",
  "dependency": {
    "operation": "process_payment",
    "status": "failed",
    "error_code": "insufficient_funds",
    "transaction_id": "txn-789012"
  },
  "suggestion": "Update payment method and retry"
}

Microservice Architecture Example

A client request fails because a dependent microservice is unavailable:

Client Request:

POST /api/shipping/create-label HTTP/1.1
Host: services.example.com
Content-Type: application/json
Content-Length: 187
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

{
  "order_id": "order-456789",
  "shipping_method": "express",
  "package_dimensions": {
    "length": 30,
    "width": 20,
    "height": 10,
    "unit": "cm"
  },
  "weight": {
    "value": 2.5,
    "unit": "kg"
  }
}

Server Response:

HTTP/1.1 424 Failed Dependency
Content-Type: application/json
Content-Length: 243

{
  "error": "Failed Dependency",
  "message": "Cannot create shipping label because address validation service is unavailable",
  "dependency": {
    "service": "address-validation-service",
    "status": "unavailable",
    "retry_after": 300
  }
}

Summary

The 424 Failed Dependency status code is particularly valuable in complex systems where operations have dependencies on other operations or services. It provides clear feedback to clients that their request failed not because of an issue with the request itself, but because of a dependency that couldn't be satisfied. This status code is especially useful in distributed systems, microservice architectures, and WebDAV environments where operations often depend on the successful completion of other operations.