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


# Overallocation

The overallocated windows of one resource: stretches of time where the resource's booked load exceeds its capacity. Results carry one entry per resource in [`ScheduleResult.overallocations`](<https://docs.dhtmlx.com/planning-engine/js/api/types/schedule-result.md>), which is present when the project has assignments.

## Declaration

```ts
interface Overallocation {
  resource: Id;
  windows?: {
    from: DateValue;
    to: DateValue;
    capacity: number;
    peak: number;
    overload: number;
    tasks: Id[];
    reason?: string;
  }[];
}
```

## Fields

| Field | Type | Default | Description |
|---|---|---|---|
| `resource` | [`Id`](<https://docs.dhtmlx.com/planning-engine/js/api/types/common.md#id>) | - | Id of the overallocated resource. |
| `windows` | `object[]` | absent | The resource's overallocated windows, in the shape below. |

:::note
`windows` is absent, not an empty array, when a resource has no overallocated window.
:::

### Window fields

| Field | Type | Description |
|---|---|---|
| `from` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/js/api/types/common.md#datevalue>) | Start of the window, clipped to the working time of the contending tasks. A string, or a local `Date` when the project was created with `dates: "date"`. |
| `to` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/js/api/types/common.md#datevalue>) | End of the window, clipped the same way as `from`. |
| `capacity` | `number` | Capacity of the resource, in assignment `value` units (1 = 100 %). |
| `peak` | `number` | Highest load of any bucket in the window. |
| `overload` | `number` | Sum of `load − capacity` over the window's buckets. |
| `tasks` | [`Id`](<https://docs.dhtmlx.com/planning-engine/js/api/types/common.md#id>)`[]` | Ids of the tasks that book load in the window, in input order. |
| `reason` | `string` | Why leveling left the window unresolved. Present only in results of [`Project#level`](<https://docs.dhtmlx.com/planning-engine/js/api/project-level.md>). One of the values below. |

`reason` values:

| Value | Description |
|---|---|
| `"pinned-constraint"` | A contending task can't move because of a pinned constraint. |
| `"fixed-task"` | A contending task is not auto-scheduled, or is a summary. |
| `"completed"` | A contending task is complete. |
| `"priority-1000"` | A contending task has `priority` 1000. |
| `"slack-exhausted"` | Every task that could move was out of slack. |
| `"out-of-scope"` | The resource, the window or its tasks are outside the leveling `scope`. |

When several values apply, the window reports the first one in this table. For how leveling decides, see [Leveling resources](<https://docs.dhtmlx.com/planning-engine/js/resources-and-assignment/leveling-resources.md>).

## Used by

- [`Project#solve`](<https://docs.dhtmlx.com/planning-engine/js/api/project-solve.md>): `overallocations` of the returned result
- [`Project#preview`](<https://docs.dhtmlx.com/planning-engine/js/api/project-preview.md>): `overallocations` of the previewed dates
- [`Project#analyze`](<https://docs.dhtmlx.com/planning-engine/js/api/project-analyze.md>): `overallocations` over the given or current dates
- [`Project#level`](<https://docs.dhtmlx.com/planning-engine/js/api/project-level.md>): windows left after leveling, with `reason`

## Example

```js
const overallocation = {
  resource: 7,
  windows: [
    {
      from: "2026-03-09 08:00",
      to: "2026-03-10 17:00",
      capacity: 1,
      peak: 2,
      overload: 2,
      tasks: [3, 5],
    },
  ],
};
```

## Related

- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/js/api/types/schedule-result.md>) - the result that carries `overallocations`
- [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/js/api/types/load-profile.md>) - per-bucket load and capacity
- [`Project#level`](<https://docs.dhtmlx.com/planning-engine/js/api/project-level.md>) - resolving overallocation
- [Resources and assignments](<https://docs.dhtmlx.com/planning-engine/js/resources-and-assignment/resources-and-assignments.md>) - how overallocation is detected
- [Leveling Resources](<https://docs.dhtmlx.com/planning-engine/js/resources-and-assignment/leveling-resources.md>) - window reasons after leveling
