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


# ProjectData

The full project snapshot: scheduling config, calendars, tasks, links, resources and assignments. It's the `data_json` argument of [`schedule`](<https://docs.dhtmlx.com/planning-engine/wasm/api/schedule.md>), [`JsonProject.solve`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-solve.md>) and [`JsonProject.analyze`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-analyze.md>), sent as JSON text. `ProjectData` is an import format: no call returns it.

:::note
`tasks` is required in `ProjectData`; send `"tasks": []` for an empty project.
:::

## Fields

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `config` | [`SchedulingConfig`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-config.md>) \| `null` | no | all defaults | Project-wide scheduling settings. `null` gives the default config. |
| `calendars` | [`CalendarData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/calendar-data.md>)`[]` | no | `[]` | Working calendars. Without a `"global"` entry, the built-in global calendar applies: Monday to Friday, 08:00-12:00 and 13:00-17:00. |
| `tasks` | [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>)`[]` | yes | - | Tasks, summaries and milestones. |
| `links` | [`LinkData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/link-data.md>)`[]` | no | `[]` | Dependencies between tasks. |
| `resources` | [`ResourceData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#resourcedata>)`[]` | no | `[]` | Resources that assignments book. |
| `assignments` | [`AssignmentData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/assignment-data.md>)`[]` | no | `[]` | Resource bookings on tasks. |

The payload must be a JSON object. The five lists can be omitted, but not set to `null`: `"links": null` fails with `parse`. Unknown top-level fields are ignored. Field spelling and `null` handling are described in [Wire format](<https://docs.dhtmlx.com/planning-engine/wasm/wire-format.md#omitted-null-and-unknown-fields>).

## Validation

The snapshot is decoded first, then checked as a whole. Decoding errors return `kind: "parse"` with `path: null`:

- the payload isn't a JSON object
- `tasks` is missing or `null`
- a list field is `null` or not an array

After decoding, every record is checked against its own rules (listed on each record's page), and the snapshot is checked across records. A failed check returns `kind: "validation"` with `path` pointing at the offending record or field:

| Check | Example `path` |
|---|---|
| Duplicate id within `tasks`, `links`, `resources`, `assignments` or `calendars`. Ids compare like JavaScript object keys, so `1` and `"1"` collide. | `tasks[1].id`, `calendars[1]` |
| A task `parent` that names no task in the snapshot. | `tasks[0].parent` |
| A cycle in the task hierarchy. | `tasks[0].parent` |
| A task `calendar_id`, or a resource `calendar_id` in `"resource"` calendar mode, that names no calendar. | `tasks[0].calendar_id` |
| An assignment `task` or `resource` that names no record in the snapshot. | `assignments[0].resource` |

A link whose `source` or `target` names no task isn't an error. The link is dropped and reported as a `dropped-link` note in the result.

These are the strict-mode rules. [`schedule`](<https://docs.dhtmlx.com/planning-engine/wasm/api/schedule.md>) always validates strictly; a [`JsonProject`](<https://docs.dhtmlx.com/planning-engine/wasm/api/json-project.md>) created with `{"validation": "repair"}` fixes some of these inputs instead and reports each fix as a `repaired` note. Repair fills missing task dates from `config.project_start` or from other dated tasks, so an entirely undated project is still rejected.

## Used by

- [`schedule`](<https://docs.dhtmlx.com/planning-engine/wasm/api/schedule.md>) - `data_json`, required
- [`JsonProject.solve`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-solve.md>) - `data_json`, optional; replaces the project's data
- [`JsonProject.analyze`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-analyze.md>) - `data_json`, optional; the dates to analyze

## Example

```json
{
  "config": { "duration_unit": "day", "apply_constraints": true },
  "calendars": [
    { "id": "global", "worktime": { "hours": ["9:00-13:00", "14:00-18:00"] } }
  ],
  "tasks": [
    { "id": "phase", "type": "summary" },
    { "id": "design", "parent": "phase", "start_date": "2026-08-10", "duration": 3 },
    { "id": "build", "parent": "phase", "start_date": "2026-08-10", "duration": 5 },
    { "id": "release", "type": "milestone", "start_date": "2026-08-21" }
  ],
  "links": [
    { "id": "l1", "source": "design", "target": "build", "type": "fs" },
    { "id": "l2", "source": "build", "target": "release", "type": "fs" }
  ],
  "resources": [{ "id": "dev", "capacity": 1 }],
  "assignments": [
    { "task": "design", "resource": "dev", "value": 1 },
    { "task": "build", "resource": "dev", "value": 1 }
  ]
}
```

## Related

- [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>) - task records
- [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md>) - edits after the data is loaded
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md>) - what scheduling returns
- [Project data](<https://docs.dhtmlx.com/planning-engine/wasm/scheduling/project-data.md>) - building a snapshot and its validation rules
- [Accept messy input](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/accept-messy-input.md>) - repair mode for imperfect data
