Modulify

Edit a scheduled job

update_site_cron

Changes the name, the schedule or the step of one scheduled job on a site.

Scopeconfig:writeMakes changes

Only the fields you send change, but each one you do send replaces rather than merges. A new schedule or step is checked the same way as on create_site_cron.

Sending schedule replaces the whole schedule object including its Timezone, so a schedule sent without one resets the job to UTC and moves when it fires. Its Kind decides the fields it needs: hourly needs Minute, daily needs Hour and Minute, weekly needs DaysOfWeek, Hour and Minute, monthly needs DayOfMonth, Hour and Minute, and cron needs Expression. The tool tells the client to re-check a new schedule with preview_cron_schedule first.

Sending steps replaces the step, so a header left out of a new header list is dropped and a Method left out goes back to POST. A literal header sent with no Value keeps its saved value, as long as the step's Url stays the same.

A step Url that was listed with mdh_<redacted> can be sent back exactly as listed to keep the saved URL. Any other URL holding mdh_<redacted> is refused. See Scheduled jobs.

Inputs

Input Type Required Description
projectId string Yes The site id.
cronId string Yes The job id from list_site_crons.
name string No A new name, cut to 64 characters. It cannot be set to an empty string.
schedule object No When the job runs, in UTC unless Timezone names a zone. Its fields are Kind (hourly, daily, weekly, monthly or cron), Minute (0 to 59), Hour (0 to 23), DaysOfWeek (a list of integers from 0 to 6, Sunday is 0), DayOfMonth (1 to 31), Expression (a five field cron expression, used only when Kind is cron) and Timezone (an IANA zone name such as Europe/Berlin). It replaces the whole schedule, so leaving Timezone out resets the job to UTC.
steps array of objects No What the job does, as exactly one HTTP request that replaces the current one. Its fields are Type (always http.request), Name (a label cut to 64 characters, which never renames the job, so send name for that), Url (the absolute https URL to call, where private and loopback addresses are refused), Method (GET, HEAD, POST, PUT, PATCH or DELETE), Headers (up to 20, each with Name, Source set to literal or secret, Value and Secret) and Body (up to 32,000 characters). GET and HEAD send no body. A header named Host, Content-Length, Transfer-Encoding, Connection, Keep-Alive, Upgrade, TE, Trailer or Expect, or starting with Proxy-, is refused, and so is the same name twice.