1. Home
  2. Docs
  3. Developer Guide
  4. API
  5. FTP Accounts

FTP Accounts

The ftp function manages extra FTP accounts of a hosting account.

URL: https://YOUR-SERVER:2304/v1/ftp/ — permission FTP.

Create (action=add)

ParameterDescription
userHosting account username
userftpFTP login name (part before @)
domainftpThe account’s main domain — the full FTP username becomes userftp@domainftp
passftpFTP password
pathftpFolder relative to the account’s home folder, for example public_html or public_html/shop
curl -k -X POST https://203.0.113.10:2304/v1/ftp/ \
  -d "key=YOUR_API_KEY&action=add&user=john&userftp=deploy&domainftp=example.com&passftp=S3cretPass&pathftp=public_html"
{"status":"OK","msj":"ftp account created successfully"}

List (action=list)

curl -k -X POST https://203.0.113.10:2304/v1/ftp/ -d "key=YOUR_API_KEY&action=list&user=john"
{"status":"OK","msj":[{"user":"john","path":"/home/john/"},{"user":"deploy@example.com","path":"/home/john/public_html/"}]}

The first entry is the account’s main FTP login.

Change the password (action=udp)

Send user, userftp (full name, for example deploy@example.com) and the new passftp.

Delete (action=del)

curl -k -X POST https://203.0.113.10:2304/v1/ftp/ -d "key=YOUR_API_KEY&action=del&user=john&userftp=deploy@example.com"
{"status":"OK","msj":"Ftp account successfully removed"}

The files in the folder are not deleted.

Related

Was this article helpful to you? No Yes