API Endpoint Reference / Printers

Send a printer command

POST https://api.printhiv3d.com/v1/printers/{id}/commands

Operation ID sendPrinterCommand. Requires the control or dangerous API key scope.

Each command declares its required API key scope. A dangerous key also satisfies control. Host credentials are refused. Send commands to a printer in the key's organization. Pause and resume operate on the device's current print. Raw stop and the ams_control and amsUserSettings commands check a snapshot of managed Print Job ownership. The API records 409 managed_print_active if this check finds an owner or a pending bound Stop. For an active managed Bambu print, use POST /v1/print-jobs/{id}/stop. Read an existing Stop receipt if one is pending. For other families, use the printer controls in PrintHive. The API records 409 command_unsupported before dispatch if the adapter does not support the command or parameters. AMS 2 Pro and AMS HT use amsFilamentDrying with mode 0 to stop drying. Temperature targets are bed and nozzle. For setNozzleTempNew, the maximum is 350 °C on H2C, H2D, and H2D Pro and 300 °C on X2D. Snapmaker, Klipper, and OctoPrint accept an optional nozzle index for configured tools. Bambu resume attempts to clear a standing print error before resuming and refuses cleanPrintError: false. The clear is best effort. Clear error uses the latest reported error and returns 409 if none is available. G-code, jogging, both homing commands, auto leveling, manual extrusion, AMS calibration, maintenance calibration, and extrusion calibration writes require an idle printer. Hive Link checks fresh device status before sending the command. Busy, unknown, or stale state returns 409 printer_busy. A Bambu filament change also counts as busy. A calibration tray must feed the requested extruder, including when selecting a profile with an explicit nozzle position. Setting, selecting, or deleting calibration profiles on a printer with a nozzle rack returns 409 command_unsupported before dispatch. Bed leveling and vibration in laser mode return 409 fdm_mode_required. Switch the printer to FDM mode before submitting a new request. An older Hive Link can refuse relayed idle-only commands, nozzle setpoints above 300 °C, or public air filter stop. The API records that refusal after relay and returns 409 command_unsupported with a message to update Hive Link. The API records an attempt before dispatch. An Idempotency-Key is unique within the organization. The same API key can replay the same command and normalized parameters for the same printer. Another API key or a different request gets 409. An accepted receipt confirms acknowledgement from Hive Link. A replay can return 200 after an in-flight attempt settles. A prepared attempt expires to refused after 45 seconds and returns 409. Recovery marks a dispatched attempt indeterminate after 5 minutes without a recorded outcome and does not resend it. The 15-minute readiness fence ends 20 minutes after dispatch for a recovered attempt. If the API records indeterminate earlier after losing the acknowledgement, the fence starts at that write. An explicit refusal reported by Hive Link returns 409 command_failed. This includes Bambu device refusals when Developer Mode is disabled. Transport failures, unrecognized replies, and unrecorded results return 502 with the attempt ID. Read printer state to observe the result.

Parameters

NameInTypeRequiredDescription
idpathuuidYes
idempotency-keyheaderstringNo

Request body

Content type application/json.

Send one of these shapes.

airPurification (dangerous)

FieldTypeRequiredDescription
command"airPurification"Yes
params{ enabled: boolean }YesStops the air filter on H2-series printers. Use enabled: false.

calibration (dangerous)

FieldTypeRequiredDescription
command"calibration"Yes
params{ routines: ("xcamCali" | "bedLeveling" | "vibration" | "motorNoise" | "nozzleCali" | "bedCali" | "clumpPosCali")[] }Yes

paCalibration (dangerous)

FieldTypeRequiredDescription
command"paCalibration"Yes
params{ nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, mode: 0, filaments: ({ tray_id: integer (≥ 0, ≤ 65535), ams_id: integer (≥ 0, ≤ 255), slot_id: integer (≥ 0, ≤ 8), filament_id: string, setting_id: string, extruder_id: integer (≥ 0, ≤ 1), bed_temp: integer (≥ 0, ≤ 120), nozzle_temp: integer (≥ 0, ≤ 350), max_volumetric_speed: number (≥ 0, ≤ 200), nozzle_id: string (matches /^(?:(?:H[SHUTB]00-|hardened_|stainless_)0\.[2468])?$/), nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8 })[] }Yes

