link_dependency
Create a dependency between two tasks. Type is one of FINISH_TO_START (default, successor starts when predecessor finishes), START_TO_START, FINISH_TO_FINISH, START_TO_FINISH. Lag defaults to integer days; pass lagUnit "hours" or "minutes" for a finer lag (stored to the minute, applied to the schedule at whole-day resolution for now). Negative values create lead time (successor starts before predecessor finishes). One pair may hold several types at once (e.g. an SS and an FF); the SAME type twice is refused. The server rejects self-dependencies and cyclic chains, and surfaces a clear error if the dependency graph is too large to validate safely. Both tasks must be visible to you. Re-linking the same type with the same lag succeeds as a no-op (alreadyLinked: true); the same type with a different lag is refused with the existing edge named. The two tasks may sit in different projects: the successor is then scheduled after the predecessor, the response carries crossProject: true, and the constraint runs one way, since the predecessor project is scheduled without reference to the successor project. rescheduled counts the tasks the link moved; in a project with automatic scheduling off it is 0 and the response carries autoScheduleOff: true, because there only Recalculate moves dates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag | No | Lag amount in lagUnit. Default 0. Negative for lead time. | |
| type | No | Default FINISH_TO_START. Use FINISH_TO_FINISH for "wait for predecessor to wrap before declaring this done." | |
| dryRun | No | Preview only: report the would-be link (type, lag) plus wouldCreateCycle / alreadyExists flags, without committing. Writes nothing. | |
| lagUnit | No | Unit for lag: days (default), hours, or minutes. | |
| successorId | Yes | Task that depends on the predecessor. | |
| predecessorId | Yes | Task that must complete (or start, depending on type) first. |