Skip to main content
2xx Success

207 Multi-Status

Conveys information about multiple resources in situations where multiple status codes might be appropriate.

Meaning & Description

The HTTP `207 Multi-Status` response code provides status for multiple independent operations. It is a WebDAV extension (RFC 4918).

The response body is typically an XML document containing a `multistatus` root element. This allows a server to return a mixture of success and error status codes for a batch operation. For instance, if a client tries to move a directory containing multiple files, some files might move successfully (`201 Created` or `204 No Content`) while others fail (`403 Forbidden`). A `207` bundles these distinct outcomes into one response.

Common Causes

  • A valid WebDAV `PROPFIND`, `PROPPATCH`, `COPY`, or `MOVE` method was executed against a collection of resources.

How to fix a 207 error

  1. Parse the XML body to identify exactly which sub-requests succeeded and which failed.
  2. Look for the `<d:status>` elements nested within each `<d:response>` block in the XML payload.
  3. Check if your XML parser handles namespaces properly, as WebDAV makes heavy use of the `DAV:` namespace.

Browser & SEO Behaviour

Browser Behavior

Browsers typically do not encounter this code unless specifically interacting with WebDAV services via JavaScript, in which case the Fetch/XHR receives the XML payload.

SEO Impact

None. Search engine bots typically execute GET/HEAD requests and do not speak WebDAV or trigger 207 Multi-Status responses.

Code Examples

Raw HTTP
PROPFIND /collection HTTP/1.1
Host: example.com
Depth: 1
Content-Type: application/xml

<?xml version="1.0" encoding="utf-8" ?>
<propfind xmlns="DAV:">
  <propname/>
</propfind>
Node.js (Express)
app.all('/webdav/*', (req, res) => {
  if (req.method === 'PROPFIND') {
    const xmlResponse = `<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/webdav/file1.txt</D:href>
    <D:propstat>
      <D:prop><D:displayname>file1.txt</D:displayname></D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>`;
    
    res.set('Content-Type', 'application/xml; charset=utf-8');
    return res.status(207).send(xmlResponse);
  }
  res.status(405).send('Method Not Allowed');
});
Python (FastAPI)
from fastapi import Request, Response

@app.route("/webdav/dir", methods=["PROPFIND"])
def propfind(request: Request):
    xml_body = """<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/webdav/dir/item1.txt</D:href>
    <D:propstat>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>"""
    
    return Response(
        content=xml_body,
        status_code=207,
        media_type="application/xml"
    )
Go (net/http)
func handlePropfind(w http.ResponseWriter, r *http.Request) {
    if r.Method != "PROPFIND" {
        http.Error(w, "Method Not Allowed", 405)
        return
    }
    
    w.Header().Set("Content-Type", "application/xml; charset=utf-8")
    w.WriteHeader(207)
    
    xml := `<?xml version="1.0" encoding="utf-8" ?>
<d:multistatus xmlns:d="DAV:">
  <d:response>
    <d:href>/doc</d:href>
    <d:status>HTTP/1.1 200 OK</d:status>
  </d:response>
</d:multistatus>`
    
    w.Write([]byte(xml))
}
curl
curl -X PROPFIND http://example.com/webdav/ \n  -H "Depth: 1" \n  -H "Content-Type: application/xml" \n  -d '<?xml version="1.0"?><d:propfind xmlns:d="DAV:"><d:propname/></d:propfind>'

Raw HTTP Response Example

HTTP Response
HTTP/1.1 207 Multi-Status
Date: Tue, 04 Oct 2026 12:00:00 GMT
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/docs/file1.txt</D:href>
    <D:propstat>
      <D:prop><D:displayname/></D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>/docs/secret.txt</D:href>
    <D:propstat>
      <D:prop><D:displayname/></D:prop>
      <D:status>HTTP/1.1 403 Forbidden</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>

Real-world Examples

Microsoft SharePoint: Extensively uses WebDAV (and therefore 207 Multi-Status) for mapping network drives to document libraries.
Nextcloud: Uses WebDAV and CalDAV/CardDAV protocols to sync files, calendars, and contacts across devices, relying heavily on 207 responses for bulk syncs.
Apple iCloud: Utilizes CalDAV and CardDAV which use 207 Multi-Status to synchronize events and address books in batches.

Frequently Asked Questions

Is 207 Multi-Status used in standard REST APIs?

Generally, no. It is part of the WebDAV extension to HTTP. While some standard REST APIs borrow the concept for batch operations, it is technically non-standard for JSON payloads; the RFC strictly defines the body as XML.

What HTTP methods return a 207 Multi-Status?

It is mostly returned by WebDAV-specific methods like `PROPFIND`, `PROPPATCH`, `COPY`, `MOVE`, `LOCK`, and `MKCOL`. It is exceedingly rare to see a 207 in response to a standard `GET` or `POST`.

How do I parse a 207 Multi-Status response?

You must parse the XML body looking for the `<multistatus>` root element, then iterate through each `<response>` child to find the specific `<href>` (the resource) and `<status>` (the HTTP status for that specific resource).

Can a 207 response indicate a total failure?

Yes. A 207 response might contain an XML payload where every single nested resource failed (e.g., all returning `403 Forbidden`). The top-level HTTP request succeeded in processing the batch, but the individual operations failed.

Is it safe to return JSON instead of XML with a 207?

While strictly against RFC 4918, some modern, non-WebDAV APIs use 207 with a JSON payload to return batch operation results. Be aware that standard WebDAV clients will fail if they receive JSON.

Did You Know?

WebDAV essentially turns HTTP into a networked file system, which is why batch operations and 207 Multi-Status codes were invented.

Status code 207 is the only 2xx success code where the overall request can be considered a "success" while the payload indicates 100% of the underlying operations failed.

Because it returns HTTP status codes *inside* the payload text (like `HTTP/1.1 404 Not Found`), standard HTTP metrics and logging tools often blindly record a 207 response as a complete success.

Developer Tips

  • When building non-WebDAV REST APIs, avoid using 207 for bulk operations. A more modern standard is returning 200 OK or 202 Accepted with a structured JSON envelope detailing the partial successes/failures.
  • If you do implement WebDAV, ensure your XML namespace handling is strict. Clients heavily rely on the `DAV:` namespace prefix being perfectly valid.
  • Always set the `Content-Type` to `application/xml` or `text/xml` when returning a 207 Multi-Status.

Interview Questions

These are questions you might face in a backend or API design interview that touch on HTTP 207.

What is the purpose of the 207 Multi-Status code?

It is a WebDAV status code used to convey the results of a batch operation. It returns an XML payload containing multiple independent HTTP status codes for different resources affected by a single request.

Why not just return a 200 OK with a custom JSON array for batch results?

You can, and many modern REST APIs do. However, 207 is specifically defined by the WebDAV RFC (4918) for this exact purpose using XML. Standard HTTP clients expect WebDAV compliance when 207 is used.

If a client tries to delete 3 files in one request, and 1 fails, what should the top-level HTTP status code be in a WebDAV system?

The top-level status code should be 207 Multi-Status. The XML body will contain a 200 OK or 204 No Content for the two successful deletions, and a 4xx/5xx code for the failed one.

Common Interview Mistakes

  • Assuming 207 Multi-Status is a standard part of REST and proposing it in system design interviews for JSON batch endpoints without acknowledging its WebDAV/XML origins.
  • Thinking a 207 means the request failed. It is a 2xx success code; the server successfully understood and processed the batch, even if some items within the batch encountered errors.