---
title: "Link Task Material"
method: POST
path: "/api/v1/tasks/{task_id}/materials"
tags: ["v1", "Tasks", "tasks"]
---

# Link Task Material

`POST /api/v1/tasks/{task_id}/materials`

## Request

- Base URL: `https://api.jeevyfabrication.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jeevyfabrication.com/api/v1/tasks/{task_id}/materials`
- Auth: none declared

Link one material line item to a task, or a whole PO group at once.

Single: ``{"manual_material_item_id": 12, "quantity": 2}``
Batch:  ``{"items": [{"manual_material_item_id": 12, "quantity": 2}, ...]}``

## Path parameters

- `task_id` integer, required

## Request body

- TaskMaterialLink: Link one item, or a whole PO group at once. ONE ENDPOINT, TWO SHAPES. The picker's "+ Link" sends a single item and its "Link All (N)" sends the group; splitting them into two routes would mean two permission checks, two recompute triggers and two chances for those to drift. Exactly one of the two shapes must be present — a body carrying both is a caller bug, not a merge, and is rejected rather than silently favouring one.
  - `manual_material_item_id` integer, nullable
  - `quantity` number, nullable
  - `items` TaskMaterialLinkItem[], nullable
    - `manual_material_item_id` integer, required
    - `quantity` number, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api.md) - [All operations](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/revisions/ad9a01abeac9?raw)
