N7 Storage
N7 Storage provides an on-demand API to upload files, allowing seamless access to those resources via your registered domain.
Prerequisite#
- You must have an active account on Nitrogen.
- Your target domain, where files will be uploaded and accessed, must be registered on Nitrogen.
- A service account with Editor access must be configured. If you don’t have one, refer to this article to create API keys.
File and folder naming rules#
N7 Storage accepts a restricted set of characters in file and folder names. Uploads with any other name are rejected with a 400 error, whether they come from the API or the CLI.
- Every folder and file name must start with a letter or a digit.
- After the first character, only letters, digits,
-and_are allowed. - A file name must contain exactly one dot, separating the name from its extension.
- Spaces and accented or non-English characters are not allowed.
| Name | Accepted | Reason |
|---|---|---|
photo.jpg | Yes | Valid filename |
IMG_1234.JPEG | Yes | Valid filename |
my-photo.png | Yes | Valid filename |
my photo.jpg | No | Contains a space |
archive.tar.gz | No | Contains more than one dot |
_draft.png | No | Does not start with a letter or digit |
résumé.pdf | No | Contains non-English characters |
README | No | Has no file extension |
The CLI can rename files for you automatically — see Fixing unsupported names .
CLI: Upload Bulk Files to N7 Storage#
storvia-cli scans a folder and uploads everything inside it, remembering what already succeeded so an interrupted run can be resumed.
Install#
macOS, Linux and FreeBSD
curl --proto '=https' --tlsv1.2 -sSf https://storvia.n7.io/tools/install.sh | shWindows (PowerShell)
irm https://storvia.n7.io/tools/install.ps1 | iex
The installer picks the right build for your machine, checks it against the published checksums, installs it to ~/.n7/bin (or %LOCALAPPDATA%\n7\bin on Windows), and tells you how to add that folder to your PATH.
Once installed, upgrade at any time with:
storvia-cli upgradeTo install somewhere else, pass a directory:
curl ... | sh -s -- --dir /usr/local/bin
Download manually#
If you would rather not run a script, download the binary directly:
| Platform | Download |
|---|---|
| macOS (Apple Silicon) | apple/arm64 |
| macOS (Intel) | apple/amd64 |
| Linux (amd64) | linux/amd64 |
| Linux (arm64) | linux/arm64 |
| Windows (amd64) | windows/amd64 |
| Windows (arm64) | windows/arm64 |
| FreeBSD (amd64) | freebsd/amd64 |
Checksums for every file are published at checksums.txt
. On macOS and Linux, verify a download by comparing it against that list — replace apple/arm64 with the platform you downloaded:
curl -sSfL https://storvia.n7.io/tools/checksums.txt \
| grep 'apple/arm64/storvia-cli' \
| awk '{print $1" storvia-cli"}' \
| shasum -a 256 -c -It prints storvia-cli: OK when the file is intact.
On macOS you may need to allow the downloaded binary to run, and on macOS or Linux mark it executable with
chmod +x storvia-cli.
Sign in#
Store the service token for your domain once, and every later command reuses it:
storvia-cli login -d <your-domain>You will be prompted for the token, which is verified against the server before it is saved. Nothing is uploaded during this step.
storvia-cli whoamilists the domains you have tokens for.storvia-cli logout -d <your-domain>removes a stored token.
Upload a folder#
storvia-cli sync -d <your-domain> <folder-path>Files that were already uploaded successfully are skipped, so re-running the command after a failure only sends what is missing. A file that has changed since its last upload is sent again.
Replacing files that already exist#
N7 Storage refuses to overwrite by default, so uploading to a path that is already taken fails with a conflict:
Failed to upload a.png: upload rejected with status 409: file already exist
(the file already exists on the server; re-run with --overwrite to replace it)Add --overwrite to replace them instead:
storvia-cli sync -d <your-domain> --overwrite <folder-path>
--rescandoes not do this. It only re-examines your local upload record so unchanged files are sent again; the server still refuses to overwrite. Use--rescan --overwritetogether to re-send everything and replace what is already there.
Fixing unsupported names#
By default sync reports any file whose name N7 Storage will reject, and uploads the rest:
2026/08/26 04:25:45 2 name(s) will be rejected by storvia. Re-run with --autocorrect=auto or --autocorrect=interactive to fix them:
2026/08/26 04:25:45 My Photos (suggested: My-Photos)
2026/08/26 04:25:45 My Photos/my holiday photo.jpg (suggested: my-holiday-photo-baa0c.jpg)Folders are reported too, because a folder name that N7 Storage rejects makes every file inside it unreachable.
Add --autocorrect to rename them on disk before uploading:
--autocorrect=autorenames everything it can without asking.--autocorrect=interactiveshows each proposed rename and lets you accept it, type your own name, or skip the file.
storvia-cli sync -d <your-domain> --autocorrect=auto <folder-path>Every rename is printed:
2026/08/26 04:25:48 RENAMED folder: My Photos -> My-Photos (unsupported characters in folder name)
2026/08/26 04:25:48 RENAMED file: My-Photos/my holiday photo.jpg -> My-Photos/my-holiday-photo-1dd81.jpg (unsupported characters)The -1dd81 is a short random suffix added to every automatically renamed file. Folders do not get one, so an existing folder on your domain is added to rather than duplicated.
Files with no extension at all, such as
README, cannot be renamed automatically. They are reported and skipped.
Keeping the CLI up to date#
storvia-cli upgradeThis downloads the latest published build, verifies it against the published checksums, and replaces the binary you are running. If you are already on the latest build it does nothing.
storvia-cli upgrade --checkreports whether an upgrade is available without installing it.storvia-cli --versionshows the version you have.
If storvia-cli was installed into a system directory such as
/usr/local/bin, the upgrade needs the same permissions you used to put it there.
Check what was uploaded#
storvia-cli status -d <your-domain>Cache: /home/you/.config/storvia-cli/storvia-cli.cache
example.com
FAILED 2 files 1.4 MB
UPLOADED 317 files 842.6 MBAdd --filter FAILED to list the individual files along with the error the server returned.
CLI Command Reference#
- Commands :
sync <folder>: Uploads files from the specified directory.login: Stores the service token for a domain.logout: Removes the stored token for a domain.whoami: Shows which domains have a stored token.status: Shows what has been uploaded from this machine.upgrade: Upgrades storvia-cli to the latest published version.
- Global flags :
-d, --domain <domain>: Target domain for file uploads. (Required)--token <service-token>: Service token, overriding the stored one. (Optional)-y, --non-interactive: Never prompt. Useful in scripts and CI.--config <path>: Use a different config file.-v, --version: Print the installed version.
syncflags :--autocorrect <auto|interactive>: Rename files and folders that N7 Storage would reject.--overwrite: Replace files that already exist on the server instead of failing with a conflict.--rescan: Force re-evaluation of all files, even if already marked uploaded. This is local-only and does not permit overwriting.-c, --concurrency <n>: Number of concurrent uploads. (Default10)--cache <path>: Path to the cache file that tracks upload progress.
statusflags :--filter <status>: List files with this status —UPLOADED,FAILED,PENDINGorUPLOADING.--limit <n>: Maximum number of files to list with--filter. (Default20)
loginflags :--no-verify: Store the token without checking it against the server first.
upgradeflags :--check: Report whether an upgrade is available, without installing it.--force: Reinstall even if already up to date.--target <version>: Install a specific published version instead of the latest.
API: Upload Files to N7 Storage#
API :
POST https://storvia.n7.io/v1/upload?domain_name={domain}&alias={resource_path}Request Headers :
Authorization: Token <api-key-of-service-account>If using PostMan, set the
Auth TypetoNo Auth. And then set theAuthorizationheader inHeaderssection.Request Body :
- Use a multipart/form-data form with the file to upload.
form 'file=@"{file_path}"'
Explanation of Upload API Parameters#
- Query params :
domain_name: The domain where the file should be uploaded.alias: The desired resource path (e.g.,images/photo.jpg) for accessing the file later. It must follow the naming rules , and must be URL-encoded.overwrite(optional): Set totrueto replace a file that already exists at thatalias. Without it, uploading to an existingaliasreturns409. Supported on both this endpoint and the earlier one.
- Form Data :
file: The path to the local file being uploaded. The form field must be namedfile.
Example: Upload API Request#
macOS / Linux
curl --request POST \ --url 'https://storvia.n7.io/v1/upload?domain_name=example.com&alias=images%2Fphoto.jpg' \ --header 'Authorization: Token <api-key-of-service-account>' \ --form 'file=@/path/to/photo.jpg'Windows (PowerShell) — quote the URL and use the full file path:
curl.exe --request POST ` --url "https://storvia.n7.io/v1/upload?domain_name=example.com&alias=images%2Fphoto.jpg" ` --header "Authorization: Token <api-key-of-service-account>" ` --form "file=@C:/Users/n7/Downloads/photo.jpg"
To replace a file that already exists, add &overwrite=true to the URL:
curl --request POST \
--url 'https://storvia.n7.io/v1/upload?domain_name=example.com&alias=images%2Fphoto.jpg&overwrite=true' \
--header 'Authorization: Token <api-key-of-service-account>' \
--form 'file=@/path/to/photo.jpg'Two things that are easy to get wrong:
- The
aliasis a query parameter, so any/in the path must be written as%2F—images%2Fphoto.jpgarrives asimages/photo.jpg. - The form field must be named
file.--form 'upload=@...'is rejected.
Do not set a
Content-Typeheader yourself — your HTTP client sets the correctmultipart/form-databoundary automatically.
Example: Upload API Response#
A successful upload returns 201 Created:
{
"key": "{domain}/xx/xx/xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"alias": "images/photo.jpg"
}Upload API Response Explanation#
Here,
key: The full storage path of the uploaded file in N7 Storage. This is used internally to locate the file.alias: The resource path that can be used to access the file via your domain.
Common Errors#
| Status | Meaning |
|---|---|
400 | The alias breaks the naming rules
, a required parameter is missing, or the Authorization header does not use the Token scheme. |
401 | The service token is missing or invalid. |
403 | The storage quota for the account has been exceeded. |
409 | A file already exists at that alias. Add overwrite=true to replace it. |
Earlier API version#
The original endpoint remains available for existing integrations:
POST https://storvia.n7.io/upload/{domain}/{resource_path}It behaves the same way — including ?overwrite=true — but the resource path is part of the URL rather than a query parameter, so characters such as ? and # in a path can corrupt the request. New integrations should use /v1/upload.