Get your free beta license ↗
API operation · cron group
PATCH

/users/{name}/cron/jobs/{id}

First published 3 Oct 20260.1.0Unchanged since publication

Update a cron job's schedule, command, or both

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesall
Answers200 OK

Use the job ID returned by GET /users/{name}/cron. Provide a non-null value for schedule, command, or both. A field you omit or set to null keeps its current value. If the crontab has no MAILTO line, UrbeStack adds MAILTO="" at the top to suppress email from cron.

For schedule, use a cron keyword such as @daily or supply five fields in order: minute, hour, day of the month, month, and day of the week. The fields support *, numbers, ranges, lists, and steps. You can use a three-letter month or weekday name on its own in the corresponding field. The schedule can be up to 200 characters after the API trims and collapses whitespace.

Supply a nonblank command on one line. Cron runs it as the customer with /bin/sh. Cron treats % as a line break. Use \% for a literal percent sign.

The API returns 404 if no job line matches id. Editing a job line changes its ID, so a request using the old ID is refused. UrbeStack also refuses updates while the crontab is set aside. The API returns 400 if id is invalid, if neither schedule nor command has a non-null value, if either supplied value is invalid, or if name identifies an administrator.

Customers can update their own jobs, resellers can update their customers' jobs, and administrators can update any customer's jobs. The token must have the files scope.

As a command

Run as root on the server

Parameters

namepath ·UsernameRequired
idpath ·string, matching ^[0-9a-f]{12}$Required

Request body

JSON ·CronJobPatch· 2 fields
commandstring, up to 998 characters
schedulestring, up to 200 characters

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PATCH "$API/users/alice/cron/jobs/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "command": "text",
    "schedule": "text"
  }'
Response · 200 OK
{
  "job": {
    "command": "text",
    "day": "2026-09-09",
    "hour": "text",
    "id": 1,
    "line": 1,
    "minute": "text",
    "month": "text",
    "schedule": "text",
    "weekday": "text"
  }
}

Errors

14 errors, each a status and a sentence
400--id is required
400--user is required
400<name> is an administrator: administrators have no system account, so no cron jobs
400<what> must be text
400A schedule is five fields (minute, hour, day of the month, month, day of the week) or a keyword such as @daily
400Invalid job id
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change: give --schedule, --command-stdin or both
400Nothing to change: give schedule, command or both
400The command is one line: no line breaks
400Username '<value>' is reserved
400command is required
401Authentication required
404User '<user>' not found
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/patch-users-name-cron-jobs-id/