API: cron jobs and FTP
List, add and delete a hosting account's cron jobs and FTP accounts through the token API.
These endpoints do what the Cron jobs and FTP accounts screens in Control Panel do, with the same checks, limits and activity log lines.
bash
A=https://api.yourdomain.com:2087/v1
H="Authorization: Bearer hf_xxx"
The paths name the account (/v1/accounts/{username}/…); the rules are those of every
per-account endpoint.
Cron jobs
bash
curl -s -H "$H" $A/accounts/sarahbakes/cron
curl -s -X POST -H "$H" -H "Content-Type: application/json" \
-d '{"schedule":"*/15 * * * *","command":"php web/example.com/public_html/cron.php"}' $A/accounts/sarahbakes/cron
curl -s -X DELETE -H "$H" $A/accounts/sarahbakes/cron/12
json
{
"ok": true,
"data": {
"email": "sarah@example.com",
"jobs": [
{
"id": 12,
"schedule": "*/15 * * * *",
"command": "php web/example.com/public_html/cron.php",
"created_at": "2026-05-02 10:00:00"
}
]
}
}
| Field | What it does |
|---|---|
schedule |
required; 5 fields: minute hour day month weekday |
command |
required; one line, up to 900 characters |
email in the list is where the output is emailed (empty: not emailed). Adding answers 201 with the job. An
account can have 50 cron jobs ("Maximum 50 cron jobs."); a bad schedule answers 422 "That schedule isn't valid.
Use 5 fields: minute hour day month weekday." An unknown id answers 404.
FTP accounts
bash
curl -s -H "$H" $A/accounts/sarahbakes/ftp
curl -s -X POST -H "$H" -H "Content-Type: application/json" \
-d '{"login":"designer@example.com","folder":"example.com/public_html","quota_mb":500}' $A/accounts/sarahbakes/ftp
curl -s -X POST -H "$H" -H "Content-Type: application/json" -d '{}' $A/accounts/sarahbakes/ftp/designer@example.com/password
curl -s -X DELETE -H "$H" $A/accounts/sarahbakes/ftp/designer@example.com
| Field | What it does |
|---|---|
login |
required; name@domain, the domain one of the account's websites |
folder |
the folder inside web/ the login can see; empty = all of web/ |
quota_mb |
0 = no limit |
password |
empty = a random one |
Creating answers 201; the password is shown only in this answer:
json
{
"ok": true,
"data": {
"account": {
"login": "designer@example.com",
"folder": "web/example.com/public_html",
"quota_mb": 500,
"created_at": "2026-05-02 10:05:00"
},
"password": "k9V…",
"host": "ftp.yourdomain.com"
}
}
Deleting an FTP account keeps the files it could see.