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

Create website cron job

Creates a cron job for an Agency Plan website from a schedule expression and a command. Returns the created cron job, including its uuid, which is required to delete the cron job.

Create website cron job

post

Creates a cron job for an Agency Plan website from a schedule expression and a command.

Returns the created cron job, including its uuid, which is required to delete the cron job.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
website_uidstringRequired

Agency Plan website UID

Example: zpwlGlp19
Body
timestringRequired

Cron schedule expression (standard 5-field crontab syntax).

Example: */30 * * * *
commandstringRequired

Command to run on the schedule. Must not contain pipe (|) or redirection (<, >) characters.

Example: php artisan schedule:run
Responses
200

Success response

application/json
uuidstringOptional

Unique identifier of the cron job. Use it to delete the cron job.

Example: 01931d6f-68f5-7b72-8d9e-09c6e1e6aa0e
timestringOptional

Cron schedule expression.

Example: */30 * * * *
commandstringOptional

Command executed on the configured schedule.

Example: php artisan schedule:run
created_atstring · date-timeOptional

Cron job creation timestamp.

Example: 2024-10-28T12:00:00+00:00
post/api/agency-hosting/v1/websites/{website_uid}/cron-jobs
POST /api/agency-hosting/v1/websites/{website_uid}/cron-jobs HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "time": "*/30 * * * *",
  "command": "php artisan schedule:run"
}
{
  "uuid": "01931d6f-68f5-7b72-8d9e-09c6e1e6aa0e",
  "time": "*/30 * * * *",
  "command": "php artisan schedule:run",
  "created_at": "2024-10-28T12:00:00+00:00"
}

Last updated

Was this helpful?