File protocols
Section titled “File protocols”Connect a remote storage service over FTP, HDFS, HTTP, SFTP, SMB, or WebDAV. The remote is proved by listing its root before the backend is saved. Once a backend is connected, mount it under a filesystem path so the remote is reachable at a path inside the kit.
Connect an FTP backend. Supports plain FTP, implicit FTPS (TLS from the start, usually port 990), and explicit FTPS (start plain then upgrade to TLS, port 21).
POST /api/v1/backends/ftp
Section titled “POST /api/v1/backends/ftp”Connect an FTP backend.
This endpoint takes no path, query, or header parameters.
Request body
Section titled “Request body”A JSON object with the FTP connection settings.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
host | string | Yes | "" | FTP host to connect to, e.g. ftp.example.com. |
user | string | No | user | FTP username. |
pass | string | No | "" | FTP password. |
port | integer | No | 21 | FTP port number. |
tls | boolean | No | false | Use implicit FTPS (TLS from the start; usually port 990). Cannot be combined with explicit FTPS. |
explicit_tls | boolean | No | false | Use explicit FTPS (upgrade an existing plain connection to TLS). Cannot be combined with implicit FTPS. |
tls_cache_size | integer | No | 32 | TLS session cache size for control and data connections. Use 0 to disable. |
allow_insecure_tls_ciphers | boolean | No | false | Allow insecure TLS ciphers such as TLS_RSA_WITH_AES_128_GCM_SHA256 in addition to the secure defaults. |
disable_epsv | boolean | No | false | Do not use EPSV even if the server advertises support. |
disable_mlsd | boolean | No | false | Do not use MLSD even if the server advertises support. |
disable_utf8 | boolean | No | false | Do not use UTF-8 even if the server advertises support. |
disable_tls13 | boolean | No | false | Disable TLS 1.3 (workaround for buggy FTP servers). |
force_list_hidden | boolean | No | false | Use LIST -a to force listing of hidden files. Disables MLSD. |
no_check_upload | boolean | No | false | Skip the post-upload check of size and modification time. Pair with --inplace for write-only folders. |
writing_mdtm | boolean | No | false | Use MDTM to set modification time (VsFtpd quirk). |
ask_password | boolean | No | false | Ask for an FTP password when one is not supplied. |
encoding | string | No | 35749890 | File-name encoding. Allowed values: Asterisk,Ctl,Dot,Slash, BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket, Ctl,LeftPeriod,Slash. |
description | string | No | "" | Description of the remote. |
concurrency | integer | No | 0 | Maximum simultaneous FTP connections; 0 is unlimited. Setting this risks deadlocks. |
close_timeout | integer | No | 60 | Seconds to wait for a response to close. |
idle_timeout | integer | No | 60 | Seconds before idle connections in the pool are closed. 0 keeps them indefinitely. |
shut_timeout | integer | No | 60 | Seconds to wait for the data connection closing status. |
http_proxy | string | No | "" | HTTP CONNECT proxy URL, e.g. http://proxy.example.com:8000. |
socks_proxy | string | No | "" | SOCKS5 proxy, e.g. user:pass@localhost:9005. |
Response
Section titled “Response”The credentials were proved by listing the remote’s root. A connect of an already-saved backend with the same credentials is treated as a reconnect and returns the same id.
{ "success": true, "message": "Backend connected", "data": { "id": "a1b2c3d4e5f60718", "type": "ftp", "vfs_backend_type": "ftp", "config": { "host": "ftp.example.com", "port": 21, "user": "alice" }, "mount_paths": [] }}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Whether the request succeeded. |
message | string | Yes | Short human-readable summary. |
data | object | Yes | The connected backend. |
data.id | string | Yes | Backend id (16 hex characters). |
data.type | string | Yes | The protocol type, as the request path named it. |
data.vfs_backend_type | string | Yes | The Hoody backend that runs this protocol. |
data.config | object | Yes | The configuration as sent, with secrets hidden. A plain value (not an object or array) of host, port, user, username, region, endpoint, provider, bucket, or path is echoed; every other value is replaced by "***". |
data.mount_paths | array | Yes | Filesystem paths where this backend is mounted. Empty for newly connected backends. |
Connection failed: the remote did not list its root within 20 seconds, or refused the connection or the credentials. Nothing was saved. A backend already connected with the same type, host, and account keeps its credentials.
{ "success": false, "error": "Connection failed"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code. Not set for this response. |
Returned when uploads from before a service restart are still pending on this backend; when a delivery of pending uploads to this backend is running with its current settings; or when this connect names a backend already connected (same type, host, and account) with other credentials while a mount of it is in use. The Retry-After header is sent when uploads from before a service restart need to drain first.
{ "success": false, "error": "Backend already connected with other credentials while in use"}The service cannot carry out this request right now.
{ "success": false, "error": "The service cannot carry out this request right now", "code": "MOUNT_STORAGE_UNAVAILABLE"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code, one of those listed below. |
| Error Code | Title | Description | Resolution |
|---|---|---|---|
MOUNT_STORAGE_UNAVAILABLE | Mounts unavailable | Mounts are unavailable until the server’s storage check passes. The check did not pass (for example, the mount directory and the directory of the backends’ own mounts overlap), so no mount or backend connection can start, and backend file operations are refused. When the check fails on the service’s own directories, the message names the directory (the state or the run directory), what is wrong with it (for example, a directory above it that is writable by group or others, or owned by another user), and how to correct it. The refusal comes before the mount or backend is looked up, so an unknown id is answered 503, not 404, until the check passes. Existing mounts show the error, and the mount list still answers. Other files are served as usual. Nothing was changed. | Correct the directory the message names, if it names one; then retry after the time given in Retry-After (the check runs again by then). |
Example
Section titled “Example”curl -X POST https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/backends/ftp \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "host": "ftp.example.com", "user": "alice", "pass": "secret", "port": 21, "tls": false }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });
await client.files.backends.createFtp({ host: 'ftp.example.com', user: 'alice', pass: process.env.FTP_PASS, port: 21, tls: false});Connect a Hadoop Distributed File System backend. List one or more name nodes as host:port,host:port.
POST /api/v1/backends/hdfs
Section titled “POST /api/v1/backends/hdfs”Connect an HDFS backend.
This endpoint takes no path, query, or header parameters.
Request body
Section titled “Request body”A JSON object with the HDFS connection settings.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
namenode | string | Yes | "" | Comma-separated list of name nodes and ports, e.g. namenode-1:8020,namenode-2:8020. |
username | string | No | "" | Hadoop user name. Allowed value: root. |
data_transfer_protection | string | No | "" | Kerberos data transfer protection. Allowed value: privacy. Used only with Kerberos enabled. |
encoding | string | No | 50430082 | File-name encoding for the backend. |
description | string | No | "" | Description of the remote. |
Response
Section titled “Response”The credentials were proved by listing the remote’s root. A connect of an already-saved backend with the same credentials is treated as a reconnect and returns the same id.
{ "success": true, "message": "Backend connected", "data": { "id": "a1b2c3d4e5f60718", "type": "hdfs", "vfs_backend_type": "hdfs", "config": { "namenode": "namenode-1:8020" }, "mount_paths": [] }}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Whether the request succeeded. |
message | string | Yes | Short human-readable summary. |
data | object | Yes | The connected backend. |
data.id | string | Yes | Backend id (16 hex characters). |
data.type | string | Yes | The protocol type, as the request path named it. |
data.vfs_backend_type | string | Yes | The Hoody backend that runs this protocol. |
data.config | object | Yes | The configuration as sent, with secrets hidden. A plain value (not an object or array) of host, port, user, username, region, endpoint, provider, bucket, or path is echoed; every other value is replaced by "***". |
data.mount_paths | array | Yes | Filesystem paths where this backend is mounted. Empty for newly connected backends. |
Connection failed: the remote did not list its root within 20 seconds, or refused the connection or the credentials. Nothing was saved. A backend already connected with the same type, host, and account keeps its credentials.
{ "success": false, "error": "Connection failed"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code. Not set for this response. |
Returned when uploads from before a service restart are still pending on this backend; when a delivery of pending uploads to this backend is running with its current settings; or when this connect names a backend already connected (same type, host, and account) with other credentials while a mount of it is in use. The Retry-After header is sent when uploads from before a service restart need to drain first.
{ "success": false, "error": "Backend already connected with other credentials while in use"}The service cannot carry out this request right now.
{ "success": false, "error": "The service cannot carry out this request right now", "code": "MOUNT_STORAGE_UNAVAILABLE"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code, one of those listed below. |
| Error Code | Title | Description | Resolution |
|---|---|---|---|
MOUNT_STORAGE_UNAVAILABLE | Mounts unavailable | Mounts are unavailable until the server’s storage check passes. The check did not pass (for example, the mount directory and the directory of the backends’ own mounts overlap), so no mount or backend connection can start, and backend file operations are refused. When the check fails on the service’s own directories, the message names the directory (the state or the run directory), what is wrong with it (for example, a directory above it that is writable by group or others, or owned by another user), and how to correct it. The refusal comes before the mount or backend is looked up, so an unknown id is answered 503, not 404, until the check passes. Existing mounts show the error, and the mount list still answers. Other files are served as usual. Nothing was changed. | Correct the directory the message names, if it names one; then retry after the time given in Retry-After (the check runs again by then). |
Example
Section titled “Example”curl -X POST https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/backends/hdfs \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "namenode": "namenode-1:8020,namenode-2:8020", "username": "root" }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });
await client.files.backends.createHdfs({ namenode: 'namenode-1:8020,namenode-2:8020', username: 'root'});Connect an HTTP or HTTPS backend. Lists the remote URL; useful for read-only mirrors, public file shares, and CDNs.
POST /api/v1/backends/http
Section titled “POST /api/v1/backends/http”Connect an HTTP backend.
This endpoint takes no path, query, or header parameters.
Request body
Section titled “Request body”A JSON object with the HTTP connection settings.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | "" | URL of the HTTP host to connect to, e.g. https://example.com. |
headers | string | No | "" | Comma-separated list of header key, value pairs (CSV encoded). For example 'Cookie,name=value' or '"Cookie","name=value"'. Sent only to the host in url; redirects to a different host do not receive them. |
no_escape | boolean | No | false | Do not escape URL metacharacters in path names. |
no_head | boolean | No | false | Do not use HEAD requests when listing directories (faster listings but missing sizes and unreliable file presence). |
no_slash | boolean | No | false | Treat text/html responses as directories. Use when the site does not append / to directories. |
description | string | No | "" | Description of the remote. |
Response
Section titled “Response”The credentials were proved by listing the remote’s root. A connect of an already-saved backend with the same credentials is treated as a reconnect and returns the same id.
{ "success": true, "message": "Backend connected", "data": { "id": "a1b2c3d4e5f60718", "type": "http", "vfs_backend_type": "http", "config": { "url": "https://example.com" }, "mount_paths": [] }}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Whether the request succeeded. |
message | string | Yes | Short human-readable summary. |
data | object | Yes | The connected backend. |
data.id | string | Yes | Backend id (16 hex characters). |
data.type | string | Yes | The protocol type, as the request path named it. |
data.vfs_backend_type | string | Yes | The Hoody backend that runs this protocol. |
data.config | object | Yes | The configuration as sent, with secrets hidden. A plain value (not an object or array) of host, port, user, username, region, endpoint, provider, bucket, or path is echoed; every other value is replaced by "***". |
data.mount_paths | array | Yes | Filesystem paths where this backend is mounted. Empty for newly connected backends. |
Connection failed: the remote did not list its root within 20 seconds, or refused the connection or the credentials. Nothing was saved. A backend already connected with the same type, host, and account keeps its credentials.
{ "success": false, "error": "Connection failed"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code. Not set for this response. |
Returned when uploads from before a service restart are still pending on this backend; when a delivery of pending uploads to this backend is running with its current settings; or when this connect names a backend already connected (same type, host, and account) with other credentials while a mount of it is in use. The Retry-After header is sent when uploads from before a service restart need to drain first.
{ "success": false, "error": "Backend already connected with other credentials while in use"}The service cannot carry out this request right now.
{ "success": false, "error": "The service cannot carry out this request right now", "code": "MOUNT_STORAGE_UNAVAILABLE"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code, one of those listed below. |
| Error Code | Title | Description | Resolution |
|---|---|---|---|
MOUNT_STORAGE_UNAVAILABLE | Mounts unavailable | Mounts are unavailable until the server’s storage check passes. The check did not pass (for example, the mount directory and the directory of the backends’ own mounts overlap), so no mount or backend connection can start, and backend file operations are refused. When the check fails on the service’s own directories, the message names the directory (the state or the run directory), what is wrong with it (for example, a directory above it that is writable by group or others, or owned by another user), and how to correct it. The refusal comes before the mount or backend is looked up, so an unknown id is answered 503, not 404, until the check passes. Existing mounts show the error, and the mount list still answers. Other files are served as usual. Nothing was changed. | Correct the directory the message names, if it names one; then retry after the time given in Retry-After (the check runs again by then). |
Example
Section titled “Example”curl -X POST https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/backends/http \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com", "no_head": false }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });
await client.files.backends.createHttp({ url: 'https://example.com', noHead: false});Connect an SSH/SFTP backend. The schema requires host and user. The description recommends supplying one of pass, password, key_pem, or key as the credential. Server-stored credentials (a key file or an ssh-agent) cannot be used.
POST /api/v1/backends/sftp
Section titled “POST /api/v1/backends/sftp”Connect an SFTP backend.
This endpoint takes no path, query, or header parameters.
Request body
Section titled “Request body”A JSON object with the SFTP connection settings.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
host | string | Yes | "" | SSH host, e.g. example.com. |
user | string | Yes | user | SSH username. |
pass | string | No | "" | SSH password. Leave blank to use ssh-agent. |
password | string | No | (unset) | Alias for pass. An empty value is ignored; if it differs from a non-empty pass, the request is rejected with 400. |
key_pem | string | No | "" | Raw PEM-encoded private key, with line endings as \n. Overrides key_file. |
key | string | No | (unset) | Alias for key_pem. An empty value is ignored; if it differs from a non-empty key_pem, the request is rejected with 400. |
key_file_pass | string | No | "" | Passphrase for an encrypted PEM private key file (old OpenSSH format). |
passphrase | string | No | (unset) | Alias for key_file_pass. An empty value is ignored; if it differs from a non-empty key_file_pass, the request is rejected with 400. |
port | integer | No | 22 | SSH port number. |
subsystem | string | No | sftp | SSH2 subsystem on the remote host. |
chunk_size | string | No | 32768 | SFTP payload size in bytes. The RFC default is 32768; larger values such as 262144 can improve throughput on high-latency links but require server support. |
concurrency | integer | No | 64 | Maximum outstanding requests for one file. Higher values raise throughput on high-latency links at the cost of memory. |
connections | integer | No | 0 | Maximum simultaneous SFTP connections; 0 is unlimited. Setting this risks deadlocks. |
copy_is_hardlink | boolean | No | false | Implement server-side copies via hardlinks. Not all servers support this. |
set_modtime | boolean | No | true | Set the modification time on the remote after a transfer. |
disable_concurrent_reads | boolean | No | false | Disable concurrent reads. Enable on servers that limit repeated downloads. |
disable_concurrent_writes | boolean | No | false | Disable concurrent writes. |
disable_hashcheck | boolean | No | false | Disable the SSH command used to probe remote hashing support. |
skip_links | boolean | No | false | Omit symlinks and other non-regular files from directory listings. |
use_fstat | boolean | No | false | Use fstat instead of stat on open file handles. Helps servers that limit open files (for example IBM Sterling SFTP). |
pin_host_key | boolean | No | false | Pin the server host key on first connect (Trust On First Use). Run once with this flag; the key is then written into host_keys. |
host_keys | string | No | "" | Pinned host keys as comma-separated "algo base64-key" entries (matching fields 2 and 3 of an OpenSSH known_hosts line). At most 16 entries. |
host_key_algorithms | string | No | "" | Space-separated, ordered list of host key algorithms, e.g. ssh-ed25519 ssh-rsa ssh-dss. |
ciphers | string | No | "" | Space-separated, ordered list of session ciphers. Must not be set when use_insecure_cipher is true. |
key_exchange | string | No | "" | Space-separated, ordered list of key exchange algorithms. Must not be set when use_insecure_cipher is true. |
macs | string | No | "" | Space-separated, ordered list of MAC algorithms, e.g. umac-64-etm@openssh.com hmac-sha2-256-etm@openssh.com. |
use_insecure_cipher | boolean | No | false | Allow insecure ciphers and key exchange methods (aes128-cbc, aes192-cbc, aes256-cbc, 3des-cbc, diffie-hellman-group-exchange-sha256, diffie-hellman-group-exchange-sha1). Must be false when ciphers or key_exchange is set. |
hashes | string | No | "" | Comma-separated list of supported checksum types. |
pubkey | string | No | "" | SSH public certificate for public certificate-based authentication. Overrides pubkey_file. |
set_env | string | No | "" | Environment variables for the SFTP client and remote commands, e.g. VAR=value. |
path_override | string | No | "" | Override path used by SSH shell commands. Prefix with @ to leave the path relative to the remote root. Useful for Synology NAS where SFTP and shell paths differ. |
shell_type | string | No | "" | SSH shell type. Leave blank for autodetect. Allowed values: none, unix, powershell, cmd. |
ask_password | boolean | No | false | Ask for an SFTP password when none is supplied; the ssh-agent is not contacted when this is set. |
http_proxy | string | No | "" | HTTP CONNECT proxy URL, e.g. http://proxy.example.com:8000. |
socks_proxy | string | No | "" | SOCKS5 proxy, e.g. user:pass@localhost:9005. |
idle_timeout | integer | No | 60 | Seconds before idle connections are closed. 0 keeps them indefinitely. |
encoding | string | No | 33652738 | File-name encoding for the backend. |
description | string | No | "" | Description of the remote. |
Response
Section titled “Response”The credentials were proved by listing the remote’s root. A connect of an already-saved backend with the same credentials is treated as a reconnect and returns the same id.
{ "success": true, "message": "Backend connected", "data": { "id": "a1b2c3d4e5f60718", "type": "sftp", "vfs_backend_type": "sftp", "config": { "host": "example.com", "port": 22, "user": "alice" }, "mount_paths": [] }}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Whether the request succeeded. |
message | string | Yes | Short human-readable summary. |
data | object | Yes | The connected backend. |
data.id | string | Yes | Backend id (16 hex characters). |
data.type | string | Yes | The protocol type, as the request path named it. |
data.vfs_backend_type | string | Yes | The Hoody backend that runs this protocol. |
data.config | object | Yes | The configuration as sent, with secrets hidden. A plain value (not an object or array) of host, port, user, username, region, endpoint, provider, bucket, or path is echoed; every other value is replaced by "***". |
data.mount_paths | array | Yes | Filesystem paths where this backend is mounted. Empty for newly connected backends. |
Connection failed: the remote did not list its root within 20 seconds, or refused the connection or the credentials. Nothing was saved. A backend already connected with the same type, host, and account keeps its credentials. Aliases that disagree with their canonical field (for example a non-empty password that differs from pass) also produce 400.
{ "success": false, "error": "Connection failed"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code. Not set for this response. |
Returned when uploads from before a service restart are still pending on this backend; when a delivery of pending uploads to this backend is running with its current settings; or when this connect names a backend already connected (same type, host, and account) with other credentials while a mount of it is in use. The Retry-After header is sent when uploads from before a service restart need to drain first.
{ "success": false, "error": "Backend already connected with other credentials while in use"}The service cannot carry out this request right now.
{ "success": false, "error": "The service cannot carry out this request right now", "code": "MOUNT_STORAGE_UNAVAILABLE"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code, one of those listed below. |
| Error Code | Title | Description | Resolution |
|---|---|---|---|
MOUNT_STORAGE_UNAVAILABLE | Mounts unavailable | Mounts are unavailable until the server’s storage check passes. The check did not pass (for example, the mount directory and the directory of the backends’ own mounts overlap), so no mount or backend connection can start, and backend file operations are refused. When the check fails on the service’s own directories, the message names the directory (the state or the run directory), what is wrong with it (for example, a directory above it that is writable by group or others, or owned by another user), and how to correct it. The refusal comes before the mount or backend is looked up, so an unknown id is answered 503, not 404, until the check passes. Existing mounts show the error, and the mount list still answers. Other files are served as usual. Nothing was changed. | Correct the directory the message names, if it names one; then retry after the time given in Retry-After (the check runs again by then). |
Example
Section titled “Example”curl -X POST https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/backends/sftp \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "host": "example.com", "user": "alice", "pass": "secret", "port": 22 }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });
await client.files.backends.createSftp({ host: 'example.com', user: 'alice', pass: process.env.SFTP_PASS, port: 22});Connect an SMB / CIFS share. Set use_kerberos to true to authenticate with Kerberos instead of NTLM (requires a configured Kerberos credentials cache).
POST /api/v1/backends/smb
Section titled “POST /api/v1/backends/smb”Connect an SMB backend.
This endpoint takes no path, query, or header parameters.
Request body
Section titled “Request body”A JSON object with the SMB connection settings.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
host | string | Yes | "" | SMB server hostname, e.g. example.com. |
user | string | No | user | SMB username. |
pass | string | No | "" | SMB password. |
domain | string | No | WORKGROUP | Domain name for NTLM authentication. |
spn | string | No | "" | Service principal name presented to the server, e.g. cifs/remotehost:1020. Often required for clusters. |
port | integer | No | 445 | SMB port number. |
case_insensitive | boolean | No | true | Whether the server treats file names case-insensitively. Always true on Windows shares. |
hide_special_share | boolean | No | true | Hide administrative and other special shares (e.g. print$). |
use_kerberos | boolean | No | false | Authenticate with Kerberos instead of NTLM. Requires a configured Kerberos credentials cache. |
idle_timeout | integer | No | 60 | Seconds before idle connections are closed. 0 keeps them indefinitely. |
encoding | string | No | 56698766 | File-name encoding for the backend. |
description | string | No | "" | Description of the remote. |
Response
Section titled “Response”The credentials were proved by listing the remote’s root. A connect of an already-saved backend with the same credentials is treated as a reconnect and returns the same id.
{ "success": true, "message": "Backend connected", "data": { "id": "a1b2c3d4e5f60718", "type": "smb", "vfs_backend_type": "smb", "config": { "host": "files.example.com", "port": 445, "user": "alice" }, "mount_paths": [] }}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Whether the request succeeded. |
message | string | Yes | Short human-readable summary. |
data | object | Yes | The connected backend. |
data.id | string | Yes | Backend id (16 hex characters). |
data.type | string | Yes | The protocol type, as the request path named it. |
data.vfs_backend_type | string | Yes | The Hoody backend that runs this protocol. |
data.config | object | Yes | The configuration as sent, with secrets hidden. A plain value (not an object or array) of host, port, user, username, region, endpoint, provider, bucket, or path is echoed; every other value is replaced by "***". |
data.mount_paths | array | Yes | Filesystem paths where this backend is mounted. Empty for newly connected backends. |
Connection failed: the remote did not list its root within 20 seconds, or refused the connection or the credentials. Nothing was saved. A backend already connected with the same type, host, and account keeps its credentials.
{ "success": false, "error": "Connection failed"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code. Not set for this response. |
Returned when uploads from before a service restart are still pending on this backend; when a delivery of pending uploads to this backend is running with its current settings; or when this connect names a backend already connected (same type, host, and account) with other credentials while a mount of it is in use. The Retry-After header is sent when uploads from before a service restart need to drain first.
{ "success": false, "error": "Backend already connected with other credentials while in use"}The service cannot carry out this request right now.
{ "success": false, "error": "The service cannot carry out this request right now", "code": "MOUNT_STORAGE_UNAVAILABLE"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code, one of those listed below. |
| Error Code | Title | Description | Resolution |
|---|---|---|---|
MOUNT_STORAGE_UNAVAILABLE | Mounts unavailable | Mounts are unavailable until the server’s storage check passes. The check did not pass (for example, the mount directory and the directory of the backends’ own mounts overlap), so no mount or backend connection can start, and backend file operations are refused. When the check fails on the service’s own directories, the message names the directory (the state or the run directory), what is wrong with it (for example, a directory above it that is writable by group or others, or owned by another user), and how to correct it. The refusal comes before the mount or backend is looked up, so an unknown id is answered 503, not 404, until the check passes. Existing mounts show the error, and the mount list still answers. Other files are served as usual. Nothing was changed. | Correct the directory the message names, if it names one; then retry after the time given in Retry-After (the check runs again by then). |
Example
Section titled “Example”curl -X POST https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/backends/smb \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "host": "files.example.com", "user": "alice", "pass": "secret", "domain": "WORKGROUP", "port": 445 }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });
await client.files.backends.createSmb({ host: 'files.example.com', user: 'alice', pass: process.env.SMB_PASS, domain: 'WORKGROUP', port: 445});WebDAV
Section titled “WebDAV”Connect a WebDAV backend. Set vendor to the matching software (Nextcloud, ownCloud, SharePoint, and so on) for the best listing behaviour.
POST /api/v1/backends/webdav
Section titled “POST /api/v1/backends/webdav”Connect a WebDAV backend.
This endpoint takes no path, query, or header parameters.
Request body
Section titled “Request body”A JSON object with the WebDAV connection settings.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | "" | URL of the WebDAV host, e.g. https://example.com. |
user | string | No | "" | User name. For NTLM, use the Domain\User format. |
pass | string | No | "" | Password. |
bearer_token | string | No | "" | Bearer token (for example a Macaroon) instead of user and password. |
vendor | string | No | "" | WebDAV site, service, or software. Allowed values: fastmail, nextcloud, owncloud, infinitescale, sharepoint, sharepoint-ntlm, hoody-vfs, other. |
auth_redirect | boolean | No | false | Keep the Authorization header across redirects. Required by some servers, but exposes credentials on HTTPS to HTTP redirects. |
headers | string | No | "" | Comma-separated list of header key, value pairs (CSV encoded), e.g. 'Cookie,name=value'. |
nextcloud_chunk_size | string | No | 10485760 | Nextcloud upload chunk size in bytes. 0 disables chunked uploads. |
owncloud_exclude_mounts | boolean | No | false | Exclude ownCloud mounted storages from listings. |
owncloud_exclude_shares | boolean | No | false | Exclude ownCloud shares from listings. |
pacer_min_sleep | integer | No | 0 | Minimum seconds to wait between API calls. |
encoding | string | No | "" | File-name encoding for the backend. Default is Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8 for sharepoint-ntlm and identity otherwise. |
description | string | No | "" | Description of the remote. |
Response
Section titled “Response”The credentials were proved by listing the remote’s root. A connect of an already-saved backend with the same credentials is treated as a reconnect and returns the same id.
{ "success": true, "message": "Backend connected", "data": { "id": "a1b2c3d4e5f60718", "type": "webdav", "vfs_backend_type": "webdav", "config": { "url": "https://cloud.example.com/remote.php/dav", "user": "alice" }, "mount_paths": [] }}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Whether the request succeeded. |
message | string | Yes | Short human-readable summary. |
data | object | Yes | The connected backend. |
data.id | string | Yes | Backend id (16 hex characters). |
data.type | string | Yes | The protocol type, as the request path named it. |
data.vfs_backend_type | string | Yes | The Hoody backend that runs this protocol. |
data.config | object | Yes | The configuration as sent, with secrets hidden. A plain value (not an object or array) of host, port, user, username, region, endpoint, provider, bucket, or path is echoed; every other value is replaced by "***". |
data.mount_paths | array | Yes | Filesystem paths where this backend is mounted. Empty for newly connected backends. |
Connection failed: the remote did not list its root within 20 seconds, or refused the connection or the credentials. Nothing was saved. A backend already connected with the same type, host, and account keeps its credentials.
{ "success": false, "error": "Connection failed"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code. Not set for this response. |
Returned when uploads from before a service restart are still pending on this backend; when a delivery of pending uploads to this backend is running with its current settings; or when this connect names a backend already connected (same type, host, and account) with other credentials while a mount of it is in use. The Retry-After header is sent when uploads from before a service restart need to drain first.
{ "success": false, "error": "Backend already connected with other credentials while in use"}The service cannot carry out this request right now.
{ "success": false, "error": "The service cannot carry out this request right now", "code": "MOUNT_STORAGE_UNAVAILABLE"}| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Yes | Always false. |
error | string | Yes | Human-readable error message. |
code | string | No | The error code, one of those listed below. |
| Error Code | Title | Description | Resolution |
|---|---|---|---|
MOUNT_STORAGE_UNAVAILABLE | Mounts unavailable | Mounts are unavailable until the server’s storage check passes. The check did not pass (for example, the mount directory and the directory of the backends’ own mounts overlap), so no mount or backend connection can start, and backend file operations are refused. When the check fails on the service’s own directories, the message names the directory (the state or the run directory), what is wrong with it (for example, a directory above it that is writable by group or others, or owned by another user), and how to correct it. The refusal comes before the mount or backend is looked up, so an unknown id is answered 503, not 404, until the check passes. Existing mounts show the error, and the mount list still answers. Other files are served as usual. Nothing was changed. | Correct the directory the message names, if it names one; then retry after the time given in Retry-After (the check runs again by then). |
Example
Section titled “Example”curl -X POST https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/backends/webdav \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://cloud.example.com/remote.php/dav", "user": "alice", "pass": "secret", "vendor": "nextcloud" }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });
await client.files.backends.createWebdav({ url: 'https://cloud.example.com/remote.php/dav', user: 'alice', pass: process.env.WEBDAV_PASS, vendor: 'nextcloud'});