Skip to content

WebDAV-compatible file operations for connecting to and manipulating files via standard WebDAV clients (Nextcloud, ownCloud, Cyberduck, etc.). These endpoints implement the HTTP methods defined by RFC 4918 — COPY, MOVE, LOCK, UNLOCK, PROPFIND, PROPPATCH, and OPTIONS — alongside a dedicated connection endpoint.


Connect to a WebDAV-accessible resource. The type=webdav query parameter signals the server to resolve the resource through the WebDAV backend (Nextcloud, ownCloud, etc.).

NameInTypeRequiredDescription
pathpathstringYesFile or directory path on the WebDAV server
typequerystringYesMust be webdav
serverquerystringYesWebDAV server hostname (e.g. cloud.example.com)
userquerystringNoWebDAV username
passquerystringNoWebDAV password
webdav_pathquerystringNoWebDAV endpoint path. Default: /
const result = await client.files.webdav.access({
path: "/Documents/report.pdf",
type: "webdav",
server: "cloud.example.com",
user: "alice",
pass: "••••••••",
webdav_path: "/remote.php/dav/files/alice"
});

File content or directory listing

{
"description": "File content or directory listing"
}

Returns the HTTP methods and WebDAV compliance classes supported for the given path. WebDAV clients call OPTIONS during capability discovery before issuing other WebDAV methods.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
const result = await client.files.webdav.getOptions({
path: "/Documents"
});

The response carries capability information in headers, not the body.

{
"description": "Allowed methods listed in Allow header",
"headers": {
"Allow": {
"description": "Comma-separated list of supported HTTP methods",
"schema": {
"type": "string"
}
},
"DAV": {
"description": "WebDAV compliance class",
"schema": {
"type": "string"
}
}
}
}

WebDAV COPY: copies a file or directory to a new location specified by the Destination header.

NameInTypeRequiredDescription
pathpathstringYesSource file or directory path
DestinationheaderstringYesDestination URL for the copy
DepthheaderstringNoCopy depth: 0 (file only) or infinity (recursive for directories). Default: infinity
const result = await client.files.webdav.copyResource({
path: "/Documents/report.pdf",
Destination: "https://api.example.com/api/files/webdav/Archive/report-2024.pdf",
Depth: "0"
});

Resource copied successfully

{
"description": "Resource copied successfully"
}

WebDAV MOVE: moves or renames a file or directory to a new location specified by the Destination header. Requires both upload and delete permissions on the source.

NameInTypeRequiredDescription
pathpathstringYesSource file or directory path
DestinationheaderstringYesDestination URL for the move
const result = await client.files.webdav.moveResource({
path: "/Documents/draft.txt",
Destination: "https://api.example.com/api/files/webdav/Documents/final.txt"
});

Resource moved successfully

{
"description": "Resource moved successfully"
}

WebDAV LOCK: returns a lock token for client compatibility. This is a stub — the server does not enforce locks, it only echoes the standard WebDAV response so that clients expecting lock semantics do not error out.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
DepthheaderstringNoLock depth: 0 (file only) or infinity (recursive)

The endpoint accepts an optional application/xml lock request body. No body fields are required.

const result = await client.files.webdav.lockResource({
path: "/Documents/report.pdf",
Depth: "0"
});

Lock token issued (compatibility only)

{
"description": "Lock token issued (compatibility only)"
}

WebDAV UNLOCK: releases a previously issued lock token. This is a no-op compatibility stub — the server accepts and discards the token without state.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
Lock-TokenheaderstringYesLock token to release
const result = await client.files.webdav.unlockResource({
path: "/Documents/report.pdf",
"Lock-Token": "opaquelocktoken:abc123-def456"
});

Lock released (no-op)

{
"description": "Lock released (no-op)"
}

WebDAV PROPFIND: retrieves properties (metadata) for a file or directory. Returns a 207 Multi-Status response in WebDAV XML format containing resource type, size, modification date, ETag, and other standard properties. Use the Depth header to control recursion into directories.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
DepthheaderstringNoDepth of property retrieval: 0 (resource only), 1 (immediate children), infinity (recursive). Default: 1

The endpoint accepts an optional application/xml PROPFIND body specifying which properties to retrieve. No body fields are required.

const result = await client.files.webdav.propfindResource({
path: "/Documents",
Depth: "1"
});

Multi-Status response with resource properties in WebDAV XML format

{
"description": "Multi-Status response with resource properties in WebDAV XML format"
}

WebDAV PROPPATCH: modifies custom properties on a file. Returns a 207 Multi-Status response confirming the outcome of each set or remove instruction.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path

The endpoint accepts an application/xml PROPPATCH body containing set and remove instructions. No body fields are required by the schema.

const result = await client.files.webdav.proppatchResource({
path: "/Documents/report.pdf"
});

Multi-Status response confirming property changes

{
"description": "Multi-Status response confirming property changes"
}