Skip to content
Hoody.com

The endpoints on this page let you read from and write to external backends through a container-scoped files service. Each backend (FTP, Git, S3, SSH/SFTP) is selected via the type query parameter and accepts its own connection and authentication fields. Use these endpoints when you need to fetch a file from a Git repository, list or download objects from S3-compatible storage, or read/write files on a remote server over FTP or SSH.

All requests are issued against the per-container files host:

https://{projectId}-{containerId}-files-1.{server}.containers.hoody.icu

The examples below use the placeholder host https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu — substitute your own projectId, containerId, and server values.

Connect to an FTP server and read a file or list a directory. The path is the remote path relative to the FTP root, and server is the FTP host (optionally with :port).

NameInTypeRequiredDescription
pathpathstringYesRemote file or directory path on the FTP server
typequerystringYesBackend type. Must be ftp
serverquerystringYesFTP server hostname (optionally with :port)
userquerystringNoFTP username. Default: "anonymous"
passquerystringNoFTP password
ftp_securequerybooleanNoUse FTPS (FTP over TLS). Default: false
ftp_passivequerybooleanNoUse passive mode. Default: true
Terminal window
curl -X GET "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/reports/2024/q1.csv?type=ftp&server=ftp.example.com&user=admin&pass=c2VjcmV0MTIz&ftp_secure=false&ftp_passive=true"
{
"description": "File content or directory listing"
}

The response body is the raw file content (binary) for files, or a directory listing for paths ending in /.

Fetch a file from a Git repository hosted on GitHub, GitLab, Bitbucket, or a custom Git server. The path is the file path inside the repository.

NameInTypeRequiredDescription
pathpathstringYesFile path inside the repository
typequerystringYesBackend type. Must be git
urlquerystringYesFull GitHub/GitLab/Bitbucket URL or repository URL
refquerystringNoBranch, tag, or commit (defaults to HEAD or extracted from URL)
passquerystringNoPersonal Access Token (base64 encoded) for private repos
Terminal window
curl -X GET "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/src/index.ts?type=git&url=https://github.com/example/repo&ref=main&pass=Y2l0YWRiX0FBY2Nlc3NfVG9rZW5fMTIzNDU2Nzg5MA=="
{
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": "File content"
}

The response body is the raw file bytes (application/octet-stream).

Access an object in AWS S3 or an S3-compatible store (MinIO, DigitalOcean Spaces, etc.). The path is the object key within the bucket.

NameInTypeRequiredDescription
pathpathstringYesObject key inside the bucket
typequerystringYesBackend type. Must be s3
serverquerystringYesS3 server hostname (optionally with :port)
s3_bucketquerystringYesS3 bucket name
s3_regionquerystringYesS3 region
userquerystringNoAWS Access Key ID
passquerystringNoAWS Secret Key (base64 encoded)
s3_endpointquerystringNoCustom S3 endpoint for MinIO, etc.
Terminal window
curl -X GET "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/data/2024-01-15/events.jsonl?type=s3&server=s3.amazonaws.com&s3_bucket=my-bucket&s3_region=us-east-1&user=AKIAIOSFODNN7EXAMPLE&pass=d2VsbHN0b3JlZHNlY3JldGtleQ==&s3_endpoint=https://s3.us-east-1.amazonaws.com"
{
"description": "Object content or listing"
}

The response body is the raw object bytes for keys, or an object listing for prefixes.

Connect to a remote SSH/SFTP server and read a file or list a directory. Supports both password and private-key authentication.

NameInTypeRequiredDescription
pathpathstringYesRemote file or directory path
typequerystringYesBackend type. Must be ssh
serverquerystringYesServer hostname:port
userquerystringYesSSH username
passquerystringNoPassword (base64 encoded)
keyquerystringNoPrivate key PEM (base64 encoded)
passphrasequerystringNoKey passphrase (base64 encoded)
Terminal window
curl -X GET "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/var/log/app.log?type=ssh&server=10.0.0.5:22&user=deploy&pass=c3NoLXBhc3N3b3Jk"
{
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": "File content or directory listing"
}

The response body is the raw file bytes for files, or an application/octet-stream directory listing for directories.

Upload a file to a remote SSH/SFTP server. The body of the request is the raw file content as application/octet-stream.

NameInTypeRequiredDescription
pathpathstringYesRemote destination file path
serverquerystringYesServer hostname:port
userquerystringYesSSH username
passquerystringNoPassword (base64 encoded)
keyquerystringNoPrivate key PEM (base64 encoded)
passphrasequerystringNoKey passphrase (base64 encoded)

Send the file contents as the request body with content type application/octet-stream. There are no structured body fields.

Terminal window
curl -X PUT "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/var/www/app/releases/1.4.2/bundle.tar.gz?server=10.0.0.5:22&user=deploy&pass=c3NoLXBhc3N3b3Jk" \
-H "Content-Type: application/octet-stream" \
--data-binary "@./bundle.tar.gz"
{
"description": "File uploaded"
}

Verify the current authentication status for the files service. The response body contains the authenticated username, or an empty string when not authenticated.

This endpoint uses the non-standard CHECKAUTH HTTP method.

NameInTypeRequiredDescription
pathpathstringYesAny path within the files service
Terminal window
curl -X CHECKAUTH "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/"
{
"content": {
"text/plain": {
"description": "Authenticated username or empty string",
"schema": {
"type": "string"
}
}
},
"description": "Authentication status"
}

The response body is a plain text string: the authenticated username, or empty when no credentials are present.

Clear authentication for the files service. The response includes a WWW-Authenticate header that forces the client to discard stored credentials.

This endpoint uses the non-standard LOGOUT HTTP method.

NameInTypeRequiredDescription
pathpathstringYesAny path within the files service
Terminal window
curl -X LOGOUT "https://prj_d8f7e2-c_4a9b1c-files-1.us-east.containers.hoody.icu/"
{
"description": "Authentication cleared",
"headers": {
"WWW-Authenticate": {
"description": "Authentication challenge to force credential clearing",
"schema": {
"type": "string"
}
}
}
}

The WWW-Authenticate response header is set so browsers and HTTP clients discard any cached credentials.