---
title: "Set dependencies — GanttFather API"
description: "Replace a task's whole predecessor set."
canonical: "https://ganttfather.com/docs/api/set-dependencies/"
locale: "en"
category: "product"
---

# Set dependencies — GanttFather API

API reference [AI assistants (MCP)](https://ganttfather.com/docs/ai-agent/)

## Getting started

- [Introduction](https://ganttfather.com/docs/api/introduction/)
- [Authentication](https://ganttfather.com/docs/api/authentication/)
- [Pagination](https://ganttfather.com/docs/api/pagination/)
- [Rate limits & quotas](https://ganttfather.com/docs/api/rate-limits/)
- [Errors](https://ganttfather.com/docs/api/errors/)

## Projects

- [GET List projects](https://ganttfather.com/docs/api/list-projects/)
- [GET Get project](https://ganttfather.com/docs/api/get-project/)

## Tasks

- [GET List tasks](https://ganttfather.com/docs/api/list-tasks/)
- [GET Get task](https://ganttfather.com/docs/api/get-task/)
- [POST Create task](https://ganttfather.com/docs/api/create-task/)
- [PATCH Update task](https://ganttfather.com/docs/api/update-task/)
- [DELETE Delete task](https://ganttfather.com/docs/api/delete-task/)
- [POST Reorder tasks](https://ganttfather.com/docs/api/reorder-tasks/)
- [PUT Set assignees](https://ganttfather.com/docs/api/set-assignees/)

## Dependencies

- [GET List dependencies](https://ganttfather.com/docs/api/list-dependencies/)
- [PUT Set dependencies](https://ganttfather.com/docs/api/set-dependencies/)
- [POST Add dependency](https://ganttfather.com/docs/api/add-dependency/)
- [DELETE Remove dependency](https://ganttfather.com/docs/api/remove-dependency/)

## Resources

- [GET List resources](https://ganttfather.com/docs/api/list-resources/)
- [POST Create resource](https://ganttfather.com/docs/api/create-resource/)
- [PATCH Update resource](https://ganttfather.com/docs/api/update-resource/)
- [DELETE Delete resource](https://ganttfather.com/docs/api/delete-resource/)

## Members

- [GET List members](https://ganttfather.com/docs/api/list-members/)

 Dependencies / **Set dependencies**

# Set dependencies

 PUT

 Updated Jul 4, 2026

 **Replaces** the task’s entire predecessor set. Pass [] to clear all dependencies.

 On success the API returns 200 OK with the task id and resolved predecessor count.

## Path parameters

 Name Type Required Description

 taskId string (uuid) Yes The dependent task.

## Request body

 An array of items, each:

 Name Type Required Description

 predecessorId string (uuid) Yes The predecessor task.

 type string No FS (default), SS , FF , or SF .

 lag integer No Days, -365 … 365 . Defaults to 0 .

 Graph rules (same as everywhere in GanttFather): predecessor must be in the **same project**, must be a **sibling** (same parent), no **cycles**, and at most **100** predecessors per task. Violations return 400 with one of invalid_dependency , invalid_lag , invalid_dependency_type , cross_project , not_siblings , cycle_detected , or graph_too_large — see [Errors →](https://ganttfather.com/docs/api/errors/).

 curl -X PUT https://api.ganttfather.com/v1/tasks/{taskId}/dependencies \
 -H "Authorization: Bearer glt_YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '[
 { "predecessorId": "0198f1a2-2222-7c9e-9a1f-2d4e5f6a7b8c", "type": "FS", "lag": 0 }
 ]'

 Response 200 OK

 {
 "taskId": "0198f1a2-6b3d-7c9e-9a1f-2d4e5f6a7b8c",
 "count": 2,
 "changed": true
}

 Rather not write REST?

## Connect an AI assistant instead.

 [Explore MCP setup →](https://ganttfather.com/docs/ai-agent/)
