---
title: "Add a dependency to a task"
method: POST
path: "/tasks/{task_id}/dependencies"
tags: ["Tasks"]
---

# Add a dependency to a task

`POST /tasks/{task_id}/dependencies`

## Request

- Base URL: `https://api-docs.jackhamr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.jackhamr.ai/tasks/{task_id}/dependencies`
- Auth: none declared

Mark ``depends_on_task_id`` as a prerequisite of ``task_id``.

Both tasks must exist and belong to the caller's org. Self-deps
and duplicates are rejected (409). The dependency is stored as an
id in the task's JSON ``dependencies`` array.

## Path parameters

- `task_id` string, required

## Request body

- DependencyCreate: Request body for ``POST /api/v1/tasks/{id}/dependencies``. Identifies the task that ``{id}`` should wait on (the new prerequisite). The dependent task is the ``{id}`` path param.
  - `depends_on_task_id` string, required

## Response `201`

Successful Response

- DependencyOut: A single task dependency edge. Mirrors the internal ``TaskEdge`` (from -> to) but with explicit field names so the public shape is unambiguous. ``from_task_id`` is the prerequisite task; ``to_task_id`` is the dependent task.
  - `from_task_id` string, required
  - `to_task_id` string, required

## Other responses

- `422`: Validation Error

---

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