SFTP Storage API
SFTP hosts, regions, and users (v2.10)
Overview
Commands go to POST https://api.rackcorp.net/api/rest/v2.10/json.php
with Authorization: Bearer YOUR_JWT_TOKEN.
Hosts are storage.sftp.*. Users on a host are storage.sftp.users.*.
List responses use storagesftp for hosts, storagesftpregions for regions, and sftpaccounts for users.
POST storage.sftp.region.getall
List regions before creating a host. Each region includes sftpregionid, sftpregionname, and sftpregioncode.
{
"cmd": "storage.sftp.region.getall"
}
Hosts
POST storage.sftp.getall / storage.sftp.get
storage.sftp.get and storage.sftp.getall share one handler. Pass id for a single host. List filters include sftpname, sftpstatus (for example ACTIVE), stdname, resStart, and resWindow.
{
"cmd": "storage.sftp.getall",
"sftpname": "uploads",
"sftpstatus": "ACTIVE",
"resStart": 0,
"resWindow": 50
}
POST storage.sftp.create
{
"cmd": "storage.sftp.create",
"sftpname": "acme-uploads",
"sftpcustomerid": 456,
"sftpregionid": 1,
"sftpstatus": "ACTIVE"
}
| Parameter | Required | Description |
|---|---|---|
sftpname | Yes | Unique per customer among hosts that are not deleted. |
sftpcustomerid | Yes | Customer id. |
sftpregionid | Yes | Region from storage.sftp.region.getall. |
sftpstatus | No | ACTIVE (default) or INACTIVE. |
POST storage.sftp.update
Same fields as create, plus id. Customer is not changed on update. The host returns to operational status PENDING.
POST storage.sftp.delete
{
"cmd": "storage.sftp.delete",
"id": 123
}
sftpid is accepted as an alias of id. Users on the host are marked deleted with it.
Users
POST storage.sftp.users.getall
Optional filters include sftpusername, sftpuserstatus, resStart, and resWindow. Response key is sftpaccounts.
{
"cmd": "storage.sftp.users.getall",
"sftpusername": "backup",
"sftpuserstatus": "ACTIVE",
"resStart": 0,
"resWindow": 50
}
POST storage.sftp.users.create / storage.sftp.users.update
{
"cmd": "storage.sftp.users.create",
"sftpid": 123,
"sftpusername": "backup",
"sftpuserpermissions": "READ_WRITE",
"sftpuserstatus": "ACTIVE",
"sftpuserstoragegb": 100,
"sftpuserhomefolder": "/incoming"
}
| Parameter | Required | Description |
|---|---|---|
sftpid | Yes | Host id from storage.sftp.getall. |
sftpusername | Yes | At least 4 characters. Spaces are removed. Unique among users that are not deleted. |
sftpuserpermissions | Yes | READ, WRITE, or READ_WRITE. |
sftpuserstatus | Yes | ACTIVE or INACTIVE. |
sftpuserpassword | No | If empty on create, the API generates a password and returns it once in the message and in sftpaccounts.userpass. |
sftpuserstoragegb | No | Quota in GB. 0 if omitted. |
sftpuserhomefolder | No | Defaults to /. . and .. path segments are rejected. |
sftpuserexpiredate | No | Days from now until the account expires. |
id | Update | User id for storage.sftp.users.update. A new sftpuserpassword replaces the current one. |
POST storage.sftp.users.delete
{
"cmd": "storage.sftp.users.delete",
"id": 55
}