flowRateCalibration (dangerous)

FieldTypeRequiredDescription
command"flowRateCalibration"Yes
params{ tray_id: integer (≥ 0, ≤ 65535), nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, filaments: { tray_id: integer (≥ 0, ≤ 65535), ams_id: integer (≥ 0, ≤ 255), slot_id: integer (≥ 0, ≤ 8), filament_id: string, setting_id: string, extruder_id: integer (≥ 0, ≤ 1), bed_temp: integer (≥ 0, ≤ 120), nozzle_temp: integer (≥ 0, ≤ 350), max_volumetric_speed: number (≥ 0, ≤ 200), def_flow_ratio: number (≥ 0, ≤ 2) }[] }Yes

extrusionCalibrationSet (dangerous)

FieldTypeRequiredDescription
command"extrusionCalibrationSet"Yes
params{ nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, filaments: ({ filament_id: string, setting_id: string, nozzle_pos?: integer (≥ 0, ≤ 1) | integer (≥ 16, ≤ 24), nozzle_sn?: string, extruder_id: integer (≥ 0, ≤ 1), nozzle_id: string (matches /^(?:(?:H[SHUTB]00-|hardened_|stainless_)0\.[2468])?$/), nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, name: string (matches /\S/), k_value: number (≥ 0, ≤ 2), n_coef: 0 | number (≥ 0.6, ≤ 2), tray_id: integer (≥ 0, ≤ 65535), ams_id: integer (≥ 0, ≤ 255), slot_id: integer (≥ 0, ≤ 8), cali_idx?: integer (≥ 0, ≤ 2147483647) } | { filament_id: string, setting_id: string, nozzle_pos?: integer (≥ 0, ≤ 1) | integer (≥ 16, ≤ 24), nozzle_sn?: string, extruder_id: integer (≥ 0, ≤ 1), nozzle_id: string (matches /^(?:(?:H[SHUTB]00-|hardened_|stainless_)0\.[2468])?$/), nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, name: string (matches /\S/), k_value: number (≥ 0, ≤ 2), n_coef: 0 | number (≥ 0.6, ≤ 2), tray_id: -1, ams_id: 0, slot_id: 0 })[] }Yes

extrusionCalibrationSelect (dangerous)

FieldTypeRequiredDescription
command"extrusionCalibrationSelect"Yes
params{ tray_id: integer (≥ 0, ≤ 65535), ams_id: integer (≥ 0, ≤ 255), slot_id: integer (≥ 0, ≤ 8), cali_idx: integer (≥ 0, ≤ 2147483647), filament_id: string, nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, nozzle_pos?: integer (≥ 0, ≤ 1) | integer (≥ 16, ≤ 24), nozzle_sn?: string }Yes

extrusionCalibrationDelete (dangerous)

FieldTypeRequiredDescription
command"extrusionCalibrationDelete"Yes
params{ extruder_id: integer (≥ 0, ≤ 1), nozzle_id: string (matches /^(?:(?:H[SHUTB]00-|hardened_|stainless_)0\.[2468])?$/), filament_id: string, cali_idx: integer (≥ 0, ≤ 2147483647), nozzle_diameter: 0.2 | 0.4 | 0.6 | 0.8, nozzle_pos?: integer (≥ 0, ≤ 1) | integer (≥ 16, ≤ 24), nozzle_sn?: string }Yes

ams_control (dangerous)

FieldTypeRequiredDescription
command"ams_control"Yes
params{ param: "resume" | "reset" | "pause" | "done" | "abort" }Yes

amsCalibrate (dangerous)

FieldTypeRequiredDescription
command"amsCalibrate"Yes
params{ amsId: integer (≥ 0, ≤ 31) | integer (≥ 128, ≤ 135) }Yes

amsUserSettings (control)

