Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

A New API for Your Storage Hosting

Published

storageobject storage

Hey everyone,

We’re excited to start slowly rolling out a new beta feature for our storage servers: a direct API for file management. This is applicable for storage hosting at https://www.interserver.net/storage/.

We know many of you want to automate your uploads or manage files from a script, and this API is the first step. It’s designed for headless access, letting you use tools like curl or other scripts to interact with your storage space without a browser.

Since this is an early beta, we’re enabling it on servers one by one. Here’s a quick guide on how to get started and what you can do with it.

Features
* Powered by workerman and hooks in the directadmin file manager api using the ftp password file
* 5GB object max for now
* No set file system per folder, but more files, longer access. Over 100,000 files it would be recommended to hash the files into different directories
* Built on top of ZFS file system as part of the storage webhosting

How to Create Your API Login

Getting started is simple. The new API doesn’t use complicated tokens; it uses the same login as your FTP accounts in DirectAdmin.

Log in to your DirectAdmin control panel.

Go to the “FTP Management” section.

Create a new FTP account.

Whatever username and password you set for that FTP account are now your API login credentials.

The best part is that this is automatically secure and sandboxed. The API is locked to whatever directory you set as the FTP user’s “home.” For example, if you set the FTP user’s path to /home/john/tmp, all API calls you make will be restricted to that tmp directory.

Authentication

All API endpoints use HTTP Basic Authentication. In most command-line tools like curl, you can do this with the -u flag:

curl -u “your-ftp-user:your-ftp-password” …

Storage Server Url

The end point url is in the format of the storage server name: If you are on storage5000.is.cc this is your end point name on port 8080 over https – giving you https://storage5000.is.cc:8080 – If this url does not load for you, your storage system may not have been rolled out yet. Please contact our support in this case for early access.

Not ready for any api access? A basic file manager is also available for login directly from your browser to the storage url.

API Endpoints

The API is split into two types of endpoints: Standard (for simple scripts) and S3-Compatible (for S3-aware tools).

Standard Endpoints

These are straightforward commands for common tasks. All subpath parameters are relative to your user’s home directory (e.g., . or my_folder).

GET /list

Lists files and directories.

Query Parameters:

subpath (string, optional): The subdirectory to list. Defaults to your root.

Response:

200 { ok: true, entries: { … } }

Example:

curl -k -u "user:pass" -G --data-urlencode "subpath=public_html" "https://HOST:8080/list"

POST /upload

Uploads one or more files.

Form Data:

subpath (string, optional): The subdirectory to upload into.

overwrite (bool, optional): Set to “true” to overwrite existing files.

file (file): The file to upload. Use file[] for multiple files.

Response:

200 { ok: true, status: 200, … }

Example (single file):

curl -k -u "user:pass" -X POST "https://HOST:8080/upload" \

-F "subpath=public_html"

-F "overwrite=true"

-F "file=@/path/to/local/test.txt"

POST /delete

Deletes one or more files or directories.

Form Data:

subpath (string, optional): The directory where the files are located.

names[] (array): An array of file/directory names to delete.

Response:

200 { ok: true, … }

Example:

curl -k -u "user:pass" -X POST "https://HOST:8080/delete" \

-F "subpath=public_html"

-F "names[]=old_file.zip"

-F "names[]=old_directory"

POST /mkdir

Creates a new directory.

Form Data:

subpath (string, optional): The directory to create the new one in.

name (string, required): The name of the new directory.

Response:

200 { ok: true, … }

Example:

curl -k -u "user:pass" -X POST "https://HOST:8080/mkdir" -F "subpath=public_html" -F "name=new_images"

POST /rename

Renames a file or directory.

Form Data:

subpath (string, optional): The directory where the file is.

from (string, required): The current name.

to (string, required): The new name.

Response:

200 { ok: true, … }

Example:

curl -k -u "user:pass" -X POST "https://HOST:8080/rename" \

-F "subpath=public_html"

-F "from=old_name.txt"

-F "to=new_name.txt"

GET /download

Downloads a single file.

Query Parameters:

subpath (string, optional): The directory where the file is.

name (string, required): The name of the file to download.

Response:

200 (The raw file content)

Example:

curl -k -u "user:pass" -G "https://HOST:8080/download" \

--data-urlencode "subpath=public_html"

--data-urlencode "name=image.jpg" -o "local_image.jpg"

GET /stat

Gets information about a single file or directory.

Query Parameters:

subpath (string, optional): The directory where the item is.

name (string, required): The name of the item to check.

Response:

200 { ok: true, meta: { … } }

Example:

curl -k -u "user:pass" -G "https://HOST:8080/stat" \

--data-urlencode "subpath=public_html"

--data-urlencode "name=image.jpg"

S3-Compatible Endpoints

For S3-aware tools, you can use the following endpoints. The “bucket” is simply your user’s home directory (e.g., tmp).

GET /{bucket}/

Action: List objects in the bucket.

Response: S3-style XML.

GET /{bucket}/{key}

Action: Download an object.

Response: Raw file content.

Example:

curl -k -u "user:pass" "https://HOST:8080/tmp/file.txt" -o "local_file.txt"

PUT /{bucket}/{key}

Action: Upload an object.

Response: 200 OK

Example:

curl -k -u "user:pass" -X PUT "https://HOST:8080/tmp/new_file.zip" --data-binary "@local.zip"


DELETE /{bucket}/{key}

Action: Delete an object.

Response: 204 No Content

Example:

curl -k -u "user:pass" -X DELETE "https://HOST:8080/tmp/old_file.zip"

This is still in beta, so please let us know if you run into any issues.

Script example via ssh # Server BASE_URL=https://storage5000.is.cc:8080 VERIFY_TLS=true # Auth (Basic) [email protected] PASS=MYPASSWORDHERE # Default working dir under user home #SUBPATH=public_html SUBPATH=. # Optional: extra curl flags (e.g., timeouts) # CURL_EXTRA=–connect-timeout 10 –max-time 600

CLI

./da.sh
Usage:
da.sh ls --subpath


da.sh stat --subpath
--name
da.sh download --subpath
--name [-o ]
da.sh upload --subpath
--file [--name ] [--overwrite] [--perm ]
da.sh delete --subpath
(--name | --names )
da.sh mkdir --subpath
--name
da.sh rename --subpath
--from --to
da.sh health

Reads BASE_URL, USER, PASS, VERIFY_TLS, CURL_EXTRA from .env

* See https://github.com/interserver/go-is-gui for a windows based GUI in development.

See GO CLI for a linux based CLI written in go
* wget https://github.com/interserver/go-is-cli/raw/refs/heads/main/is
* chmod +x is
* is auth (set up your auth config)

 ./is
NAME:
   is - CLI for IS storage service (Official API)

USAGE:
   is [global options] command [command options]

COMMANDS:
   auth              Configure credentials
   ls, list          List files (GET /list)
   stat              Get file info (GET /stat)
   upload, put, p    Upload file (POST /upload)
   download, get, g  Download file (GET /download)
   delete, rm        Delete file (POST /delete)
   mkdir             Create directory (POST /mkdir)
   rename, mv        Rename file (POST /rename)
   health            Check server health (GET /healthz)
   help, h           Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --server value, -s value  Server URL (default: "https://storage4000.is.cc:8080") [$IS_SERVER]
   --help, -h                show help

Sample Bash script
Sample CLI uploader

Related guides

Account services are unavailable until the production backend is configured.