diff --git a/docs/api/printer.rst b/docs/api/printer.rst index 7c4a1a65..b6e69575 100644 --- a/docs/api/printer.rst +++ b/docs/api/printer.rst @@ -755,6 +755,33 @@ Retrieve the current SD state :statuscode 200: No error :statuscode 404: If SD support has been disabled in OctoPrint's config. +.. _sec-api-printer-arbcommand: + +Send an arbitrary command to the printer +============================= + +.. http:post:: /api/printer/command + + Sends any command to the printer via serial inerface. Should be used with some care as some commands can stop a running print job. + + If successful returns a :http:statuscode:`204` and an empty body. + + **Example Request** + + .. sourcecode:: http + POST /api/printer/command HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "M27" + } + + + :json string command: The command to issue. + :statuscode 204: No error + .. _sec-api-printer-datamodel: Datamodel @@ -830,4 +857,3 @@ SD State - 1 - Boolean - Whether the SD card has been initialized (``true``) or not (``false``). -