FieldTypeRequiredDescription
command"amsUserSettings"Yes
params{ amsId: -1, startupReadOption: boolean, trayReadOption: boolean, calibrateRemainFlag: boolean }Yes

amsSelectTray (dangerous)

FieldTypeRequiredDescription
command"amsSelectTray"Yes
params{ trayId: integer (≥ 0, ≤ 255) | string (matches /^\s*0*(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]|512|516|520|524|528|532|536|540)\s*$/) | 512 | 516 | 520 | 524 | 528 | 532 | 536 | 540, confirm: true }Yes

amsFilamentDrying (dangerous)

FieldTypeRequiredDescription
command"amsFilamentDrying"Yes
params{ mode: 0 | "off" | "stop", amsId: integer (≥ 0, ≤ 3) | integer (≥ 128, ≤ 135) } | { mode?: 1 | "on", amsId: integer (≥ 0, ≤ 3) | integer (≥ 128, ≤ 135), confirm: true, filament?: string, temp: integer (≥ 0, ≤ 100), durationHours: integer (≥ 1, ≤ 72), rotateTray?: boolean, coolingTemp?: integer (≥ 0, ≤ 100) }Yes

cleanPrintError (dangerous)

FieldTypeRequiredDescription
command"cleanPrintError"Yes

autoLevel (dangerous)

FieldTypeRequiredDescription
command"autoLevel"Yes

axisControl (dangerous)

FieldTypeRequiredDescription
command"axisControl"Yes
params{ axis: "X" | "Y" | "Z" | "E", distance: integer (≥ -10, ≤ -1) | integer (≥ 1, ≤ 10), unit?: 1, speed?: integer (≥ 1, ≤ 3000) }Yes

gcode (dangerous)

FieldTypeRequiredDescription
command"gcode"Yes
params{ gcodes: string (matches /^[\x20-\x7E]+$/)[] }Yes

goHome (dangerous)

FieldTypeRequiredDescription
command"goHome"Yes

homeAxes (dangerous)

FieldTypeRequiredDescription
command"homeAxes"Yes
params{ axes: ("X" | "Y" | "Z")[] }Yes

loadFilament (dangerous)

FieldTypeRequiredDescription
command"loadFilament"Yes
params{ oldTemp?: number, newTemp?: number, extruder?: integer (≥ 0, ≤ 3), source: { amsId: integer (≥ 0, ≤ 31), slotId: integer (≥ 0, ≤ 3) } | { amsId: 254 | 255 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135, slotId: 0 } } | { oldTemp?: number, newTemp?: number, extruder?: integer (≥ 0, ≤ 3), trayId?: integer (≥ 0, ≤ 254) }NoBambu accepts a source or tray ID, finite temperatures, and extruder 0–1. Snapmaker accepts only extruder 0–3.

manualExtrude (dangerous)

FieldTypeRequiredDescription
command"manualExtrude"Yes
params{ extruderIndex: integer (≥ 0, ≤ 3), direction: "extrude" | "retract", lengthMm: integer (≥ 1, ≤ 200) }YesH2C accepts only extruder 0. Length is in millimetres.

pause (dangerous)

FieldTypeRequiredDescription
command"pause"Yes

refreshPrinterState (control)

FieldTypeRequiredDescription
command"refreshPrinterState"Yes

resume (dangerous)

FieldTypeRequiredDescription
command"resume"Yes
params{ cleanPrintError?: boolean }NoBambu attempts to clear a standing print error before resuming. The clear is best effort. Bambu refuses false. Other adapters accept false or omission.

setNozzleTempNew (dangerous)

FieldTypeRequiredDescription
command"setNozzleTempNew"Yes
params{ extruderIndex: 0 | 1, targetTemp: integer (≥ 0, ≤ 350) }Yes

snapmakerNamedFan (dangerous)

FieldTypeRequiredDescription
command"snapmakerNamedFan"Yes
params{ name: string (matches /^[A-Za-z_][A-Za-z0-9_]*$/), speed: number (≥ 0, ≤ 100) }Yes

