[Canonical page](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-update/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# TaskUpdate

A partial edit of one existing task: its `id` plus the fields to change. It appears as an entry of `tasks.update` in a [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md>) set. To add a task, send a [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>) record in `tasks.add` instead.

Each field has three states. Left out, it keeps its current value. A value sets it. `null` clears an optional field or puts a field that always has a value back to its default. Field names are snake_case, and a record must be a JSON object. Unknown fields are ignored, so an entry of [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md>)`.updates` can be sent back as a `TaskUpdate` as it is. See [Wire format](<https://docs.dhtmlx.com/planning-engine/wasm/wire-format.md#omitted-null-and-unknown-fields>).

## Fields

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `id` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>) | yes | - | Id of the task to change |
| `parent` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>) \| `null` | no | unchanged | New parent summary. `null`, `""` and a value equal to `config.root_id` move the task to the top level |
| `start_date` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) \| `null` | no | unchanged | New start date. `null` clears it |
| `end_date` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) \| `null` | no | unchanged | New end date. `null` clears it |
| `duration` | `number` \| `null` | no | unchanged | New working time in the task's `duration_unit`. `null` clears it |
| `constraint_type` | [`ConstraintType`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#constrainttype>) \| `""` \| `null` | no | unchanged | `"asap"`, `"alap"`, `"snet"`, `"snlt"`, `"fnet"`, `"fnlt"`, `"mso"` or `"mfo"`. `""` and `null` remove the constraint |
| `constraint_date` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) \| `null` | no | unchanged | Date of a dated constraint. `null` clears it |
| `auto_scheduling` | `boolean` \| `null` | no | unchanged | `false` fixes the task. `null` resets it to `true` |
| `unscheduled` | `boolean` \| `null` | no | unchanged | `true` takes the task and its descendants out of the plan. `null` resets it to `false` |
| `progress` | `number` \| `null` | no | unchanged | Completion from `0` to `1`. `null` resets it to `0` |
| `calendar_id` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>) \| `null` | no | unchanged | Calendar the task works on. `null` clears it, so the default calendar applies (or the inherited one with `calendar_mode: "task-inherited"`) |
| `priority` | `number` \| `null` | no | unchanged | Leveling priority, a whole number from `0` to `1000`. `null` resets it to `500` |
| `leveling_delay` | `number` \| `null` | no | unchanged | Elapsed time before the task's driven start, in the task's `duration_unit`. `null` resets it to `0` |
| `pauses` | [`Pause`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#pause>)`[]` \| `null` | no | unchanged | Replaces the whole list of leveling splits. `[]` and `null` remove every pause |

`type` and `duration_unit` aren't fields of `TaskUpdate`. Sent in an update, they're ignored like any unknown field. See [What change sets can't do](<https://docs.dhtmlx.com/planning-engine/wasm/live-projects/editing-a-project.md#what-change-sets-cant-do>).

Which of `start_date`, `end_date` and `duration` an update keeps and which it derives is described in [Which dates a task update keeps](<https://docs.dhtmlx.com/planning-engine/wasm/live-projects/editing-a-project.md#which-dates-a-task-update-keeps>). An update without dates keeps the stored start and duration, unless it changes `pauses` or `leveling_delay`. See [Delays and pauses](<https://docs.dhtmlx.com/planning-engine/wasm/resources-and-assignment/leveling-resources.md#delays-and-pauses>).

:::note
An unknown `constraint_type`, a `priority` outside 0..1000 or an invalid date fails the whole call with a `validation` error that has no `path`. In `apply`, this means no operation from that change set is applied. Other invalid values reject only this update. It's listed in [`ApplyReport`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-apply.md#applyreport>)`.rejected`.
:::

## Used by

- [`JsonProject.apply`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-apply.md>) and [`JsonProject.preview`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-preview.md>): in `SchedulingChanges.tasks.update`
- [`JsonProject.evaluate`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-evaluate.md>): in a candidate's `changes.tasks.update`
- [`JsonProject.suggestAssignments`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-suggest-assignments.md>): returned in `result.changes.tasks.update` when `clearFirst` is set

## Example

A drag, a resize, a new constraint, a reparent and a leveling reset:

```json
[
  { "id": "design", "start_date": "2026-08-12 08:00" },
  { "id": "build", "duration": 6 },
  { "id": "review", "constraint_type": "snet", "constraint_date": "2026-08-20 08:00" },
  { "id": "docs", "parent": "phase2" },
  { "id": "test", "leveling_delay": 0, "pauses": [] }
]
```

## Related

- [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md>) - the change set that carries updates
- [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>) - the full task record
- [`Mutation`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md#mutation>) - result entries that decode as updates
- [Editing a Project](<https://docs.dhtmlx.com/planning-engine/wasm/live-projects/editing-a-project.md>) - which dates an update keeps
- [Clear leveling](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/clear-leveling.md>) - resetting delays and pauses
