---
title: "Create account cron job"
method: POST
path: "/api/hosting/v1/accounts/{username}/cron-jobs"
tags: ["Hosting: Cron Jobs"]
---

# Create account cron job

`POST /api/hosting/v1/accounts/{username}/cron-jobs`

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.

## Path parameters

- `username` string, required

## Request body

- HostingV1CronJobsCreateCronJobRequest
  - `time` string, required — Cron schedule expression (for example "0 2 * * *" runs daily at 02:00).
  - `command` string, required — Command to execute on the schedule.

## Response `200`

Success response

- HostingV1CronJobsCronJobResource
  - `uid` string — Unique identifier of the cron job. Use it to delete the cron job or fetch its output.
  - `username` string — Username of the account that owns the cron job.
  - `time` string — Cron schedule expression.
  - `command` string — Command executed on the schedule.

## Other responses

- `401` — Unauthenticated response
- `422` — Validation error response
- `500` — Error response

---

[API](https://skmtc.net/hostinger/apis/hostinger-api.md) · [All operations](https://skmtc.net/hostinger/apis/hostinger-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hostinger/hostinger-api/revisions/fcb2ecfdfabd/schema)
