The ftp function manages extra FTP accounts of a hosting account.
URL: https://YOUR-SERVER:2304/v1/ftp/ — permission FTP.
Create (action=add)
| Parameter | Description |
|---|---|
user | Hosting account username |
userftp | FTP login name (part before @) |
domainftp | The account’s main domain — the full FTP username becomes userftp@domainftp |
passftp | FTP password |
pathftp | Folder 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.