---
title: "corestack_crons_update"
url: https://docs.corefinity.com/mcp/tools/corestack_crons_update
type: tool
last_updated: 2026-11-13
feature: crons
related:
  - https://docs.corefinity.com/api/reference/site-settings/replace-site-crons.md
  - https://docs.corefinity.com/guides/sites/site-settings/scheduled-tasks.md
---
# corestack_crons_update

**Change scheduled tasks.** Replace a row's whole set of scheduled tasks: send every entry you want to keep — entries left out are removed — with the version corestack_crons_get answered. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Confirmation: `confirm_labels`
- Runs as a task: yes

## When to use it

Replace a row's whole set of scheduled tasks: send every entry you want to keep — entries left out are removed — with the version corestack_crons_get answered.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `version` (integer, ≥ 0, required): The set's version from corestack_crons_get.
- `enabled` (boolean, required): Scheduled tasks on or off for the row.
- `builtin_enabled` (boolean, or null): The built-in task's switch; absent or null keeps it.
- `entries` (array of objects, up to 49 items, required)
  - `id` (integer, or null, ≥ 1): An existing entry's id; leave it out (or null) for a new entry.
  - `label` (string, up to 60 characters, required)
  - `schedule` (string, up to 200 characters, required)
  - `command` (string, up to 20000 characters, required)
  - `command_ref` (string, or null, up to 64 characters): A hidden command's command_ref from corestack_crons_get: keeps its command.
  - `enabled` (boolean, required)
  - `no_overlap` (boolean, required)
  - `timeout` (one of `900`, `3600`, `21600`, required): Seconds.
- `confirm_labels` (array of string, up to 60 characters, up to 49 items): Removing entries: the exact label of each entry left out, as the person typed it.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "builtin_enabled": {
      "description": "The built-in task's switch; absent or null keeps it.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "confirm_labels": {
      "description": "Removing entries: the exact label of each entry left out, as the person typed it.",
      "items": {
        "maxLength": 60,
        "type": "string"
      },
      "maxItems": 49,
      "type": "array"
    },
    "enabled": {
      "description": "Scheduled tasks on or off for the row.",
      "type": "boolean"
    },
    "entries": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "command": {
            "maxLength": 20000,
            "type": "string"
          },
          "command_ref": {
            "description": "A hidden command's command_ref from corestack_crons_get: keeps its command.",
            "maxLength": 64,
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "description": "An existing entry's id; leave it out (or null) for a new entry.",
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "label": {
            "maxLength": 60,
            "type": "string"
          },
          "no_overlap": {
            "type": "boolean"
          },
          "schedule": {
            "maxLength": 200,
            "type": "string"
          },
          "timeout": {
            "description": "Seconds.",
            "enum": [
              900,
              3600,
              21600
            ],
            "type": "integer"
          }
        },
        "required": [
          "label",
          "schedule",
          "command",
          "enabled",
          "no_overlap",
          "timeout"
        ],
        "type": "object"
      },
      "maxItems": 49,
      "type": "array"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "version": {
      "description": "The set's version from corestack_crons_get.",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "version",
    "enabled",
    "entries"
  ],
  "type": "object"
}
```

## Refusals

- `stale`: the object changed since you read it; read it again and call with the new version. A `command_ref` that no longer matches its task (the command changed, or the task went) answers `stale` too.
- `confirm_mismatch`: removing entries can need their labels: an entry left out whose exact label is not in `confirm_labels` is refused and nothing changes. The answer's `labels` lists every label to send; ask the person to type each one. Turning an entry, the built-in task or the whole set off removes nothing and needs no labels.
- `invalid_arguments`: a command with a password or key written in it (`export DB_PASSWORD=…`, `mysql -p…`, `curl -u user:…`, `--password=…`, an `Authorization: Bearer …` header, a URL with a password) is refused and nothing changes, because the command is stored with the scheduled task: `fields` names the entry, `entries.<i>.command`, with the reason. An entry the site already stores is kept when its command is sent back unchanged, so it never blocks changes to the others, and its warning is in the answer's `warnings` (or in the task's status message when a change starts). Put the value in a file on the site and read it from there instead, for example `set -a; . /var/www/shop.example.com/shared/.env.cron; set +a; php bin/magento my:job`.
- `invalid_arguments` (hidden commands): the placeholder sent as `command` without its `command_ref` is refused on `entries.<i>.command`, and nothing changes; a `command_ref` that is not one corestack_crons_get gave, or that comes without the task's `id`, is refused on `entries.<i>.command_ref`.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_crons_update",
  "arguments": {
    "site_id": 4211,
    "version": 3,
    "enabled": true,
    "entries": [
      {
        "label": "Deploy key",
        "schedule": "*/15 * * * *",
        "command": "php -v",
        "enabled": true,
        "no_overlap": false,
        "timeout": 900
      }
    ]
  }
}
```

## Hidden commands

corestack_crons_get hides a stored command that has a password or key written in it: the entry's `command` is
`[hidden: this command has a password or key written in it]` and it carries a `command_ref`. Send that entry back with
both unchanged and the task keeps its stored command, even when you change its name, schedule or switches. Write a
whole new `command` to change it: it is checked like any new command (and its `command_ref` is ignored). The placeholder
is never saved as a command. The set this tool answers hides the same commands, with fresh `command_ref`s.

## Prompt

```text
Using the Corefinity MCP server, call corestack_crons_update with site_id 4211, version 3, enabled true, entries [{"label":"Deploy key","schedule":"*/15 * * * *","command":"php -v","enabled":true,"no_overlap":false,"timeout":900}]. (Change scheduled tasks.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PUT /api/corestack/sites/{site}/crons](https://docs.corefinity.com/api/reference/site-settings/replace-site-crons.md)
- Guide: [Scheduled tasks](https://docs.corefinity.com/guides/sites/site-settings/scheduled-tasks.md)
