For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create account cron job

Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.

Create account cron job

post

Creates a cron job for the specified account from a schedule expression and a command.

Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
Body
timestringRequired

Cron schedule expression (for example "0 2 * * *" runs daily at 02:00).

Example: 0 2 * * *
commandstringRequired

Command to execute on the schedule.

Example: php /home/u123456789/cleanup.php
Responses
200

Success response

application/json
uidstringOptional

Unique identifier of the cron job. Use it to delete the cron job or fetch its output.

Example: cron_abc123
usernamestringOptional

Username of the account that owns the cron job.

Example: u123456789
timestringOptional

Cron schedule expression.

Example: 0 2 * * *
commandstringOptional

Command executed on the schedule.

Example: php /home/u123456789/cleanup.php
post/api/hosting/v1/accounts/{username}/cron-jobs
POST /api/hosting/v1/accounts/{username}/cron-jobs HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "time": "0 2 * * *",
  "command": "php /home/u123456789/cleanup.php"
}
{
  "uid": "cron_abc123",
  "username": "u123456789",
  "time": "0 2 * * *",
  "command": "php /home/u123456789/cleanup.php"
}

Last updated

Was this helpful?