---
title: "What one edit to one task would move, before it is made"
method: POST
path: "/scheduling/projects/{id}/what-if-preview"
tags: ["scheduling"]
---

# What one edit to one task would move, before it is made

`POST /scheduling/projects/{id}/what-if-preview`

## Request

- Base URL: `https://api.onplana.com/api`
- URL: `https://api.onplana.com/api/scheduling/projects/{id}/what-if-preview`
- Auth: one of:
  - HTTP bearer
  - API key in header `Authorization`

Read-only. Makes the edit on a copy of the project the way a task update writes it, then runs the same schedule calculation and reflow the update would start, and returns every task whose dates would change, the project finish before and after, and who would become overallocated. Writes nothing. `apply` is the one row to write to make exactly this change (the edited task's dates and constraint, through PUT /tasks/{id} or POST /tasks/bulk-update); null when the edit changes nothing. A typed start becomes Start No Earlier Than and a typed finish Finish No Earlier Than; a Must Start On or Must Finish On keeps its type and moves. Refusals: `summaryDates` (a summary task), `finishBeforeStart`, `undated` (a slip on a task with no dates). Needs read access to the project. Only while the server switch gantt_what_if_enabled is on; off, it answers 404.

## Path parameters

- `id` string, required

## Headers

- `X-Organization-Id` string, required

## Request body

- object: Exactly one of slipDays, newStart and newFinish.
  - `taskId` string, required
  - `slipDays` integer: Working days, from the start on screen; negative pulls the task in
  - `newStart` string, date
  - `newFinish` string, date

## Response `200`

The preview, or a refusal

- object
  - `ok` boolean
  - `refusal` 'summaryDates' | 'finishBeforeStart' | 'undated': Only when ok is false
  - `apply` object, nullable
    - `taskId` string
    - `data` object
      - `startDate` string, date
      - `dueDate` string, date
      - `constraintType` 'SNET' | 'FNET' | 'MSO' | 'MFO'
      - `constraintDate` string, date
  - `moves` object[]
    - `taskId` string
    - `title` string
    - `isMilestone` boolean
    - `edited` boolean: The task the edit was made on
    - `fromStart` string, date, nullable
    - `toStart` string, date, nullable
    - `fromFinish` string, date, nullable
    - `toFinish` string, date, nullable
    - `startDelta` integer, nullable: Working days, positive when later
    - `finishDelta` integer, nullable: Working days, positive when later
  - `finish` object
    - `before` string, date, nullable
    - `after` string, date, nullable
    - `delta` integer: Working days, positive when the plan finishes later
  - `autoScheduleOff` boolean: The project's automatic scheduling is off, so only the edited task moves
  - `overallocations` object[]

---

[API](https://skmtc.dev/onplana/apis/onplana-api.md) · [All operations](https://skmtc.dev/onplana/apis/onplana-api/llms.txt) · [OpenAPI document](https://skmtc.dev/onplana/apis/onplana-api/revisions/c3d6c89e9dc8?raw)
