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


# LevelingOptions

The options of a resource leveling run: which resources, tasks and dates it acts on, the detection bucket, the selection order and how tasks may move. It's the `options_json` argument of [`JsonProject#level`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-level.md>), and the `level` field of [`EvaluateOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-evaluate.md#evaluateoptions>) and [`SuggestOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-suggest-assignments.md#suggestoptions>). Every field is optional, so `"{}"` gives the defaults.

## Fields

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `scope` | [`object`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/leveling-options.md#scope-fields>) | no | whole project | Resources, tasks and date range the run acts on. |
| `basis` | `"hour"` \| `"day"` | no | derived | Detection bucket: `"hour"` or `"day"`. Derived from `config.duration_unit`: `"day"` for `day`, `"hour"` for `hour` and `minute`. |
| `order` | `"id"` \| `"standard"` \| `"priority"` | no | `"standard"` | Which contender moves first in an overallocated bucket. `"id"`: the task later in input order. `"standard"`: dependencies, then slack, dates, `priority` and constraints decide. `"priority"`: lower task `priority` moves first, then as `"standard"`. |
| `withinSlackOnly` | `boolean` | no | `false` | Caps each delay or pause at the task's total slack. |
| `clearFirst` | `boolean` | no | `true` | Clears `leveling_delay` and `pauses` on in-scope tasks before leveling. |
| `allowSplits` | `boolean` | no | `true` | Allows `pauses` proposals. With `false`, every correction is a whole-task delay, and existing pauses are kept but never extended. |
| `step` | `"minimal"` \| `"skip"` | no | `"minimal"` | Proposal size. `"minimal"` moves a task past one overallocated bucket. `"skip"` moves it past the whole overallocated window that starts there. |

An omitted field and a `null` field both mean the default. Unknown fields fail with `parse`; there's no `maxRounds` option. A value of the wrong JSON type (for example `"allowSplits": "no"`) fails with `parse`, and an unknown string for `basis`, `order` or `step` fails with `validation` and no `path`. See [Wire format](<https://docs.dhtmlx.com/planning-engine/wasm/wire-format.md#omitted-null-and-unknown-fields>).

The selection orders and step sizes are explained in [Leveling resources](<https://docs.dhtmlx.com/planning-engine/wasm/resources-and-assignment/leveling-resources.md#selection-order>).

### Scope fields

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `resources` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>)`[]` | no | all resources | Resources whose overallocation is resolved. Each id must exist (`validation`, `path: "scope.resources"`). |
| `tasks` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>)`[]` | no | all tasks | Tasks the run may move. Each id must exist (`validation`, `path: "scope.tasks"`). |
| `from` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) | no | no lower bound | Start of the triggering range. Buckets whose start lies in `[from, to)` trigger leveling. Tasks can still land after `to`. |
| `to` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) | no | no upper bound | End of the triggering range, exclusive. |

Unknown fields in `scope` also fail with `parse`. Overallocation outside the range stays in the result with the reason `out-of-scope`.

## Used by

- [`JsonProject#level`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-level.md>): the `options_json` argument
- [`JsonProject#evaluate`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-evaluate.md>): the `level` field of `EvaluateOptions`
- [`JsonProject#suggestAssignments`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-suggest-assignments.md>): the `level` field of `SuggestOptions`

## Example

```json
{
  "scope": {
    "resources": ["dev"],
    "from": "2026-08-10",
    "to": "2026-09-01"
  },
  "order": "priority",
  "withinSlackOnly": true,
  "allowSplits": false
}
```

Every field left out keeps its default: `basis` derived from the project, `clearFirst: true`, `step: "minimal"`.

## Related

- [`JsonProject.level`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-level.md>) - the call that takes these options
- [`JsonProject.evaluate`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-evaluate.md>) - scores candidates with the `level` option
- [`Overallocation`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/overallocation.md>) - windows left after leveling, with their reasons
- [Leveling Resources](<https://docs.dhtmlx.com/planning-engine/wasm/resources-and-assignment/leveling-resources.md>) - selection order, delays and pauses
- [Clear leveling](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/clear-leveling.md>) - remove delays and pauses
