Printer profile operations¶
Contents
OctoPrint allows the management of Printer profiles that define a printer’s physical properties (such as print volume, whether a heated bed is available, maximum speeds on its axes etc). The data stored within these profiles is used for both slicing and gcode visualization.
Retrieve all printer profiles¶
-
GET
/api/printerprofiles
¶ Retrieves an object representing all configured printer profiles.
Returns a 200 OK with a profile list.
Requires the
CONNECTION
permission.Example
GET /api/printerprofiles HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "profiles": { "_default": { "id": "_default", "name": "Default", "color": "default", "model": "Generic RepRap Printer", "default": true, "current": true, "resource": "http://example.com/api/printerprofiles/_default", "volume": { "formFactor": "rectangular", "origin": "lowerleft", "width": 200, "depth": 200, "height": 200 }, "heatedBed": true, "heatedChamber": false, "axes": { "x": { "speed": 6000, "inverted": false }, "y": { "speed": 6000, "inverted": false }, "z": { "speed": 200, "inverted": false }, "e": { "speed": 300, "inverted": false } }, "extruder": { "count": 1, "offsets": [ {"x": 0.0, "y": 0.0} ] } }, "my_profile": { "id": "my_profile", "name": "My Profile", "color": "default", "model": "My Custom Printer", "default": false, "current": false, "resource": "http://example.com/api/printerprofiles/my_profile", "volume": { "formFactor": "rectangular", "origin": "lowerleft", "width": 200, "depth": 200, "height": 200 }, "heatedBed": true, "heatedChamber": true, "axes": { "x": { "speed": 6000, "inverted": false }, "y": { "speed": 6000, "inverted": false }, "z": { "speed": 200, "inverted": false }, "e": { "speed": 300, "inverted": false } }, "extruder": { "count": 1, "offsets": [ {"x": 0.0, "y": 0.0} ] } }, } }
Retrieve a single printer profile¶
-
GET
/api/printerprofiles/
(string: identifier)¶ Retrieves an existing single printer profile.
Returns a 200 OK with a profile.
Requires the
CONNECTION
permission.- Status Codes
200 OK – No error
404 Not Found – The profile does not exist
Add a new printer profile¶
-
POST
/api/printerprofiles
¶ Adds a new printer profile based on either the current default profile or the profile identified in
basedOn
.The provided profile data will be merged with the profile data from the base profile.
If a profile with the same
id
does already exist, a 400 Bad Request will be returned.Returns a 200 OK with the saved profile as property
profile
in the JSON body upon success.Requires the
SETTINGS
permission.Example 1
Creating a new profile
some_profile
based on the current default profile.POST /api/printerprofiles HTTP/1.1 Host: example.com X-Api-Key: abcdef... Content-Type: application/json { "profile": { "id": "some_profile", "name": "Some profile", "model": "Some cool model" } }
HTTP/1.1 200 OK Content-Type: application/json { "profile": { "id": "some_profile", "name": "Some profile", "color": "default", "model": "Some cool model", "default": false, "current": false, "resource": "http://example.com/api/printerprofiles/some_profile", "volume": { "formFactor": "rectangular", "origin": "lowerleft", "width": 200, "depth": 200, "height": 200 }, "heatedBed": true, "heatedChamber": false, "axes": { "x": { "speed": 6000, "inverted": false }, "y": { "speed": 6000, "inverted": false }, "z": { "speed": 200, "inverted": false }, "e": { "speed": 300, "inverted": false } }, "extruder": { "count": 1, "offsets": [ {"x": 0.0, "y": 0.0} ] } } }
Example 2
Creating a new profile
some_other_profile
based on existing profilesome_profile
.POST /api/printerprofiles HTTP/1.1 Host: example.com X-Api-Key: abcdef... Content-Type: application/json { "profile": { "id": "some_other_profile", "name": "Some other profile", "heatedBed": false, "volume": { "formFactor": "circular", "origin": "center", "width": "150", "height": "300" }, "extruder": { "count": 2, "offsets": [ {"x": 0.0, "y": 0.0}, {"x": 21.6, "y": 0.0} ] } }, "basedOn": "some_profile" }
HTTP/1.1 200 OK Content-Type: application/json { "profile": { "id": "some_other_profile", "name": "Some other profile", "color": "default", "model": "Some cool model", "default": false, "current": false, "resource": "http://example.com/api/printerprofiles/some_other_profile", "volume": { "formFactor": "circular", "origin": "center", "width": 150, "depth": 150, "height": 300 }, "heatedBed": false, "heatedChamber": false, "axes": { "x": { "speed": 6000, "inverted": false }, "y": { "speed": 6000, "inverted": false }, "z": { "speed": 200, "inverted": false }, "e": { "speed": 300, "inverted": false } }, "extruder": { "count": 2, "offsets": [ {"x": 0.0, "y": 0.0}, {"x": 21.6, "y": 0.0} ] } } }
Update an existing printer profile¶
-
PATCH
/api/printerprofiles/
(string: profile)¶ Updates an existing printer profile by its
profile
identifier.The updated (potentially partial) profile is expected in the request’s body as part of an Add or update request.
Returns a 200 OK with the saved profile as property
profile
in the JSON body upon success.Requires the
SETTINGS
permission.Example
PATCH /api/printerprofiles/some_profile HTTP/1.1 Host: example.com X-Api-Key: abcdef... Content-Type: application/json { "profile": { "name": "Some edited profile", "volume": { "depth": "300" } } }
HTTP/1.1 200 OK Content-Type: application/json { "profile": { "id": "some_profile", "name": "Some edited profile", "color": "default", "model": "Some cool model", "default": false, "current": false, "resource": "http://example.com/api/printerprofiles/some_profile", "volume": { "formFactor": "rectangular", "origin": "lowerleft", "width": 200, "depth": 300, "height": 200 }, "heatedBed": true, "heatedChamber": false, "axes": { "x": { "speed": 6000, "inverted": false }, "y": { "speed": 6000, "inverted": false }, "z": { "speed": 200, "inverted": false }, "e": { "speed": 300, "inverted": false } }, "extruder": { "count": 2, "offsets": [ {"x": 0.0, "y": 0.0}, {"x": 21.6, "y": 0.0} ] } } }
Remove an existing printer profile¶
-
DELETE
/api/printerprofiles/
(string: profile)¶ Deletes an existing printer profile by its
profile
identifier.If the profile to be deleted is the currently selected profile, a 409 Conflict will be returned.
Returns a 204 No Content an empty body upon success.
Requires the
SETTINGS
permission.Example
DELETE /api/printerprofiles/some_profile HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 204 No Content
Data model¶
Profile list¶
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
1 |
Object |
Collection of all printer profiles available in the system |
|
0..1 |
Information about a profile stored in the system. |
Add or update request¶
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
1 |
Information about the profile being added/updated. Only the values to be overwritten need to be supplied.
Unset fields will be taken from the base profile, which for add requests will be the
current default profile unless a different base is defined in the |
|
|
0..1 |
|
Only for add requests, ignored on updates: The identifier of the profile to base the new profile on, if different than the current default profile. |