Skip to content
Hoody.com

The Files service exposes endpoints for connecting to remote storage backends over FTP, S3, and SSH/SFTP, and for managing the authentication session. All endpoints share a container-scoped base URL of the form https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com, and remote credentials are supplied as query parameters in the request URL.

Verify the current authentication status. The response body is the authenticated username as plain text, or empty if the request is unauthenticated.

NameInTypeRequiredDescription
pathpathstringYesThe path to check authentication for

The authenticated username as a plain text string. The body is empty when the request is not authenticated.

alice
Terminal window
curl --request CHECKAUTH \
"https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/"

Clear the authentication session. The response sets a WWW-Authenticate header to force the client to drop any cached credentials.

NameInTypeRequiredDescription
pathpathstringYesThe path to clear authentication for

The request path is not valid.

{
"success": false,
"error": "Invalid path",
"code": "INVALID_PATH"
}
Error CodeTitleDescriptionResolution
INVALID_PATHInvalid pathThe request path is not valid: it does not decode, it has a . or .. component, it is outside the configured path prefix, or it is over the filesystem’s limits (a name over 255 bytes, a path over 4095 bytes)Send a path of plain components under the served directory, within the filesystem’s limits
Terminal window
curl --request LOGOUT \
"https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/"

Open an SFTP session to a remote SSH server and read a file or list a directory. The response body is the raw file content (application/octet-stream) for a file, or a directory listing for a directory. Authenticate with a password, a private key, or both.

NameInTypeRequiredDescription
pathpathstringYesThe file or directory path on the remote SSH server
typequerystringYesBackend type. Must be ssh
serverquerystringYesServer hostname and port, for example sftp.example.com:22
userquerystringYesSSH username
passquerystringNoPassword (base64 encoded)
keyquerystringNoPrivate key in PEM form (base64 encoded)
passphrasequerystringNoKey passphrase (base64 encoded)

The raw file content as a binary stream (application/octet-stream) for a file path, or a directory listing for a directory path. The wire format is not JSON.

Terminal window
curl -G \
--data-urlencode "type=ssh" \
--data-urlencode "server=sftp.example.com:22" \
--data-urlencode "user=alice" \
--data-urlencode "pass=c2VjcmV0" \
"https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/path/to/file.txt"

Open an SFTP session to a remote SSH server and write a file. The request body is the file content as a raw binary stream (application/octet-stream). Authenticate with a password, a private key, or both.

NameInTypeRequiredDescription
pathpathstringYesThe file path to write to on the remote SSH server
serverquerystringYesServer hostname and port, for example sftp.example.com:22
userquerystringYesSSH username
passquerystringNoPassword (base64 encoded)
keyquerystringNoPrivate key in PEM form (base64 encoded)
passphrasequerystringNoKey passphrase (base64 encoded)

The file content as a raw binary stream, sent with Content-Type: application/octet-stream.

The file was uploaded to the remote SSH server.

Terminal window
curl -X PUT \
-H "Content-Type: application/octet-stream" \
--data-binary @./local/file.txt \
"https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/path/to/remote/file.txt?type=ssh&server=sftp.example.com:22&user=alice&pass=c2VjcmV0"

Read an object from an S3 bucket, or list a key prefix. Works with AWS S3 and S3-compatible services such as MinIO or DigitalOcean Spaces. The response body is the object content (raw bytes) for a single key, or a listing for a key prefix.

NameInTypeRequiredDescription
pathpathstringYesThe object key or key prefix inside the bucket
typequerystringYesBackend type. Must be s3
serverquerystringYesS3 service host. An AWS host (*.amazonaws.com) is reached by s3_region; any other host is the endpoint of an S3-compatible service (MinIO, DigitalOcean Spaces, …), unless s3_endpoint names one
s3_bucketquerystringYesS3 bucket name. The path is the object key (or key prefix) within this bucket
s3_regionquerystringYesS3 region, for example us-east-1
userquerystringNoAccess key ID. Give both user and pass, or neither for anonymous access to a public bucket
passquerystringNoSecret access key (base64 encoded). Give both user and pass, or neither
s3_endpointquerystringNoEndpoint of an S3-compatible service (MinIO, etc.), as a host or URL. Takes precedence over server

The object content (raw bytes) for a single key, or a listing for a key prefix. The wire format is the object or the listing; it is not a structured JSON envelope.

Terminal window
curl -G \
--data-urlencode "type=s3" \
--data-urlencode "server=s3.amazonaws.com" \
--data-urlencode "s3_bucket=my-bucket" \
--data-urlencode "s3_region=us-east-1" \
--data-urlencode "user=AKIAIOSFODNN7EXAMPLE" \
--data-urlencode "pass=d0phbHJYVXRuRkVNSS9LN01ERU5HL2JQeFJmaUNZRVhBTVBMRUtFWQ==" \
"https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/photos/cat.jpg"

Connect to an FTP server and read a file or list a directory. The response body is the file content (raw bytes) for a file, or a directory listing for a directory.

NameInTypeRequiredDescription
pathpathstringYesThe file or directory path on the FTP server
typequerystringYesBackend type. Must be ftp
serverquerystringYesFTP server hostname
userquerystringNoFTP username. Defaults to anonymous
passquerystringNoFTP password (base64 encoded)
ftp_securequerybooleanNoUse explicit FTPS (AUTH TLS on the control connection). Defaults to false
ftp_passivequerybooleanNoPassive mode, the only mode supported. false is refused with 400. Defaults to true

The file content (raw bytes) for a file path, or a directory listing for a directory path. The wire format is the file or the listing; it is not a structured JSON envelope.

Terminal window
curl -G \
--data-urlencode "type=ftp" \
--data-urlencode "server=ftp.example.com" \
--data-urlencode "user=alice" \
--data-urlencode "pass=c2VjcmV0" \
"https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/path/to/file.txt"