PanelDOCSv1.0.0

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/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-jobs
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-jobs
curl -s -X DELETE -H "$H" $A/accounts/sarahbakes/cron-jobs/12
json
{
    "ok": true,
    "data": [
        {
            "id": 12,
            "schedule": "*/15 * * * *",
            "command": "php web/example.com/public_html/cron.php",
            "created_at": "2026-05-02 10:00:00"
        }
    ],
    "meta": { "total": 1, "page": 1, "per_page": 50, "total_pages": 1 }
}
Field What it does
schedule required; 5 fields: minute hour day month weekday
command required; one line, up to 900 characters

GET …/cron-jobs/{id} answers one job. 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-accounts
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-accounts
curl -s -X POST -H "$H" -H "Content-Type: application/json" -d '{}' $A/accounts/sarahbakes/ftp-accounts/designer@example.com/password
curl -s -X DELETE -H "$H" $A/accounts/sarahbakes/ftp-accounts/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"
    }
}

The list answers each account's login, folder, quota_mb and created_at; GET …/ftp-accounts/{login} answers one. Deleting an FTP account keeps the files it could see.