stop (dangerous)

FieldTypeRequiredDescription
command"stop"Yes

stopBuzzer (control)

FieldTypeRequiredDescription
command"stopBuzzer"Yes

unloadFilament (dangerous)

FieldTypeRequiredDescription
command"unloadFilament"Yes
params{ oldTemp?: number, newTemp?: number, extruder?: integer (≥ 0, ≤ 3), amsId?: integer (≥ 0, ≤ 31) | 254 | 255 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 }NoBambu accepts an AMS ID, finite temperatures, and extruder 0–1. Snapmaker accepts only extruder 0–3.

updateFan (dangerous)

FieldTypeRequiredDescription
command"updateFan"Yes
params{ fan: 1 | 2 | 3 | "part_cooling" | "part" | "auxiliary" | "aux" | "chamber", speed: integer (≥ 0, ≤ 100) }YesKlipper, OctoPrint and Snapmaker accept only the part-cooling fan.

updateLight (control)

FieldTypeRequiredDescription
command"updateLight"Yes
params{ light?: "chamber_light" | "work_light", isOn: boolean } | { light?: "chamber_light" | "work_light", mode: "on" | "off" }YesDefaults to chamber_light. Only Bambu accepts work_light.

updateSpeed (dangerous)

FieldTypeRequiredDescription
command"updateSpeed"Yes
params{ speed: "1" | "2" | "3" | "4" | integer (≥ 1, ≤ 4) }Yes

updateTemp (dangerous)

FieldTypeRequiredDescription
command"updateTemp"Yes
params{ part: "bed", temperature: integer (≥ 0, ≤ 300) } | { part: "nozzle", temperature: integer (≥ 0, ≤ 300), extruder?: integer (≥ 0, ≤ 3) }Yes

Responses

StatusDescription
200Default Response
400Default Response
401Default Response
403Default Response
404Default Response
409Default Response
502Default Response
503Default Response
defaultDefault Response

200 response fields

FieldTypeRequiredDescription
command"airPurification" | "calibration" | "paCalibration" | "flowRateCalibration" | "extrusionCalibrationSet" | "extrusionCalibrationSelect" | "extrusionCalibrationDelete" | "ams_control" | "amsCalibrate" | "amsUserSettings" | "amsSelectTray" | "amsFilamentDrying" | "cleanPrintError" | "autoLevel" | "axisControl" | "gcode" | "goHome" | "homeAxes" | "loadFilament" | "manualExtrude" | "pause" | "refreshPrinterState" | "resume" | "setNozzleTempNew" | "snapmakerNamedFan" | "stop" | "stopBuzzer" | "unloadFilament" | "updateFan" | "updateLight" | "updateSpeed" | "updateTemp"Yes
status"accepted"Yes
attemptIduuidYes
requestIdstringYes

400 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"invalid_request"Yes
attemptIduuidNo
requestIdstringYes

401 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"authentication_required"Yes
attemptIduuidNo
requestIdstringYes

403 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"insufficient_scope" | "host_principal_forbidden" | "organization_forbidden"Yes
attemptIduuidNo
requestIdstringYes

404 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"printer_not_found"Yes
attemptIduuidNo
requestIdstringYes

409 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"printer_unavailable" | "unsafe_printer_state" | "managed_print_active" | "printer_busy" | "fdm_mode_required" | "command_unsupported" | "no_print_error" | "command_failed" | "command_expired" | "idempotency_key_reused"Yes
attemptIduuidNo
requestIdstringYes

502 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"command_unconfirmed"Yes
attemptIduuidNo
requestIdstringYes

503 response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"command_dispatch_unavailable"Yes
attemptIduuidNo
requestIdstringYes

default response fields

FieldTypeRequiredDescription
errorstringYes
messagestringYes
reason"unexpected_error"Yes
attemptIduuidNo
requestIdstringYes

Example 200 response

{
  "command": "pause",
  "status": "accepted",
  "requestId": "req-123",
  "attemptId": "2ea3a63d-eb4f-444d-bfac-14b732d82630"
}