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
| Name | In | Type | Required | Description |
|---|
id | path | uuid | Yes | |
idempotency-key | header | string | No | |
Request body
Content type application/json.
Send one of these shapes.
airPurification (dangerous)
| Field | Type | Required | Description |
|---|
command | "airPurification" | Yes | |
params | { enabled: boolean } | Yes | Stops the air filter on H2-series printers. Use enabled: false. |
calibration (dangerous)
| Field | Type | Required | Description |
|---|
command | "calibration" | Yes | |
params | { routines: ("xcamCali" | "bedLeveling" | "vibration" | "motorNoise" | "nozzleCali" | "bedCali" | "clumpPosCali")[] } | Yes | |
paCalibration (dangerous)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
command | "ams_control" | Yes | |
params | { param: "resume" | "reset" | "pause" | "done" | "abort" } | Yes | |
amsCalibrate (dangerous)
| Field | Type | Required | Description |
|---|
command | "amsCalibrate" | Yes | |
params | { amsId: integer (≥ 0, ≤ 31) | integer (≥ 128, ≤ 135) } | Yes | |
amsUserSettings (control)
| Field | Type | Required | Description |
|---|
command | "amsUserSettings" | Yes | |
params | { amsId: -1, startupReadOption: boolean, trayReadOption: boolean, calibrateRemainFlag: boolean } | Yes | |
amsSelectTray (dangerous)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
command | "cleanPrintError" | Yes | |
autoLevel (dangerous)
| Field | Type | Required | Description |
|---|
command | "autoLevel" | Yes | |
axisControl (dangerous)
| Field | Type | Required | Description |
|---|
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)
| Field | Type | Required | Description |
|---|
command | "gcode" | Yes | |
params | { gcodes: string (matches /^[\x20-\x7E]+$/)[] } | Yes | |
goHome (dangerous)
| Field | Type | Required | Description |
|---|
command | "goHome" | Yes | |
homeAxes (dangerous)
| Field | Type | Required | Description |
|---|
command | "homeAxes" | Yes | |
params | { axes: ("X" | "Y" | "Z")[] } | Yes | |
loadFilament (dangerous)
| Field | Type | Required | Description |
|---|
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) } | No | Bambu accepts a source or tray ID, finite temperatures, and extruder 0–1. Snapmaker accepts only extruder 0–3. |
manualExtrude (dangerous)
| Field | Type | Required | Description |
|---|
command | "manualExtrude" | Yes | |
params | { extruderIndex: integer (≥ 0, ≤ 3), direction: "extrude" | "retract", lengthMm: integer (≥ 1, ≤ 200) } | Yes | H2C accepts only extruder 0. Length is in millimetres. |
pause (dangerous)
| Field | Type | Required | Description |
|---|
command | "pause" | Yes | |
refreshPrinterState (control)
| Field | Type | Required | Description |
|---|
command | "refreshPrinterState" | Yes | |
resume (dangerous)
| Field | Type | Required | Description |
|---|
command | "resume" | Yes | |
params | { cleanPrintError?: boolean } | No | Bambu 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)
| Field | Type | Required | Description |
|---|
command | "setNozzleTempNew" | Yes | |
params | { extruderIndex: 0 | 1, targetTemp: integer (≥ 0, ≤ 350) } | Yes | |
snapmakerNamedFan (dangerous)
| Field | Type | Required | Description |
|---|
command | "snapmakerNamedFan" | Yes | |
params | { name: string (matches /^[A-Za-z_][A-Za-z0-9_]*$/), speed: number (≥ 0, ≤ 100) } | Yes | |
stop (dangerous)
| Field | Type | Required | Description |
|---|
command | "stop" | Yes | |
stopBuzzer (control)
| Field | Type | Required | Description |
|---|
command | "stopBuzzer" | Yes | |
unloadFilament (dangerous)
| Field | Type | Required | Description |
|---|
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 } | No | Bambu accepts an AMS ID, finite temperatures, and extruder 0–1. Snapmaker accepts only extruder 0–3. |
updateFan (dangerous)
| Field | Type | Required | Description |
|---|
command | "updateFan" | Yes | |
params | { fan: 1 | 2 | 3 | "part_cooling" | "part" | "auxiliary" | "aux" | "chamber", speed: integer (≥ 0, ≤ 100) } | Yes | Klipper, OctoPrint and Snapmaker accept only the part-cooling fan. |
updateLight (control)
| Field | Type | Required | Description |
|---|
command | "updateLight" | Yes | |
params | { light?: "chamber_light" | "work_light", isOn: boolean } | { light?: "chamber_light" | "work_light", mode: "on" | "off" } | Yes | Defaults to chamber_light. Only Bambu accepts work_light. |
updateSpeed (dangerous)
| Field | Type | Required | Description |
|---|
command | "updateSpeed" | Yes | |
params | { speed: "1" | "2" | "3" | "4" | integer (≥ 1, ≤ 4) } | Yes | |
updateTemp (dangerous)
| Field | Type | Required | Description |
|---|
command | "updateTemp" | Yes | |
params | { part: "bed", temperature: integer (≥ 0, ≤ 300) } | { part: "nozzle", temperature: integer (≥ 0, ≤ 300), extruder?: integer (≥ 0, ≤ 3) } | Yes | |
Responses
| Status | Description |
|---|
200 | Default Response |
400 | Default Response |
401 | Default Response |
403 | Default Response |
404 | Default Response |
409 | Default Response |
502 | Default Response |
503 | Default Response |
default | Default Response |
200 response fields
| Field | Type | Required | Description |
|---|
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 | |
attemptId | uuid | Yes | |
requestId | string | Yes | |
400 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "invalid_request" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
401 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "authentication_required" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
403 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "insufficient_scope" | "host_principal_forbidden" | "organization_forbidden" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
404 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "printer_not_found" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
409 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
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 | |
attemptId | uuid | No | |
requestId | string | Yes | |
502 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "command_unconfirmed" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
503 response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "command_dispatch_unavailable" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
default response fields
| Field | Type | Required | Description |
|---|
error | string | Yes | |
message | string | Yes | |
reason | "unexpected_error" | Yes | |
attemptId | uuid | No | |
requestId | string | Yes | |
Example 200 response
{
"command": "pause",
"status": "accepted",
"requestId": "req-123",
"attemptId": "2ea3a63d-eb4f-444d-bfac-14b732d82630"
}