# AutoPrintFarm Docs > Developer documentation for the AutoPrintFarm public API. ## Docs - [Failure analysis and trends](https://docs.autoprintfarm.com/api-reference/analytics/failure-analysis-and-trends.md): Returns failure counts grouped by type, by printer, daily trend, and the 20 most recent failures. Internal resolver IDs and resolution notes are not exposed. - [Inventory turnover and material usage](https://docs.autoprintfarm.com/api-reference/analytics/inventory-turnover-and-material-usage.md): Returns the lowest-stocked SKUs (top 20), filament-spool stock state, material usage totals, and daily usage trend over the date range. SKU pricing fields are never exposed. - [Per-printer utilization](https://docs.autoprintfarm.com/api-reference/analytics/per-printer-utilization.md): Returns per-printer job counts, success rate, failure count, total print hours, and utilization percentage over the date range, plus fleet-wide averages. - [Production metrics over a date range](https://docs.autoprintfarm.com/api-reference/analytics/production-metrics-over-a-date-range.md): Returns aggregate and per-day production counts (jobs completed/failed, units, print time) plus revenue from orders. Margin and cost breakdowns are never exposed. Revenue is reported only when neither printer_id nor product_id is set, since orders are not attributable to a specific printer or produc… - [Real-time dashboard overview](https://docs.autoprintfarm.com/api-reference/analytics/real-time-dashboard-overview.md): Returns live counts across printers, jobs, worklist tasks, hubs, and low-stock alerts. Internal cost / margin / profit fields are never exposed. - [Revenue breakdown](https://docs.autoprintfarm.com/api-reference/analytics/revenue-breakdown.md): Returns revenue totals, per-platform revenue, and a daily revenue series from orders that are not cancelled or refunded. Profit, margin, materials cost, labor cost, overhead cost, and inventory valuation are NEVER exposed on this endpoint. - [Assembly task counts](https://docs.autoprintfarm.com/api-reference/assembly/assembly-task-counts.md): Live aggregate of your `assembly_tasks` table. Returns the row count and summed task quantity per status, plus `total_units_awaiting` (pending + in_progress quantities). - [Complete an assembly task](https://docs.autoprintfarm.com/api-reference/assembly/complete-an-assembly-task.md): **Side effect — inventory changes.** For `kit_assembly` tasks: deducts child SKU stock and credits the parent's `finished_goods.current_stock` via `consumeForKitAssembly`. For `print_assembly` tasks: moves units from `quantity_needs_assembly` to `ready_stock` on the parent SKU and recalculates `asse… - [Create an assembly task](https://docs.autoprintfarm.com/api-reference/assembly/create-an-assembly-task.md): Creates a new `pending` assembly task for a finished good. Response strips internal cross-reference IDs. - [Get assembly task by ID](https://docs.autoprintfarm.com/api-reference/assembly/get-assembly-task-by-id.md): Returns an assembly task with the related wiki article bundled inline (absorbs `/assembly/:id/wiki`), or `null` when no article is linked. The lookup follows: product's explicit wiki_id → wiki_articles.sku_id → wiki_articles.product_id. - [List assembly tasks](https://docs.autoprintfarm.com/api-reference/assembly/list-assembly-tasks.md): Returns your post-print assembly tasks, ordered by status (in-progress first, then pending, then completed). Internal assignee user IDs and finished-good cross-references are not exposed. - [Update assembly task fields](https://docs.autoprintfarm.com/api-reference/assembly/update-assembly-task-fields.md): Updates quantity, assignee, notes, or status. Auto-stamps `completed_at` when status is set to `completed`. **Does not** clear `completed_at` if the task is moved back from `completed`, and **does not** run inventory side effects — use `POST /assembly/{id}/complete` for the inventory-aware completio… - [Add a new version to a file](https://docs.autoprintfarm.com/api-reference/files/add-a-new-version-to-a-file.md): **Side effect:** when `set_as_current=true`, the parent file is repointed at this new version. Queues a metadata extraction job. The new version's file extension must match the parent file's extension. - [Create a print file record from an uploaded file](https://docs.autoprintfarm.com/api-reference/files/create-a-print-file-record-from-an-uploaded-file.md): Pairs with `/files/upload-url` + `/files/upload/{token}`. **Side effect:** triggers synchronous 3MF/GCODE metadata extraction + thumbnail upload, then queues a backup extraction job onto FILE_PROCESSING. - [Direct upload (token is the credential)](https://docs.autoprintfarm.com/api-reference/files/direct-upload-token-is-the-credential.md): Streams the request body to the storage location encoded in the token from `POST /files/upload-url`. The token must belong to the same account as the API key; the API key itself is required for rate-limit and audit but does NOT need the `write` scope (the token is the write credential). Max file siz… - [Get print file by ID](https://docs.autoprintfarm.com/api-reference/files/get-print-file-by-id.md): Returns a single print file with its versions bundled inline (absorbs `/files/:id/versions`). Metadata only — no storage paths or download URLs. - [Get the thumbnail image](https://docs.autoprintfarm.com/api-reference/files/get-the-thumbnail-image.md): Returns raw image bytes (typically PNG) with a `Cache-Control: public, max-age=86400` header. Responds 404 with code `NO_THUMBNAIL` when the file exists but has no thumbnail, and 404 with code `FILE_NOT_FOUND` when the file itself does not exist. - [List print files (metadata only)](https://docs.autoprintfarm.com/api-reference/files/list-print-files-metadata-only.md): Returns your print file metadata. Internal storage paths, signed download URLs, and thumbnails are NEVER exposed — file downloads use a separate authentication model. - [List versions of a print file](https://docs.autoprintfarm.com/api-reference/files/list-versions-of-a-print-file.md): Returns all stored versions ordered by `version_number` descending. The current version has `is_current_version: true`. The same versions are also bundled inline on `GET /files/{id}`. - [Parse 3MF / GCODE metadata without storing](https://docs.autoprintfarm.com/api-reference/files/parse-3mf-gcode-metadata-without-storing.md): Pre-flight parser. Accepts a multipart `file` field (3MF or GCODE only) and returns printer model, print time, filament weight, layer count, etc. The file is never persisted. Use this to surface metadata to the user before committing to an `/files` upload. - [Promote a version to current](https://docs.autoprintfarm.com/api-reference/files/promote-a-version-to-current.md): Sets the named version as current and repoints the parent file at it. - [Request a signed upload URL](https://docs.autoprintfarm.com/api-reference/files/request-a-signed-upload-url.md): Mints a signed token bound to your account. Use the returned `upload_url` (token in the path) with `PUT /files/upload/{token}` to upload the file directly. Token TTL = 1 hour; the API key is still required on the PUT for rate-limit and audit. Tokens can be replayed within their TTL — each replay ove… - [Get hub by ID](https://docs.autoprintfarm.com/api-reference/hubs/get-hub-by-id.md): Returns a hub with its connection status and a summary of its attached printers bundled inline (absorbs `/hubs/:id/status`). `is_stale` is true when the hub has not sent a heartbeat in over 2 minutes. - [Lightweight hub connection snapshot](https://docs.autoprintfarm.com/api-reference/hubs/lightweight-hub-connection-snapshot.md): Smaller / cheaper / more pollable than `GET /hubs/{id}`. `is_stale` is true when the hub has not sent a heartbeat in over 2 minutes. Network internals (`ip_address`, `mac_address`) are never exposed. - [List hubs](https://docs.autoprintfarm.com/api-reference/hubs/list-hubs.md): Returns your registered hubs. Internal network and authentication details are never exposed. - [List printers discovered on a hub's local network](https://docs.autoprintfarm.com/api-reference/hubs/list-printers-discovered-on-a-hubs-local-network.md): Returns the most recent list of printers a hub has found on its local network, including LAN IP addresses so you can pair them. `discovered_at` is a Unix epoch millisecond timestamp, or `null` if the hub has not run a scan yet. Scans are triggered from the dashboard. - [Adjust finished-good stock with a reason](https://docs.autoprintfarm.com/api-reference/inventory/adjust-finished-good-stock-with-a-reason.md): **Side effect:** changes `finished_goods.ready_stock` by the signed `adjustment` delta and recalculates the item's status (in_stock / low_stock / out_of_stock). Returns 400 if the resulting stock would be negative. The `reason` enum excludes internal reasons (`print_completion`, `order_fulfillment`,… - [Aggregate inventory counts](https://docs.autoprintfarm.com/api-reference/inventory/aggregate-inventory-counts.md): Returns counts by status (in_stock, low_stock, out_of_stock, needs_assembly) and total stock across all active finished goods. Pricing-derived aggregates (total_value) are not exposed. - [Create a finished-goods record manually](https://docs.autoprintfarm.com/api-reference/inventory/create-a-finished-goods-record-manually.md): Rare — finished-goods rows are normally created automatically when a SKU is created. Use this only when reconciling state imported from an external system. - [Get a finished-good by its product SKU id](https://docs.autoprintfarm.com/api-reference/inventory/get-a-finished-good-by-its-product-sku-id.md): Resolves a `product_sku_id` to its single finished-good row (one finished-good per SKU). Returns the same shape as `GET /inventory/{id}` including `parts_on_hand` for composite kits. - [Get a finished-good inventory item](https://docs.autoprintfarm.com/api-reference/inventory/get-a-finished-good-inventory-item.md): Returns the finished-good record with composite-aware `available_to_build` and `effective_status`. For composite (kit) items, includes a `parts_on_hand` array showing per-child stock so callers can render a parts breakdown without a second round-trip. For non-composite items, `parts_on_hand` is `nul… - [List finished-goods inventory](https://docs.autoprintfarm.com/api-reference/inventory/list-finished-goods-inventory.md): Returns your finished-goods stock levels, ordered by SKU. Pricing columns (`unit_price`, `profit_margin`, `extra_cost`) and internal assembly workflow fields (`assembly_status`, `quantity_needs_assembly`, `print_job_id`) are never exposed. Use `GET /inventory/{id}` for the composite (kit) breakdown… - [List items at or below their low-stock threshold](https://docs.autoprintfarm.com/api-reference/inventory/list-items-at-or-below-their-low-stock-threshold.md): Returns active finished-goods rows where `ready_stock <= low_stock_threshold`, ordered by largest deficit first. Includes the parent `product_name` to save a lookup. Excludes composite kits whose buildable stock keeps their `effective_status` at `in_stock` — otherwise every kit parent at `ready_stoc… - [Set the low-stock threshold for an item](https://docs.autoprintfarm.com/api-reference/inventory/set-the-low-stock-threshold-for-an-item.md): Updates `low_stock_threshold` and recalculates the item's status based on the new threshold. - [Update finished-good metadata](https://docs.autoprintfarm.com/api-reference/inventory/update-finished-good-metadata.md): Updates `image_url`, `assembly_status`, and `is_active`. Pricing fields (`unit_price`, `extra_cost`, `profit_margin`) are not modifiable via the public API. Use `PUT /inventory/{id}/threshold` to change the alert threshold and `POST /inventory/{id}/adjust` to change stock. - [Cancel a print job](https://docs.autoprintfarm.com/api-reference/jobs/cancel-a-print-job.md): Marks the job `cancelled`. Side effect: if the job is currently `printing` or `paused`, also sends a stop command to the assigned printer's hub (fire-and-forget). Requires the `control` scope because it can halt a running print — use `/jobs/{id}/stop` when you need a wait-for-ACK guarantee instead o… - [Completed / failed / cancelled jobs](https://docs.autoprintfarm.com/api-reference/jobs/completed-failed-cancelled-jobs.md): Read-only history, ordered by `time_completed` descending. Supports `from` / `to` ISO-8601 filters. - [Enqueue a print job](https://docs.autoprintfarm.com/api-reference/jobs/enqueue-a-print-job.md): Creates a new queued print job from a `print_file_id`. The optional `printer_id` pre-assigns a printer; omit it to leave the job unassigned. Server-side checks: file must exist (`FILE_NOT_FOUND`), printer (if provided) must exist (`PRINTER_NOT_FOUND`), SKU (if provided) must exist (`SKU_NOT_FOUND`),… - [Get print job by ID](https://docs.autoprintfarm.com/api-reference/jobs/get-print-job-by-id.md): Returns a single print job with additional detail fields (filament weight, printer name/model, SKU name) beyond the list projection. - [List print jobs](https://docs.autoprintfarm.com/api-reference/jobs/list-print-jobs.md): Returns your print jobs, most recent first. Internal scheduling and tracking fields are not exposed. - [Mark a print job completed](https://docs.autoprintfarm.com/api-reference/jobs/mark-a-print-job-completed.md): Marks the job `completed`. **Side effect:** adjusts `finished_goods.current_stock` and `quantity_needs_assembly` per the job's `product_sku_id` and `requires_assembly` flags, then emits a `job_completed` event onto the `PRINT_EVENTS` queue for downstream processing (inventory, revenue). - [Pause an actively printing job](https://docs.autoprintfarm.com/api-reference/jobs/pause-an-actively-printing-job.md): **Side effect — physical motion.** Sends pause to the printer via the hub and waits for ACK. State transitions `printing → paused` atomically; reverts on hub command failure. - [Print job counts by status](https://docs.autoprintfarm.com/api-reference/jobs/print-job-counts-by-status.md): Aggregated counts of print jobs across all states plus a `completed_today` rollup. - [Re-queue a failed job](https://docs.autoprintfarm.com/api-reference/jobs/re-queue-a-failed-job.md): Resets the job back to `queued`, clearing progress, failure reason, and timing fields. - [Resume a paused job](https://docs.autoprintfarm.com/api-reference/jobs/resume-a-paused-job.md): **Side effect — physical motion.** Sends resume to the printer via the hub and waits for ACK. State transitions `paused → printing` atomically; reverts on hub command failure. - [Start a queued print job](https://docs.autoprintfarm.com/api-reference/jobs/start-a-queued-print-job.md): **Side effect — physical motion.** Streams the print file to the printer and starts the print. State transitions `queued → processing` atomically; reverts on failure. Error codes: `NO_PRINTER_ASSIGNED` / `NO_HUB_ASSIGNED` / `PRINTER_UNAVAILABLE` / `PRINTER_MODEL_MISMATCH` (400), `PRINTER_NOT_FOUND`… - [Stop a printing or paused job](https://docs.autoprintfarm.com/api-reference/jobs/stop-a-printing-or-paused-job.md): **Side effect — physical motion.** Sends stop to the printer via the hub (wait-for-ACK). Marks the job `cancelled`. For queued jobs that haven't started, `/jobs/{id}/cancel` is equivalent (same `control` scope, but fire-and-forget). - [Update a queued job's metadata](https://docs.autoprintfarm.com/api-reference/jobs/update-a-queued-jobs-metadata.md): Allowed only in non-terminal states. Returns `JOB_TERMINAL` (400) if the job is already `completed` or `cancelled`. Returns `PRINTER_NOT_FOUND` (404) if `printer_id` references an unknown printer. - [Batch availability check across components](https://docs.autoprintfarm.com/api-reference/materials/batch-availability-check-across-components.md): Pre-flight check that returns per-component availability and any shortages. Pure read — no stock changes. - [Create a components record](https://docs.autoprintfarm.com/api-reference/materials/create-a-components-record.md): Internal cost and sourcing fields (`cost_per_unit`, `reorder_link`) are NEVER accepted from the public API. `status` is server-computed from `(remaining, low_threshold)`. - [Create a filament record](https://docs.autoprintfarm.com/api-reference/materials/create-a-filament-record.md): Internal cost and sourcing fields (`cost_per_unit`, `reorder_link`) are NEVER accepted from the public API. `status` is server-computed from `(remaining, low_threshold)`. - [Create a packaging record](https://docs.autoprintfarm.com/api-reference/materials/create-a-packaging-record.md): Internal cost and sourcing fields (`cost_per_unit`, `reorder_link`) are NEVER accepted from the public API. `status` is server-computed from `(remaining, low_threshold)`. - [Create a parts record](https://docs.autoprintfarm.com/api-reference/materials/create-a-parts-record.md): Internal cost and sourcing fields (`cost_per_unit`, `reorder_link`) are NEVER accepted from the public API. `status` is server-computed from `(remaining, low_threshold)`. - [Decrement component stock](https://docs.autoprintfarm.com/api-reference/materials/decrement-component-stock.md): Decrements `remaining_units` by `quantity` and recomputes `status`. Returns the updated component row alongside a `consumed` summary of the movement. Responds 400 INSUFFICIENT_QUANTITY when the decrement would drop stock below zero. The `assembly_completion` reason is reserved for internal use and n… - [Get a single components record](https://docs.autoprintfarm.com/api-reference/materials/get-a-single-components-record.md): Returns one component record from your account. - [Get a single filament record](https://docs.autoprintfarm.com/api-reference/materials/get-a-single-filament-record.md): Returns one filament record from your account. - [Get a single packaging record](https://docs.autoprintfarm.com/api-reference/materials/get-a-single-packaging-record.md): Returns one packaging record from your account. - [Get a single parts record](https://docs.autoprintfarm.com/api-reference/materials/get-a-single-parts-record.md): Returns one part record from your account. - [List component inventory](https://docs.autoprintfarm.com/api-reference/materials/list-component-inventory.md): Returns generic component / accessory inventory. Internal pricing and sourcing fields are never exposed. - [List filament inventory](https://docs.autoprintfarm.com/api-reference/materials/list-filament-inventory.md): Returns your filament spool inventory. Internal pricing (cost_per_unit) and sourcing (reorder_link) fields are never exposed. - [List packaging inventory](https://docs.autoprintfarm.com/api-reference/materials/list-packaging-inventory.md): Returns packaging inventory. Internal pricing and sourcing fields are never exposed. - [List printer parts inventory](https://docs.autoprintfarm.com/api-reference/materials/list-printer-parts-inventory.md): Returns printer parts / spares inventory. Internal pricing and sourcing fields are never exposed. - [Update a components record](https://docs.autoprintfarm.com/api-reference/materials/update-a-components-record.md): Partial update — send only the fields you want to change. `status` is recomputed server-side. Cost/sourcing fields are never accepted. - [Update a filament record](https://docs.autoprintfarm.com/api-reference/materials/update-a-filament-record.md): Partial update — send only the fields you want to change. `status` is recomputed server-side. Cost/sourcing fields are never accepted. - [Update a packaging record](https://docs.autoprintfarm.com/api-reference/materials/update-a-packaging-record.md): Partial update — send only the fields you want to change. `status` is recomputed server-side. Cost/sourcing fields are never accepted. - [Update a parts record](https://docs.autoprintfarm.com/api-reference/materials/update-a-parts-record.md): Partial update — send only the fields you want to change. `status` is recomputed server-side. Cost/sourcing fields are never accepted. - [Create an order](https://docs.autoprintfarm.com/api-reference/orders/create-an-order.md): Creates an order with line items and returns it. Rejects unknown product SKUs (400 INVALID_PRODUCT_SKU) and duplicate order numbers (409 DUPLICATE_ORDER_NUMBER). Raw integration payloads (`external_data`) cannot be set via the public API. - [Fulfill a single line item (partial fulfillment)](https://docs.autoprintfarm.com/api-reference/orders/fulfill-a-single-line-item-partial-fulfillment.md): **Side effect:** deducts `finished_goods.ready_stock` for the specified quantity. Use this when shipping items individually. The order's overall status is recalculated after the deduction. - [Fulfill all items in an order](https://docs.autoprintfarm.com/api-reference/orders/fulfill-all-items-in-an-order.md): **Side effect:** deducts `finished_goods.ready_stock` for every unfulfilled line item and recalculates each finished_good's status. Composite (kit) items fail with KIT_NOT_PRODUCED or KIT_NOT_ASSEMBLED when their parent stock is insufficient — call `POST /orders/{id}/produce` first. Order transition… - [Get order by ID](https://docs.autoprintfarm.com/api-reference/orders/get-order-by-id.md): Returns a single order with its line items bundled inline. Internal cross-references (finished_good_id) are stripped from each item. - [List orders](https://docs.autoprintfarm.com/api-reference/orders/list-orders.md): Returns your orders, most recent first. Raw integration payloads (external_data) and internal inventory cross-references are not exposed. - [Materialize production artifacts for an order](https://docs.autoprintfarm.com/api-reference/orders/materialize-production-artifacts-for-an-order.md): **Side effect:** creates `kit_assembly` tasks and queued `print_job` rows for every unfulfilled line item that does not already have live production artifacts. Idempotent — running it twice on the same order is a no-op for items already in production. Composite SKUs get one assembly task plus one pr… - [Order counts + last-30-day revenue rollup](https://docs.autoprintfarm.com/api-reference/orders/order-counts-+-last-30-day-revenue-rollup.md): Returns counts grouped by status and platform plus a 30-day revenue summary (excluding cancelled/refunded orders). - [Update an order](https://docs.autoprintfarm.com/api-reference/orders/update-an-order.md): Updates an existing order's metadata, status, shipping, or tracking. Does not modify line items. Use `/orders/{id}/fulfill` to mark items shipped. - [API Reference](https://docs.autoprintfarm.com/api-reference/overview.md): Endpoint-by-endpoint reference for the AutoPrintFarm public API. - [Get live printer status](https://docs.autoprintfarm.com/api-reference/printers/get-live-printer-status.md): Returns the current live status for the printer: temperatures, progress, current layer, and the job it is running. When the printer's hub is offline, `hub_online` is `false` and the live fields are `null`. - [Get printer by ID](https://docs.autoprintfarm.com/api-reference/printers/get-printer-by-id.md): Returns a single printer. Includes additional detail fields beyond the list projection (firmware version, total print time, filament level, maintenance state). - [List printers](https://docs.autoprintfarm.com/api-reference/printers/list-printers.md): Returns the printers on your account. Internal fields (IP addresses, access codes, serial numbers) are never exposed. - [Load filament](https://docs.autoprintfarm.com/api-reference/printers/load-filament.md): **Side effect — extruder motion + nozzle heat-up.** `tray_id` 0–15 = AMS tray (ams_id * 4 + tray_id); `254` = external spool (default). Default temperature 220°C. - [Pause / resume / stop / clear bed](https://docs.autoprintfarm.com/api-reference/printers/pause-resume-stop-clear-bed.md): **Side effect — physical motion.** Sends the requested action to the printer via its assigned hub and waits for ACK. Rejects with `INVALID_STATE` if the action doesn't match the current printer status (e.g. pausing an idle printer) or `HUB_OFFLINE` if the hub is not connected. - [Printer counts by status](https://docs.autoprintfarm.com/api-reference/printers/printer-counts-by-status.md): Aggregated counts of your printers across all statuses. - [Set nozzle or bed setpoint](https://docs.autoprintfarm.com/api-reference/printers/set-nozzle-or-bed-setpoint.md): **Side effect — heater target change.** Nozzle range 0–300°C; bed range 0–120°C. - [Toggle chamber light](https://docs.autoprintfarm.com/api-reference/printers/toggle-chamber-light.md): **Side effect — physical actuation.** Toggles the printer's chamber light. Body: `{ state: true|false|"on"|"off" }`. Fire-and-forget at the hub. - [Toggle printer maintenance mode](https://docs.autoprintfarm.com/api-reference/printers/toggle-printer-maintenance-mode.md): **Side effect:** flips `printers.status` between `idle` and `maintenance` and updates `last_maintenance_date` on transition out. Rejects with `PRINTER_PRINTING` if the printer is currently printing. - [Unload filament](https://docs.autoprintfarm.com/api-reference/printers/unload-filament.md): **Side effect — extruder motion + nozzle heat-up.** Disengages the current filament path. - [Update printer name / location / notes](https://docs.autoprintfarm.com/api-reference/printers/update-printer-name-location-notes.md): Only safe display fields can be patched via the public surface. Connection parameters (IP, access code, serial number) are managed in the dashboard. - [Adjust component-level stock for a SKU](https://docs.autoprintfarm.com/api-reference/products/adjust-component-level-stock-for-a-sku.md): **Note:** adjusts `product_skus.stock_level` — the *component-level* counter used for filament rolls / accessory parts. This is **NOT** the finished-goods stock that order fulfillment touches; for that, use `POST /inventory/{id}/adjust` or `POST /orders/{id}/fulfill`. - [Bulk-create assembly components for a product](https://docs.autoprintfarm.com/api-reference/products/bulk-create-assembly-components-for-a-product.md): Adds (or, with `replace: true`, fully replaces) the product's assembly-components list. These are *assembly aids* (screws, cables, labels) — distinct from SKU BOM children which are managed via `PUT /skus/{id}/bom`. - [Create a color preset](https://docs.autoprintfarm.com/api-reference/products/create-a-color-preset.md): Stored normalized in uppercase. 409 DUPLICATE_COLOR if a preset with the same `color_name` + `filament_type` already exists. - [Create a composite kit product](https://docs.autoprintfarm.com/api-reference/products/create-a-composite-kit-product.md): Atomically creates the kit product plus all internal-part products, variant SKUs, and BOM wiring. Bundle extras reference filament / packaging / accessory / printer-part inventory by ID. 404 PRINT_FILE_NOT_FOUND / UNKNOWN_INVENTORY_ITEM for missing refs; 409 DUPLICATE_NAME on name collision. - [Create a kit-assembly task for a composite SKU](https://docs.autoprintfarm.com/api-reference/products/create-a-kit-assembly-task-for-a-composite-sku.md): **Side effect:** creates a `kit_assembly` task in `pending` state. On completion (via the existing assembly task workflow), deducts child SKU stock and credits the parent SKU's `finished_goods.ready_stock`. Returns 400 INSUFFICIENT_FOR_KIT with a `shortages` array if the requested quantity cannot be… - [Create a product](https://docs.autoprintfarm.com/api-reference/products/create-a-product.md): Creates a simple (non-kit) product. Internal manufacturing wiring fields cannot be set from the public API. Duplicate `name` returns 409 DUPLICATE_NAME. - [Create a SKU variant](https://docs.autoprintfarm.com/api-reference/products/create-a-sku-variant.md): Creates a new SKU under an existing product. Automatically creates the paired `finished_goods` row with `ready_stock = 0`. Duplicate `sku` codes return 409. - [Create a SKU variant under a product (nested alias)](https://docs.autoprintfarm.com/api-reference/products/create-a-sku-variant-under-a-product-nested-alias.md): Convenience alias for `POST /skus` with `product_id` taken from the path. Same behaviour: auto-creates the paired `finished_goods` row. - [Delete all assembly components for a product](https://docs.autoprintfarm.com/api-reference/products/delete-all-assembly-components-for-a-product.md): Non-destructive: removes assembly-component metadata only. SKUs, inventory, and BOM links are untouched. - [Delete an image](https://docs.autoprintfarm.com/api-reference/products/delete-an-image.md): Removes the image from R2 and the gallery. Sort_order gaps are tolerated; the next reorder call renumbers. - [Download an image](https://docs.autoprintfarm.com/api-reference/products/download-an-image.md): Streams the image bytes from R2. Browser-friendly: 24h cache header. `Content-Type` mirrors what was uploaded. - [Get product by ID](https://docs.autoprintfarm.com/api-reference/products/get-product-by-id.md): Returns a product with its SKUs and assembly components bundled inline. Absorbs `/skus/:id`, `/products/:id/skus`, and `/products/:id/components` — callers never need a follow-up fetch. - [Get SKU by ID](https://docs.autoprintfarm.com/api-reference/products/get-sku-by-id.md): Returns a SKU with composite-aware `available_to_build` and `effective_status` fields. For non-composite SKUs `available_to_build` is always 0. - [Get the bill of materials for a SKU](https://docs.autoprintfarm.com/api-reference/products/get-the-bill-of-materials-for-a-sku.md): Returns the SKU's BOM (children + inventory requirements) plus `available_to_build`. - [List all assembly components across the catalog](https://docs.autoprintfarm.com/api-reference/products/list-all-assembly-components-across-the-catalog.md): Bulk list of assembly components for every product in your catalog, for BOM export or bulk sync. Each row carries its `product_id` so callers can group client-side. - [List assembly components for a product](https://docs.autoprintfarm.com/api-reference/products/list-assembly-components-for-a-product.md) - [List color presets](https://docs.autoprintfarm.com/api-reference/products/list-color-presets.md): Returns all of your filament color presets. Small reference dataset — no pagination. Gated by the `read` scope. - [List distinct filament types from active color presets](https://docs.autoprintfarm.com/api-reference/products/list-distinct-filament-types-from-active-color-presets.md): Returns the sorted, distinct filament-type labels from your active color presets. Useful for populating a filament-type filter on `/colors` or driving a dropdown when minting SKUs. - [List distinct product categories](https://docs.autoprintfarm.com/api-reference/products/list-distinct-product-categories.md): Returns the sorted, distinct, non-empty category labels in use across your catalog. Useful for populating a category filter on `/products`. - [List product images](https://docs.autoprintfarm.com/api-reference/products/list-product-images.md): Returns the product's gallery sorted by `sort_order` ascending. The first entry is the hero — same as `product.image_url`. - [List products](https://docs.autoprintfarm.com/api-reference/products/list-products.md): Returns products in your catalog. - [List SKUs](https://docs.autoprintfarm.com/api-reference/products/list-skus.md): Returns your product SKUs. Includes `finished_goods_stock` (current + assembled + needs_assembly) per SKU. SKUs of internal-part products are hidden. - [List SKUs at or below their low-stock threshold](https://docs.autoprintfarm.com/api-reference/products/list-skus-at-or-below-their-low-stock-threshold.md) - [Reorder the gallery](https://docs.autoprintfarm.com/api-reference/products/reorder-the-gallery.md): Body: `{ order: imageId[] }`. Must be a permutation of the product's current image ids — otherwise 400 INVALID_ORDER. Returns the gallery in the new order. - [Replace a kit's composition](https://docs.autoprintfarm.com/api-reference/products/replace-a-kits-composition.md): Updates the kit's variants/parts/bundle extras atomically. Existing SKUs that survive the update keep their finished_goods stock. 409 PART_IN_EXTERNAL_BOM if a removed part is referenced by another composite SKU; 409 SKU_IN_USE_BY_ORDER if a removed variant SKU has open order lines. - [Replace the BOM for a SKU](https://docs.autoprintfarm.com/api-reference/products/replace-the-bom-for-a-sku.md): Replaces the SKU's full bill of materials atomically. Sending an empty `children` array clears the SKU back to non-composite. Nesting is capped at one level — composite children are rejected (NESTING_NOT_ALLOWED). - [Update a color preset](https://docs.autoprintfarm.com/api-reference/products/update-a-color-preset.md) - [Update a SKU](https://docs.autoprintfarm.com/api-reference/products/update-a-sku.md): Updates safe metadata fields (sku, color, hex_code, low_stock_threshold, is_active). Quantity-per-kit and filament-type are immutable from the public API. - [Update product metadata](https://docs.autoprintfarm.com/api-reference/products/update-product-metadata.md): Patches safe display fields on a product (name, description, category, is_active, and assembly/post-processing flags). Returns the updated product. - [Upload a new product image](https://docs.autoprintfarm.com/api-reference/products/upload-a-new-product-image.md): Appends a new image to the product's gallery at the next sort_order. Accepts JPEG, PNG, WebP, GIF up to 5 MB. 409 IMAGE_CAP_REACHED when the product already has 20 images. - [Create a wiki article](https://docs.autoprintfarm.com/api-reference/wiki/create-a-wiki-article.md): If `slug` is omitted it is generated from `title`. 409 DUPLICATE_SLUG on collision. `author_id` and `last_edited_by` are auto-populated from the API key's owner — never accepted from the request body. Setting `is_published: true` stamps `published_at`. - [Get wiki article by ID or slug](https://docs.autoprintfarm.com/api-reference/wiki/get-wiki-article-by-id-or-slug.md): Returns a single article. The path parameter is tried as an ID first, then as a slug. The detail projection includes content and sections. - [List distinct wiki categories](https://docs.autoprintfarm.com/api-reference/wiki/list-distinct-wiki-categories.md): Returns the sorted, distinct, non-empty category labels in use across your wiki articles. Useful for populating a category filter. - [List wiki articles](https://docs.autoprintfarm.com/api-reference/wiki/list-wiki-articles.md): Returns your wiki articles. The list projection omits the heavy content and sections fields — fetch the detail endpoint for those. Internal author/editor user IDs are never exposed. - [Publish a wiki article](https://docs.autoprintfarm.com/api-reference/wiki/publish-a-wiki-article.md): Sets `is_published = true` and stamps `published_at`. 400 ALREADY_PUBLISHED if the article is already in the published state. - [Unpublish a wiki article](https://docs.autoprintfarm.com/api-reference/wiki/unpublish-a-wiki-article.md): Sets `is_published = false`. 400 ALREADY_UNPUBLISHED if the article is not currently published. `published_at` is preserved so a later republish reuses it (until then it represents 'first publish'). - [Update a wiki article](https://docs.autoprintfarm.com/api-reference/wiki/update-a-wiki-article.md): Partial update. `last_edited_by` auto-populates from the API key owner. Slug uniqueness is checked excluding self. Publish state is controlled via the dedicated `/wiki/{id}/publish` and `/wiki/{id}/unpublish` endpoints — `is_published` is not accepted here. - [Assign or unassign a task](https://docs.autoprintfarm.com/api-reference/worklist/assign-or-unassign-a-task.md): Pass `assigned_to: null` to unassign. - [Change task status](https://docs.autoprintfarm.com/api-reference/worklist/change-task-status.md): Auto-sets `started_at` when transitioning to `in_progress`, and `completed_at` plus `actual_time_minutes` when transitioning to `completed`/`cancelled`. - [Complete a worklist task](https://docs.autoprintfarm.com/api-reference/worklist/complete-a-worklist-task.md): Sets status to `completed` with `completed_at = now` and computes `actual_time_minutes` if `started_at` is set. **Side effect:** for `maintenance` tasks, clears printer maintenance state and updates `last_maintenance_date`. For `filament_change` tasks, updates the printer's filament fields from the… - [Create a worklist task](https://docs.autoprintfarm.com/api-reference/worklist/create-a-worklist-task.md): Optionally auto-resolves the default assignee from your `task_assignment_defaults` (set `apply_default_assignee: false` to skip). - [Get worklist task by ID](https://docs.autoprintfarm.com/api-reference/worklist/get-worklist-task-by-id.md): Returns a single worklist task with the same projection as the list. - [List worklist tasks](https://docs.autoprintfarm.com/api-reference/worklist/list-worklist-tasks.md): Returns your worklist tasks, ordered by priority (high first) then most recent. Internal assignee user IDs, assembly-task workflow links, and the free-form metadata blob are not exposed. - [Start a worklist task](https://docs.autoprintfarm.com/api-reference/worklist/start-a-worklist-task.md): Sets status to `in_progress` with `started_at = now`. **Side effect:** for `maintenance` tasks, also flips the linked printer's status to `maintenance` and sets `in_maintenance = true`. - [Update worklist task fields](https://docs.autoprintfarm.com/api-reference/worklist/update-worklist-task-fields.md): Patch title / subtitle / description / priority / printer / estimated_time / due_date. - [Worklist task counts](https://docs.autoprintfarm.com/api-reference/worklist/worklist-task-counts.md): Counts by status + by type (excluding completed/cancelled), plus an overdue count. - [Authentication](https://docs.autoprintfarm.com/authentication.md): Create, use, and revoke API keys. - [AutoPrintFarm API](https://docs.autoprintfarm.com/introduction.md): Read-only access to your print farm — printers, jobs, and inventory — over a REST API scoped to your account. - [Rate Limits](https://docs.autoprintfarm.com/rate-limits.md): How requests are throttled per API key. ## OpenAPI Specs - [openapi](https://docs.autoprintfarm.com/api-reference/openapi.json)