WebDAV Operations
Section titled “WebDAV Operations”The WebDAV endpoints expose WebDAV-compatible file operations on Hoody file resources. These endpoints implement the HTTP verbs defined in RFC 4918 so that standard WebDAV clients — including Nextcloud, ownCloud, macOS Finder, Windows Explorer, and Cyberduck — can connect to Hoody as a WebDAV server.
Use these endpoints when you need to:
- Connect an external WebDAV client to a file path on Hoody.
- Discover server capabilities via
OPTIONS. - Copy or move files between paths.
- Issue
LOCK/UNLOCKfor client compatibility. - Retrieve (
PROPFIND) or modify (PROPPATCH) WebDAV properties.
Access file via WebDAV
Section titled “Access file via WebDAV”GET /{path}?type=webdav
Connect a WebDAV client (Nextcloud, ownCloud, etc.) to a Hoody file path. Returns the file content or a directory listing.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Resource path on the Hoody WebDAV server |
type | query | string | Yes | Must be webdav |
server | query | string | Yes | Hoody server base URL |
user | query | string | No | Username for WebDAV authentication |
pass | query | string | No | Password for WebDAV authentication |
webdav_path | query | string | No | WebDAV endpoint path. Default: / |
Response
Section titled “Response”{ "description": "File content or directory listing"}SDK usage
Section titled “SDK usage”await client.files.webdav.access({ path: "documents/report.pdf", type: "webdav", server: "https://app.hoody.com", user: "alice", pass: "••••••••", webdav_path: "/"});Get allowed methods
Section titled “Get allowed methods”OPTIONS /{path}
Returns supported HTTP methods and WebDAV capabilities in the Allow header. Used by WebDAV clients for capability discovery (RFC 4918 §10.1).
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Resource path to query for capabilities |
This endpoint takes no body.
Response
Section titled “Response”Returns 204 No Content. The advertised methods and DAV class are conveyed via response headers:
| Header | Description |
|---|---|
Allow | Comma-separated list of supported HTTP methods. WebDAV-root paths advertise the full WebDAV verb set; /api/v1/* paths advertise the simple HTTP set. |
DAV | WebDAV compliance class. Set to 1 on WebDAV-root OPTIONS responses; absent on /api/v1/* OPTIONS responses. |
MS-Author-Via | Authoring-protocol hint for Microsoft WebDAV clients. Set to DAV on WebDAV-root OPTIONS responses. |
SDK usage
Section titled “SDK usage”await client.files.webdav.getOptions({ path: "documents/"});Copy file or directory
Section titled “Copy file or directory”COPY /{path}
WebDAV COPY: copy 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 |
This endpoint takes no body.
Response
Section titled “Response”{ "description": "Resource copied successfully"}{ "description": "Resource overwritten at destination"}{ "error": "Copy not allowed", "success": false}{ "description": "Source resource not found"}{ "description": "Destination parent does not exist"}SDK usage
Section titled “SDK usage”await client.files.webdav.copyResource({ path: "documents/report.pdf", Destination: "https://app.hoody.com/webdav/archive/report.pdf", Depth: "0"});Move or rename file/directory
Section titled “Move or rename file/directory”MOVE /{path}
WebDAV MOVE: move 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 |
This endpoint takes no body.
Response
Section titled “Response”{ "description": "Resource moved successfully"}{ "description": "Resource overwritten at destination"}{ "error": "Move not allowed: requires upload and delete permissions", "success": false}{ "description": "Source resource not found"}{ "description": "Destination parent does not exist"}SDK usage
Section titled “SDK usage”await client.files.webdav.moveResource({ path: "documents/draft.pdf", Destination: "https://app.hoody.com/webdav/documents/final.pdf"});Lock file (WebDAV compatibility)
Section titled “Lock file (WebDAV compatibility)”LOCK /{path}
WebDAV LOCK: returns a lock token for WebDAV client compatibility. This is a compatibility stub — locks are not enforced server-side.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Resource path to lock |
Depth | header | string | No | Lock depth: 0 or infinity |
Request Body
Section titled “Request Body”Optional XML lock request body (application/xml).
<?xml version="1.0" encoding="utf-8"?>
</D:lockscope> </D:locktype></D:lockinfo>Response
Section titled “Response”<?xml version="1.0" encoding="utf-8"?>
opaquelocktoken:hoody-compat</D:href></D:locktoken> </D:activelock> </D:lockdiscovery></D:prop>{ "description": "File not found"}SDK usage
Section titled “SDK usage”await client.files.webdav.lockResource({ path: "documents/report.pdf", Depth: "0"});Unlock file (WebDAV compatibility)
Section titled “Unlock file (WebDAV compatibility)”UNLOCK /{path}
WebDAV UNLOCK: release a lock token. This is a no-op compatibility stub.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Resource path to unlock |
Lock-Token | header | string | Yes | Lock token to release |
This endpoint takes no body.
Response
Section titled “Response”{ "description": "Lock released (no-op)"}{ "description": "Resource not found"}SDK usage
Section titled “SDK usage”await client.files.webdav.unlockResource({ path: "documents/report.pdf", Lock-Token: "opaquelocktoken:hoody-compat"});Get WebDAV properties
Section titled “Get WebDAV properties”PROPFIND /{path}
WebDAV PROPFIND: retrieve properties (metadata) for files or directories. Returns XML with resource type, size, modification date, ETag, and more. Supports the Depth header (0, 1, infinity) to control recursion into directories.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Resource path to query |
Depth | header | string | No | Depth of property retrieval: 0 (resource only), 1 (immediate children), infinity (recursive). Default: 1 |
Request Body
Section titled “Request Body”Optional PROPFIND XML body (application/xml) specifying which properties to retrieve. If omitted, all properties are returned.
<?xml version="1.0" encoding="utf-8"?>
</D:prop></D:propfind>Response
Section titled “Response”<?xml version="1.0" encoding="utf-8"?>
/documents/report.pdf</D:href>
245760</D:getcontentlength> Mon, 10 Feb 2025 14:32:11 GMT</D:getlastmodified>
</D:prop> HTTP/1.1 200 OK</D:status> </D:propstat> </D:response></D:multistatus>{ "description": "Resource not found"}SDK usage
Section titled “SDK usage”await client.files.webdav.propfindResource({ path: "documents/", Depth: "1"});Update WebDAV properties
Section titled “Update WebDAV properties”PROPPATCH /{path}
WebDAV PROPPATCH: modify properties on a file. Returns a 207 Multi-Status response.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
path | path | string | Yes | Resource path to modify |
Request Body
Section titled “Request Body”PROPPATCH XML body (application/xml) with set / remove instructions for the target properties.
<?xml version="1.0" encoding="utf-8"?>
<customprop xmlns="https://hoody.com/ns/">archived</customprop> </D:prop> </D:set></D:propertyupdate>Response
Section titled “Response”<?xml version="1.0" encoding="utf-8"?>
/documents/report.pdf</D:href>
<customprop xmlns="https://hoody.com/ns/">archived</customprop> </D:prop> HTTP/1.1 200 OK</D:status> </D:propstat> </D:response></D:multistatus>{ "description": "File not found"}SDK usage
Section titled “SDK usage”await client.files.webdav.proppatchResource({ path: "documents/report.pdf"});