< HTTP/1.1 207 Multi-Status207 Multi-Status: WebDAV Per-Resource Results
207 Multi-Status carries an XML body with a separate status per resource. See a PROPFIND example, how to parse it, and why the top-level code is not the result.
- Cacheable
- Only with explicit freshness
- Client action
- Check each sub-status in the body
- Usually sent by
- WebDAV server
- Spec
- RFC 4918 §11.1
TL;DR: 207 Multi-Status is a WebDAV code (RFC 4918) that wraps several independent results in an XML
multistatusbody. The top-level 207 only means “here is the report”: read each<response>element’s own<status>to know what happened.
What it means
When one request touches many resources (listing a collection, deleting a folder, moving a tree), the outcome can be mixed. Rather than choosing one status, the server returns 207 and a body with one result per resource.
PROPFIND /files/ HTTP/1.1
Host: dav.example.com
Depth: 1
Content-Type: application/xml
<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:"><d:prop><d:getcontentlength/></d:prop></d:propfind>
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>/files/report.pdf</d:href>
<d:propstat>
<d:prop><d:getcontentlength>2457600</d:getcontentlength></d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/files/secret.txt</d:href>
<d:status>HTTP/1.1 403 Forbidden</d:status>
</d:response>
</d:multistatus>
A mixed failure for a DELETE /files/ on a collection looks the same: report.pdf could be deleted, secret.txt returned 403. The collection itself is not removed, and the 207 lists only the member that failed. RFC 4918 section 9.6.1 says a server SHOULD NOT add 424 Failed Dependency entries for the ancestors in a DELETE, because the client can infer them. Where 424 does show up is inside a PROPPATCH response, when one property change fails and the rest are rolled back with it.
Every <response> carries either a <status> for the whole resource or one or more <propstat> blocks with property-level statuses (some properties 200, others 404 because they do not exist).
Where you will meet it
- WebDAV file servers: Apache
mod_dav, nginx with the DAV module, Nextcloud, ownCloud, SharePoint, Synology. - CalDAV and CardDAV: calendar and contacts sync (
REPORTandPROPFIND), including iCloud, Google Calendar’s CalDAV endpoint, Radicale and Fastmail. - Mounting network drives (macOS Finder, Windows “Map network drive”), rclone,
cadaveranddavfs2.
curl -s -X PROPFIND -H 'Depth: 1' -u alice https://dav.example.com/files/ | xmllint --format -
Handling it correctly
- Treat 207 as a transport success only. Parse the XML, loop over
responseelements, and apply per-item status. - For writes, treat any non-2xx entry as a partial failure and decide whether to roll back or retry only the failed items.
Depth: infinityPROPFIND on big trees is expensive and often disabled; servers answer 403 with<d:propfind-finite-depth/>.- Do not rely on caching 207 responses. They are not in the set of status codes cacheable by default, and the body depends on the request body (PROPFIND, REPORT).
const xml = new DOMParser().parseFromString(await res.text(), 'application/xml')
for (const r of xml.getElementsByTagNameNS('DAV:', 'response')) {
const href = r.getElementsByTagNameNS('DAV:', 'href')[0].textContent
const status = r.getElementsByTagNameNS('DAV:', 'status')[0]?.textContent
if (status && !/\s2\d\d\s/.test(status)) console.warn(href, status)
}
This only reads the response-level status; check each propstat too if you care about property results.
Related
- 424 Failed Dependency
- 423 Locked
- 200 OK: use a plain 200 when there is nothing per-resource to report.
- 507 Insufficient Storage: another WebDAV code.
- Status codes overview
Frequently asked questions
What does 207 Multi-Status mean?
The response covers several resources or operations, and the real outcome of each is inside an XML body, one status per resource. The 207 itself only says the server processed the request and produced a report.
Does 207 mean everything succeeded?
No. A 207 can contain 200, 404, 403 and 424 entries side by side. A client must parse the multistatus body and check each response element, not stop at the top-level code.
Which methods return 207?
The WebDAV methods PROPFIND, PROPPATCH, COPY, MOVE, DELETE on collections, LOCK, and REPORT in CalDAV and CardDAV, whenever the result differs per resource. A single-resource success normally returns a plain 200, 201 or 204.
Should my JSON API return 207?
Some batch APIs do, and a few do so with a JSON body, but 207 is defined only for the WebDAV XML format. For non-WebDAV batch endpoints, many teams prefer 200 with a per-item result list, which every client and proxy handles without special cases.
Sources
Related
202 Accepted
The request was accepted for processing but not completed yet. Learn when to use 202 for asynchronous operations.
203 Non-Authoritative Information
203 means a proxy modified the origin response before passing it on. Learn when it is sent, how it differs from 200, caching rules and what clients should do.
204 No Content
The request succeeded with no response body. Learn when to use 204 No Content for successful operations that don't return data.
205 Reset Content: What It Does and Browser Support
205 Reset Content tells the client to reset the view that sent the request, like clearing a form. Learn its rules, fetch behaviour and why it is rarely used.