Slicing
Warning
The interface documented here is the status quo that might be changed while the interfaces are streamlined for a more general consumption. If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when something changes.
The Slicing API on one hand offers methods for managing slicing profiles stored within OctoPrint, on the other hand
it will be extended in the future to also allow for multi extruder slicing (which currently is not possible with the
slice
command of the File operations API and other things.
List All Slicers and Slicing Profiles
- GET /api/slicing
Returns a list of all available slicing profiles for all registered slicers in the system.
Returns a 200 OK response with a Slicer list as the body upon successful completion.
Requires the
SLICE
permission.Example
GET /api/slicing HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "curalegacy": { "key": "curalegacy", "displayName": "Cura Legacy", "default": true, "profiles": { "high_quality": { "key": "high_quality", "displayName": "High Quality", "default": false, "resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality" }, "medium_quality": { "key": "medium_quality", "displayName": "Medium Quality", "default": true, "resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality" } } } }
- Status Codes:
200 OK – No error
List Slicing Profiles of a Specific Slicer
- GET /api/slicing/(string: slicer)/profiles
Returns a list of all available slicing profiles for the requested slicer.
Returns a 200 OK response with a Profile list as the body upon successful completion.
Requires the
SLICE
permission.Example
GET /api/slicing/curalegacy/profiles HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "high_quality": { "key": "high_quality", "displayName": "High Quality", "default": false, "resource": "http://example.com/api/slicing/curalegacy/profiles/high_quality" }, "medium_quality": { "key": "medium_quality", "displayName": "Medium Quality", "default": true, "resource": "http://example.com/api/slicing/curalegacy/profiles/medium_quality" } }
- Parameters:
slicer – The identifying key of the slicer for which to list the available profiles.
- Status Codes:
200 OK – No error
404 Not Found – If the
slicer
was unknown to the system or not yet configured.
Retrieve Specific Profile
- GET /api/slicing/(string: slicer)/profiles/(string: key)
Retrieves the specified profile from the system.
Returns a 200 OK response with a full Profile as the body upon successful completion.
Requires the
SLICE
permission.Example
GET /api/slicing/curalegacy/profiles/quick_test HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "displayName": "Just a test", "description": "This is just a test", "resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test", "data": { "bottom_layer_speed": 20.0, "bottom_thickness": 0.3, "brim_line_count": 20, "cool_head_lift": false, "cool_min_feedrate": 10.0, "cool_min_layer_time": 5.0 } }
- Parameters:
slicer – The identifying key of the slicer for which to list the available profiles.
name – The identifying key of the profile to retrieve
- Status Codes:
200 OK – No error
404 Not Found – If the
slicer
or the profilekey
was unknown to the system.
Add Slicing Profile
- PUT /api/slicing/(string: slicer)/profiles/(string: key)
Adds a new slicing profile for the given
slicer
to the system. If the profile identified bykey
already exists, it will be overwritten.Expects a Profile as body.
Returns a 201 Created and an abridged Profile in the body upon successful completion.
Requires the
SETTINGS
permission.Example
PUT /api/slicing/curalegacy/profiles/quick_test HTTP/1.1 Host: example.com X-Api-Key: abcdef... Content-Type: application/json { "displayName": "Just a test", "description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count", "data": { "layer_height": 0.2, "skirt_line_count": 3 } }
HTTP/1.1 201 Created Content-Type: application/json Location: http://example.com/api/slicing/cura/profiles/quick_test { "displayName": "Just a test", "description": "This is just a test to show how to create a curalegacy profile with a different layer height and skirt count", "resource": "http://example.com/api/slicing/curalegacy/profiles/quick_test" }
- Parameters:
slicer – The identifying key of the slicer for which to add the profile
key – The identifying key of the new profile
- Status Codes:
201 Created – No error
404 Not Found – If the
slicer
was unknown to the system.
Update Slicing Profile
- PATCH /api/slicing/(string: slicer)/profiles/(string: key)
Updates the slicing profile identified by
key
for the slicerslicer
.Expects a profile update request as body.
Returns a 201 Created and an abridged Profile in the body upon successful completion.
Requires the
SETTINGS
permission.- Parameters:
slicer – The identifying key of the slicer for which to update the profile
key – The identifying key of the profile to update
- JSON Parameters:
data – New profile overrides to apply
displayName – New display name
description – New description
default – Whether to make the profile default (true) or not (false) for the slicer
- Status Codes:
200 OK – No error
404 Not Found – Slicer or profile do not exist
Delete Slicing Profile
- DELETE /api/slicing/(string: slicer)/profiles/(string: key)
Delete the slicing profile identified by
key
for the slicerslicer
. If the profile doesn’t exist, the request will succeed anyway.Requires the
SETTINGS
permission.- Parameters:
slicer – The identifying key of the slicer for which to delete the profile
key – The identifying key of the profile to delete
- Status Codes:
204 No Content – No error
404 Not Found – If the
slicer
was unknown to the system.
Data model
Slicer list
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
0..* |
Information about a slicer registered in the system, incl. stored profiles without |
Slicer
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
1 |
|
Identifier of the slicer |
|
1 |
|
Display name of the slicer |
|
1 |
|
Whether the slicer runs on the same device as OctoPrint ( |
|
1 |
|
Whether the slicer is the default slicer to use ( |
|
0..* |
Slicing profiles available for this slicer, mapped by their |
Profile list
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
0..1 |
Information about a profile stored in the system, |
Profile
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
1 |
|
Identifier of the profile |
|
0..1 |
|
Display name of the profile |
|
0..1 |
|
Description of the profile |
|
0..1 |
|
Whether this is the default profile to be used with this slicer ( |
|
0..1 |
|
Resource URL of the profile, will always be returned in responses but can be left out of save/update requests. |
|
0..1 |
Object |
The actual profile data, including any default values if the profile was retrieved from the server. May contain only the keys differing from the defaults when saving/updating a profile. The keys to be found in here a slicer specific. Will be left out for list responses. |
Profile Update Request
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
0..1 |
Object |
The profile data |
|
0..1 |
|
The new display name for the profile |
|
0..1 |
|
The new description for the profile |
|
0..1 |
|
Whether to mark the profile as default for the slicer (true) or not (false) |