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"
}
ParameterRequiredDescription
sftpnameYesUnique per customer among hosts that are not deleted.
sftpcustomeridYesCustomer id.
sftpregionidYesRegion from storage.sftp.region.getall.
sftpstatusNoACTIVE (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"
}
ParameterRequiredDescription
sftpidYesHost id from storage.sftp.getall.
sftpusernameYesAt least 4 characters. Spaces are removed. Unique among users that are not deleted.
sftpuserpermissionsYesREAD, WRITE, or READ_WRITE.
sftpuserstatusYesACTIVE or INACTIVE.
sftpuserpasswordNoIf empty on create, the API generates a password and returns it once in the message and in sftpaccounts.userpass.
sftpuserstoragegbNoQuota in GB. 0 if omitted.
sftpuserhomefolderNoDefaults to /. . and .. path segments are rejected.
sftpuserexpiredateNoDays from now until the account expires.
idUpdateUser 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
}