WebDAV Operations
Section titled “WebDAV Operations”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.
Connection & Capability Discovery
Section titled “Connection & Capability Discovery”GET /{path}
Section titled “GET /{path}”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.).
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | File or directory path on the WebDAV server |
type | query | string | Yes | Must be webdav |
server | query | string | Yes | WebDAV server hostname (e.g. cloud.example.com) |
user | query | string | No | WebDAV username |
pass | query | string | No | WebDAV password |
webdav_path | query | string | No | WebDAV endpoint path. Default: / |
SDK Usage
Section titled “SDK Usage”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"});Response
Section titled “Response”File content or directory listing
{ "description": "File content or directory listing"}OPTIONS /{path}
Section titled “OPTIONS /{path}”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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | File or directory path |
SDK Usage
Section titled “SDK Usage”const result = await client.files.webdav.getOptions({ path: "/Documents"});Response
Section titled “Response”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" } } }}Copy & Move
Section titled “Copy & Move”COPY /{path}
Section titled “COPY /{path}”WebDAV COPY: copies a file or directory to a new location specified by the Destination header.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Source file or directory path |
Destination | header | string | Yes | Destination URL for the copy |
Depth | header | string | No | Copy depth: 0 (file only) or infinity (recursive for directories). Default: infinity |
SDK Usage
Section titled “SDK Usage”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"});Response
Section titled “Response”Resource copied successfully
{ "description": "Resource copied successfully"}Resource overwritten at destination
{ "description": "Resource overwritten at destination"}Copy not allowed
{ "error": "Insufficient permissions to copy this resource", "success": false}Source resource not found
{ "description": "Source resource not found"}Destination parent does not exist
{ "description": "Destination parent does not exist"}MOVE /{path}
Section titled “MOVE /{path}”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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Source file or directory path |
Destination | header | string | Yes | Destination URL for the move |
SDK Usage
Section titled “SDK Usage”const result = await client.files.webdav.moveResource({ path: "/Documents/draft.txt", Destination: "https://api.example.com/api/files/webdav/Documents/final.txt"});Response
Section titled “Response”Resource moved successfully
{ "description": "Resource moved successfully"}Resource overwritten at destination
{ "description": "Resource overwritten at destination"}Move not allowed (requires upload and delete permissions)
{ "error": "Missing upload or delete permission on source resource", "success": false}Source resource not found
{ "description": "Source resource not found"}Destination parent does not exist
{ "description": "Destination parent does not exist"}Locking
Section titled “Locking”LOCK /{path}
Section titled “LOCK /{path}”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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | File or directory path |
Depth | header | string | No | Lock depth: 0 (file only) or infinity (recursive) |
Request Body
Section titled “Request Body”The endpoint accepts an optional application/xml lock request body. No body fields are required.
SDK Usage
Section titled “SDK Usage”const result = await client.files.webdav.lockResource({ path: "/Documents/report.pdf", Depth: "0"});Response
Section titled “Response”Lock token issued (compatibility only)
{ "description": "Lock token issued (compatibility only)"}File not found
{ "description": "File not found"}UNLOCK /{path}
Section titled “UNLOCK /{path}”WebDAV UNLOCK: releases a previously issued lock token. This is a no-op compatibility stub — the server accepts and discards the token without state.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | File or directory path |
Lock-Token | header | string | Yes | Lock token to release |
SDK Usage
Section titled “SDK Usage”const result = await client.files.webdav.unlockResource({ path: "/Documents/report.pdf", "Lock-Token": "opaquelocktoken:abc123-def456"});Response
Section titled “Response”Lock released (no-op)
{ "description": "Lock released (no-op)"}Resource not found
{ "description": "Resource not found"}Properties
Section titled “Properties”PROPFIND /{path}
Section titled “PROPFIND /{path}”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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | File or directory path |
Depth | header | string | No | Depth of property retrieval: 0 (resource only), 1 (immediate children), infinity (recursive). Default: 1 |
Request Body
Section titled “Request Body”The endpoint accepts an optional application/xml PROPFIND body specifying which properties to retrieve. No body fields are required.
SDK Usage
Section titled “SDK Usage”const result = await client.files.webdav.propfindResource({ path: "/Documents", Depth: "1"});Response
Section titled “Response”Multi-Status response with resource properties in WebDAV XML format
{ "description": "Multi-Status response with resource properties in WebDAV XML format"}Resource not found
{ "description": "Resource not found"}PROPPATCH /{path}
Section titled “PROPPATCH /{path}”WebDAV PROPPATCH: modifies custom properties on a file. Returns a 207 Multi-Status response confirming the outcome of each set or remove instruction.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | File or directory path |
Request Body
Section titled “Request Body”The endpoint accepts an application/xml PROPPATCH body containing set and remove instructions. No body fields are required by the schema.
SDK Usage
Section titled “SDK Usage”const result = await client.files.webdav.proppatchResource({ path: "/Documents/report.pdf"});Response
Section titled “Response”Multi-Status response confirming property changes
{ "description": "Multi-Status response confirming property changes"}File not found
{ "description": "File not found"}