@@ -341,7 +341,8 @@ state.
341341
342342` POST /{id}/printers/actions/CreateJob `
343343
344- To start a print job you must either specify a ` filesystem ` ID, a ` queue_file ` ID file, a ` file_id ` or set ` next_queue_item ` to true.
344+ To start a print job you must either specify a ` filesystem ` ID, a ` queue_file ` ID file, a ` file_id ` or set
345+ ` next_queue_item ` to true.
345346
346347| Parameter | Type | Required | Description |
347348| -------------------| ----------------------| ----------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -564,6 +565,57 @@ This endpoint can be used to clear the print bed of a printer.
564565| ` status ` | boolean | True if the request was successful. |
565566| ` message ` | string | Error message if ` status ` is false. |
566567
568+ ## Send raw gcode
569+
570+ ``` shell
571+ curl https://api.simplyprint.io/{id}/printers/actions/SendGcode? pid=1234 \
572+ -X POST \
573+ -H ' accept: application/json' \
574+ -H ' X-API-KEY: {API_KEY}' \
575+ -H ' Content-Type: application/json' \
576+ -d ' {
577+ "gcode": ["G28 XY"]
578+ }'
579+ ```
580+
581+ > Success response
582+
583+ ``` json
584+ {
585+ "status" : true ,
586+ "message" : null
587+ }
588+ ```
589+
590+ <aside class =" notice " >
591+ This endpoint requires the <b >Print Farm</b > plan.
592+ </aside >
593+
594+ | Required permissions |
595+ | ----------------------|
596+ | ` send_raw_gcode ` |
597+
598+ ` POST /{id}/printers/actions/SendGcode `
599+
600+ ### Request Parameters
601+
602+ | Parameter | Type | Description |
603+ | -----------| -----------| ---------------------------------------------------|
604+ | ` pid ` | integer[ ] | The ID(s) of the printer(s) to send the gcode to. |
605+
606+ #### Request body
607+
608+ | Parameter | Type | Required | Description |
609+ | -----------| ----------| ----------| -------------------------------------------------|
610+ | ` gcode ` | string[ ] | yes | Array of gcode commands to send to the printer. |
611+
612+ ### Response
613+
614+ | Parameter | Type | Description |
615+ | -----------| ---------| ---------------------------------------|
616+ | ` status ` | boolean | ` true ` if the request was successful. |
617+ | ` message ` | string | Error message if ` status ` is ` false ` . |
618+
567619## Delete / disconnect printer
568620
569621``` shell
0 commit comments