---
title: "Manually assign filaments to a print job"
method: PATCH
path: "/v1/print-jobs/{id}/filament-sources"
tags: ["Filament Consumption", "Print Jobs"]
---

# Manually assign filaments to a print job

`PATCH /v1/print-jobs/{id}/filament-sources`

## Request

- Base URL: `https://api.printhiv3d.com`
- URL: `https://api.printhiv3d.com/v1/print-jobs/{id}/filament-sources`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/printhiv3d/apis/hive-api-documentation/docs/v1/print-jobs/:id/filament-sources/patch.ts> (a function with typed inputs; its response is checked against the schema)

Assigns filaments to a print job for consumption tracking. Use this for past jobs that don't have captured filament data. Only terminal jobs (COMPLETED, FAILED, CANCELLED) can have filaments manually assigned.

## Path parameters

- `id` string, required

## Request body

- object
  - `position_basis` 'source': Positions identify project source filament indices.
  - `slots` object[], required: Array of source-filament-to-material assignments
    - `position` integer, required: Zero-based project source filament index
    - `material_id` string, uuid, required: Material ID to assign to this position
  - `organizationId` string, uuid: Organization ID (optional, defaults to user's primary organization)

## Response `200`

Filaments assigned successfully

- object: Filaments assigned successfully
  - `success` boolean
  - `job` object
    - `id` number
    - `captured_filaments` object
      - `printer_id` unknown
      - `captured_at` string
      - `slots` object[]
        - `position` number
        - `material_id` unknown
        - `material_type` unknown
        - `color` unknown
      - `source_assignments` object[]
        - `position` number
        - `material_id` unknown
        - `material_type` unknown
        - `color` unknown
      - `manual_assignment` boolean
      - `position_basis` 'slot' | 'source'

## Other responses

- `400`: Bad request - invalid input or job not in terminal state
- `404`: Print job not found
- `422`: Unprocessable - material not found
- `500`: Internal server error

## Changes

- **2026-11-05** `aceead3d83f6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/printhiv3d/apis/hive-api-documentation/changes/v1/print-jobs/:id/filament-sources/patch.md)

---

[API](https://skmtc.dev/printhiv3d/apis/hive-api-documentation.md) - [All operations](https://skmtc.dev/printhiv3d/apis/hive-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/printhiv3d/apis/hive-api-documentation/revisions/48e1ada05d57?raw)
