Formlabs Local API (0.9.9)

Download OpenAPI specification:

Introduction

The Formlabs Local API is designed for integrations that want to automate job preparation, getting local-network printer status, or sending jobs to Formlabs printers without launching the PreForm graphical user interface. A server application must be installed and run on a user's computer to use this API.

Example use cases:

  • Scripted job preparation that takes a folder of models, sets up a print, and uploads it to a printer without user input.
  • Deep and custom integrations into 3D Modeling and Design software to prepare print scenes beyond the scope of the PreForm Command Line Arguments.

This API uses RESTful principles. This means the API is organized around resources and collections of resources. Resources and collections are each available at their own URI. You can interact with these resources using standard HTTP Methods on the resource's URI.

Example endpoint:

GET http://localhost:44388/scene/

Responses from the API server will be in JSON and are documented throughout the reference docs. This API is described by an OpenAPI Specification. This interactive documentation is automatically generated from the specification file.

Technical Overview

PreFormServer Background Application

All Local API integrations involve starting the PreFormServer background application to expose its HTTP API, then making local HTTP API calls in your own code. This application is like PreForm, Formlabs' regular job preparation application, but it does not open a graphical window, and interaction is done via HTTP API requests. The PreFormServer application is supported on Windows and MacOS with separate downloads for each Operating System.

Installing PreFormServer

The PreFormServer application can be downloaded from the Formlabs API downloads and release notes page. After downloading, unzip the file and move the application to the desired location on your computer. Any location can be used as the path to the application should be referenced from your integration code.

Starting PreFormServer

The PreFormServer application can started manually from your Operating System's command prompt or terminal, but most integrations will start the application programmatically from integration code. The command line argument --port is required to specify the port number the HTTP Server will listen on.

The HTTP API server started by the PreFormServer application cannot immediately respond to requests. When the server is ready to accept requests, it will output READY FOR INPUT in the standard output.

For example, running the PreFormServer application on Windows from the command prompt:

PreFormServer.exe --port 44388

will output something like the following:

starting HTTP server
Listening...
HTTP server listening on port 44388
READY FOR INPUT

Making API Requests

The code to make HTTP API requests to a running PreFormServer can be written directly in your integration code or by using a generated library that does the API calls. The endpoints and format of the HTTP API are described on this page and in the openapi.yaml file. Formlabs provides an example Python library that handles the setup and request formatting.

Glossary

  • Scene: The current state of a job that can be printed on a particular printer model. This includes both the “Scene Settings” and all of the currently loaded models and their support structures.
  • Scene Settings: Printer type and material information of scene. Describes the build platform size, the printer capabilities, and what material and print settings it is set up to be printed with.

Stateful Interactions

The PreForm Server is stateful in that while it is running, it keeps a cache of scenes. By default, it caches 100 scenes in memory, with unlimited scenes stored on disk, though this may be changed with the --scene-cache-size parameter. Scenes are identified by their IDs, returned from the /scene/ endpoint. /scene/ endpoints also accept a scene ID of "default", which will use a single global scene. Endpoints with no scene id provided (e.g. /scene/auto-layout/) are deprecated. They will use the most recently created scene, and possibly modify it. All other /scene/ requests will use the user specified scene, and possibly modify it. For example, initially a scene may be empty and then if a load model request is made then the cached scene will have one model loaded. Calling the load model endpoint again will load another copy of the model resulting in two models in the cached scene.

Blocking Calls & Asynchronous Requests

Unless otherwise stated, API calls are blocking: the HTTP request will not return until the operation has completed. Some requests like running the auto support action on a scene with many complicated models could take over 1 minute (depending on computer resources). The Server has a timeout of 10 minutes for all requests.

Some long-running operations can be called asynchronously by adding ?async=true to the request. These requests will return immediately and the operation will be tracked separately. The caller can poll for completion using the /operations/{operation_id}/ endpoint, and track the percentage progress of the outstanding operation.

Requests involving the scene will always use the scene state at the time the request was made, without any partially completed operations. For example, if a “get scene” request is made during a “auto support” request that has not finished, then the “get scene” request will return data that will not include the auto support changes.

Multiple requests editing the same scene should NOT be made in parallel. If an "auto layout" request is made during an "auto support" request that has not finished, whichever operation finishes last will "win": either an auto-layout of unsupported models or the original layout with supports. PreformServer currently gives no warning when this happens.

File Paths

When saving and loading files, the local API inputs expect full operating system paths to local files on disk.

Correct file path:

  • C:\Projects\Models\part.stl

Incorrect file paths:

  • .\Models\part.stl
  • %ENV_VAR%\part.stl
  • part.stl
  • https://filestorage.com/part.stl

Errors

Conventional HTTP response codes are used to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate an error with Formlabs' servers.

Security

The HTTP Server that PreForm uses to communicate is only exposed to the local network of your computer and not to the public Internet, unless you have configured your computer to expose the port running the PreForm Server to the Internet.

Some requests require an Internet connection, require Dashboard login, and make web requests to perform their action (such as printing to a remote printer).

Devices

Endpoints related to Formlabs devices

Get Devices

List of previously discovered device statuses

By default, only locally discovered printer names are returned. To include your Fleet Control queues or printers registered to your Dashboard account, you must be logged in and have an Internet connection. Use the Login endpoint to authenticate with Formlabs Web Services.

query Parameters
can_print
boolean

If true, only devices that can receive prints will be returned.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "devices": [
    ]
}

Get Device

Get a previously discovered device's status

path Parameters
id
required
string

The unique identifier of the printer

Responses

Response samples

Content type
application/json
Example
{
  • "id": "string",
  • "product_name": "string",
  • "status": "string",
  • "is_connected": true,
  • "connection_type": "UNKNOWN",
  • "ip_address": "string",
  • "firmware_version": "string"
}

Discover Devices

Discover new devices on the network

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
timeout_seconds
integer

Number of seconds to wait when discovering devices

ip_address
string

Local network IP address to attempt to discover a device at

Responses

Request samples

Content type
application/json
Example
{
  • "timeout_seconds": 10
}

Response samples

Content type
application/json
{
  • "count": 0,
  • "devices": [
    ]
}

Upload Firmware

Upload new firmware to a device

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
printer
required
string

Local network IP address, or machine serial name to upload firmware to

file_path
required
string

Local file path to the firmware .formware or .formware2 file

Responses

Request samples

Content type
application/json
{
  • "printer": "Form4-TestyTest",
  • "file_path": "C:\\Users\\user\\Desktop\\form4-public-1.9.0-2444.formware"
}

Response samples

Content type
application/json
{
  • "count": 0,
  • "devices": [
    ]
}

Modifying a Scene

Endpoints related to modifying the scene

Create Scene

Create a new scene

Request Body schema: application/json
required

Create a scene with a given printing setup. For a full list of possible settings, call the GET /list-materials/ endpoint

One of
machine_type
required
string

The machine type of the scene

material_code
required
string

The material code of the scene

print_setting
string

The print setting of the scene

required
string or number

The slice thickness of the scene

custom_print_setting_id
string

The ID of the custom print setting used, if any.

Responses

Request samples

Content type
application/json
Example
{
  • "machine_type": "FORM-4-0",
  • "material_code": "FLGPBK05",
  • "print_setting": "DEFAULT",
  • "layer_thickness_mm": 0.025
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Create Default Scene

Create a default scene

Request Body schema: application/json
required

Create a default scene with a given printing setup. For a full list of possible settings, call the GET /list-materials/ endpoint

One of
machine_type
required
string

The machine type of the scene

material_code
required
string

The material code of the scene

print_setting
string

The print setting of the scene

required
string or number

The slice thickness of the scene

custom_print_setting_id
string

The ID of the custom print setting used, if any.

Responses

Request samples

Content type
application/json
Example
{
  • "machine_type": "FORM-4-0",
  • "material_code": "FLGPBK05",
  • "print_setting": "DEFAULT",
  • "layer_thickness_mm": 0.025
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Delete Default Scene

Delete the default scene. Replaces the default scene with a blank scene.

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Update Scene

Update the scene's properties

path Parameters
scene_id
required
string

The unique identifier of the scene

Request Body schema: application/json
required
One of
machine_type
required
string

The machine type of the scene

material_code
required
string

The material code of the scene

print_setting
string

The print setting of the scene

required
string or number

The slice thickness of the scene

custom_print_setting_id
string

The ID of the custom print setting used, if any.

Responses

Request samples

Content type
application/json
Example
{
  • "machine_type": "FORM-4-0",
  • "material_code": "FLGPBK05",
  • "print_setting": "DEFAULT",
  • "layer_thickness_mm": 0.025
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Delete Scene

Delete a scene

path Parameters
scene_id
required
string

The unique identifier of the scene

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Load .form file

Load a .form file and create a new scene from it

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Full path to the .form file to load

file
required
string

Responses

Request samples

Content type
application/json
{
  • "file": "C:\\Users\\user\\Desktop\\test.form"
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Update model

Update a model's properties

path Parameters
id
required
string

The unique identifier of the model

scene_id
required
string

The unique identifier of the scene

Request Body schema: application/json
required

Model properties to update

name
string

The name of the model used within job preparation.

object (ScenePositionModel)

The global position within the build volume of a printer of the model in the scene

EulerAnglesModel (object) or TransformMatrixModel (object) or DirectionVectorsModel (object) (OrientationModel)

The orientation of the model in the scene. It can be specified using one of the following: Euler angles, a transform matrix, or direction vectors.

scale
number

The scale factor to apply to the model

units
string (UnitsModel)
Enum: "MILLIMETERS" "INCHES"

The units of the model

lock
string (LockModel)
Default: "FREE"
Enum: "FREE" "LOCKED_XY_ROTATION_FREE_TRANSLATION" "LOCKED_ROTATION_FREE_TRANSLATION" "FULLY_LOCKED"

The orientation constraints of the model, which auto-pack operations will use

Responses

Request samples

Content type
application/json
Example
{
  • "position": {
    }
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Delete model

Delete a model from the current scene

path Parameters
id
required
string

The unique identifier of the model

scene_id
required
string

The unique identifier of the scene

Responses

Duplicate model

Duplicate a model

path Parameters
id
required
string

The unique identifier of the model

scene_id
required
string

The unique identifier of the scene

Request Body schema: application/json
required
count
integer

Number of duplicates to create

Responses

Request samples

Content type
application/json
{
  • "count": 0
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Replace model

Replace a model currently in the scene with a new model, copying the existing models setup and supports

path Parameters
id
required
string

The unique identifier of the model

scene_id
required
string

The unique identifier of the scene

Request Body schema: application/json
required
file
string

Full path to the file to load

repair_behavior
string (RepairBehaviorModel)
Default: "ERROR"
Enum: "REPAIR" "ERROR" "IGNORE"

The behavior to use when loading a broken model

Responses

Request samples

Content type
application/json
{
  • "file": "string",
  • "repair_behavior": "REPAIR"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "model_properties": {
    }
}

Import model

Import a model into the current scene

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
file
required
string

Full path to the file to load

repair_behavior
string (RepairBehaviorModel)
Default: "ERROR"
Enum: "REPAIR" "ERROR" "IGNORE"

The behavior to use when loading a broken model

name
string

The name of the model used within job preparation.

object (ScenePositionModel)

The global position within the build volume of a printer of the model in the scene

EulerAnglesModel (object) or TransformMatrixModel (object) or DirectionVectorsModel (object) (OrientationModel)

The orientation of the model in the scene. It can be specified using one of the following: Euler angles, a transform matrix, or direction vectors.

scale
number
Default: 1

The scale factor to apply to the model

units
string (ImportUnitsModel)
Default: "DETECTED"
Enum: "DETECTED" "MILLIMETERS" "INCHES"

The units of the model

lock
string (LockModel)
Default: "FREE"
Enum: "FREE" "LOCKED_XY_ROTATION_FREE_TRANSLATION" "LOCKED_ROTATION_FREE_TRANSLATION" "FULLY_LOCKED"

The orientation constraints of the model, which auto-pack operations will use

Responses

Request samples

Content type
application/json
Example
{
  • "file": "C:\\Users\\user\\Desktop\\test.stl"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "position": {
    },
  • "orientation": {
    },
  • "scale": 0,
  • "units": "MILLIMETERS",
  • "bounding_box": {
    },
  • "original_file": "string",
  • "visible": true,
  • "has_supports": true,
  • "in_bounds": true,
  • "raw_mesh_hash": "string",
  • "canonical_model_hash": "string",
  • "lock": "FREE"
}

Scan to model

Convert an STL scan of teeth to a solid, printable model in an SLA scene

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
file
required
string

Full path to the file to load

files
Array of strings

Array of paths to the files to load

units
string (ImportUnitsModel)
Default: "DETECTED"
Enum: "DETECTED" "MILLIMETERS" "INCHES"

The units of the model

cutoff_height_mm
required
number

Remove all scan data below this height (in mm) from the model, replace with extrude from the bottom of the model.

extrude_distance_mm
number

Extrude this distance (in mm) from the removed bottom of the model. Default is 0mm.

hollow
boolean

Whether to hollow the model.

enable_honeycomb_infill
boolean
Default: true

Whether to enable honeycomb infill when hollowing the model.

cutoff_below_gumline_mm
number

Remove all scan data below this height (in mm) from the model, relative to the gumline, replace with extrude from the bottom of the model.

shell_thickness_mm
number

The thickness of the outer shell of the model, in mm. Requires hollow=true.

wall_thickness_mm
number

The thickness of the honeycomb infill of the model, in mm. Requires hollow=true.

drain_hole_radius_mm
number
Default: 1.5

The radius of drain holes in the model, in mm. Requires hollow=true.

drain_hole_height_ratio
number
Default: 1

The ratio of the height of the drain hole to the width of the drain hole. Requires hollow=true.

drain_hole_suppression_distance_mm
number
Default: 2

When generating draining holes, don't attempt to place them within this distance of each other. In other words, this controls the minimum distance between drain holes. Requires hollow=true.

drain_hole_max_count
number
Default: 2

For each curve on the bottom of the model, place at most this many drain holes. Requires hollow=true.

enable_smooth_contour_extended_sides
boolean
Default: true

Whether to enable smoothing contours that are extended from the bottom of the model to form base sides.

Responses

Request samples

Content type
application/json
{
  • "file": "string",
  • "files": [
    ],
  • "units": "DETECTED",
  • "cutoff_height_mm": 0,
  • "extrude_distance_mm": 0,
  • "hollow": true,
  • "enable_honeycomb_infill": true,
  • "cutoff_below_gumline_mm": 0,
  • "shell_thickness_mm": 0,
  • "wall_thickness_mm": 0,
  • "drain_hole_radius_mm": 1.5,
  • "drain_hole_height_ratio": 1,
  • "drain_hole_suppression_distance_mm": 2,
  • "drain_hole_max_count": 2,
  • "enable_smooth_contour_extended_sides": true
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string",
  • "warnings": [
    ],
  • "infos": [
    ]
}

Auto Orient

Automatically choose model orientation for printing

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Models to run the auto orient operation on

One of
Select all models (string) or Array of Apply to a list of specific models (strings) (ModelsSelectionModel)
Default: "ALL"

Responses

Request samples

Content type
application/json
Example
{
  • "models": "ALL"
}

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Auto Support

Generate support structures on models

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Models to run the auto support operation on

Select all models (string) or Array of Apply to a list of specific models (strings) (ModelsSelectionModel)
Default: "ALL"
density
number >= 0

Unitless factor to adjust the density of supports (default is 1.0)

slope_multiplier
number >= 0

Unitless factor to increase or decrease support density on steep slopes (default is 1.0)

only_minima
boolean

Whether to only generate touchpoints on local minima, skipping all other supports. Default is false.

raft_type
string
Enum: "FULL_RAFT" "MINI_RAFT" "MINI_RAFTS_ON_BP"

The type of raft to apply to the models

raft_label_enabled
boolean

Whether to enable raft labeling

breakaway_structure_enabled
boolean

Whether to enable breakaway structure

touchpoint_size_mm
number >= 0

The size of the touchpoints

internal_supports_enabled
boolean

Whether to enable internal supports

raft_thickness_mm
number >= 0

The thickness of the raft

height_above_raft_mm
number >= 0
z_compression_correction_mm
number >= 0
early_layer_merge_mm
number >= 0

Responses

Request samples

Content type
application/json
Example
{
  • "models": "ALL"
}

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Auto Layout

Automatically arrange models on the build platform. Only applies to SLA-type scenes like the Form 4 (use /scene/auto-pack/ for SLS-type scenes like the Fuse 1+)

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Models to run the auto layout operation on

Select all models (string) or Array of Apply to a list of specific models (strings) (ModelsSelectionModel)
Default: "ALL"
mode
string
Value: "DENTAL"

"DENTAL" mode applies algorithms used in PreForm's Dental Workspace. Leave mode unset to use algorithms from the Standard Workspace.

model_spacing_mm
number >= 0

Minimum (non-zero) distance between models in the scene.

allow_overlapping_supports
boolean

Whether to allow rafts to overlap.

lock_rotation
boolean

Whether to keep model rotation about Z fixed during layout.

build_platform_2_optimized
boolean

Whether to optimize the build platform for two models.

object

Bounds to keep selected models inside in the layout operation (default is the maximum that will fit on the build platform)

Responses

Request samples

Content type
application/json
Example
{
  • "models": "ALL",
  • "model_spacing_mm": 1,
  • "allow_overlapping_supports": false,
  • "lock_rotation": false,
  • "build_platform_2_optimized": false
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Auto Pack

Automatically arrange models in the build volume. Only applies to SLS-type scenes like the Fuse 1+ (use /scene/auto-layout/ for SLA-type scenes like the Form 4)

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Auto pack parameters

model_spacing_mm
number >= 0

The minimum spacing between models when packing

Responses

Request samples

Content type
application/json
{
  • "model_spacing_mm": 0
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Pack and Cage

Automatically arrange models in the build volume and create a cage around them. Only applies to SLS-type scenes like the Fuse 1+.

Request Body schema: application/json
required

Auto pack parameters

required
Select all models (string) or Array of Apply to a list of specific models (strings)
Default: "ALL"

A list of models to pack and cage

object (PackingTypeModel)

Different ways to pack a selection of models

cage_label
string

The label engraved on the part cage.

generate_mesh_label
boolean

Whether or not to physically emboss the label of the part cage

model_spacing_mm
number >= 0

Minimum distance between models in the cage.

bar_spacing_mm
number >= 0

Space between the bars of the cage

bar_thickness_mm
number >= 1

The space between the bars of the cage

bar_width_mm
number >= 1

Width of the bars of the cage. Defaults to the same as bar_thickness_mm

distance_to_cage_mm
number >= 0

Extra space between the models and the cage walls

enable_round_edges
boolean
Default: false

Rounds the edges of external cage corners

enable_square_bars
boolean
Default: true

Generate square bars for the cage

Responses

Request samples

Content type
application/json
{
  • "models": "ALL",
  • "packing_type": {
    },
  • "cage_label": "string",
  • "generate_mesh_label": true,
  • "model_spacing_mm": 0,
  • "bar_spacing_mm": 0,
  • "bar_thickness_mm": 1,
  • "bar_width_mm": 1,
  • "distance_to_cage_mm": 0,
  • "enable_round_edges": false,
  • "enable_square_bars": true
}

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Hollow Model

Hollows the specified models

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
Select all models (string) or Array of Apply to a list of specific models (strings)
Default: "ALL"

A list of models to hollow

wall_thickness_mm
number >= 0.1

The desired wall thickness of the hollowed models

feature_size_mm
number >= 0.05
Default: 1

The size of features to keep on hollowed geometry. Higher values will produce a smoother, simpler inner hollowed surface with a less accurate thickness wall thickness around features smaller than this value.

accuracy
number [ 0 .. 1 ]
Default: 0.5

The accuracy of the hollowing operation. Higher values are slower but more accurate.

Responses

Request samples

Content type
application/json
{
  • "models": "ALL",
  • "wall_thickness_mm": 0.1,
  • "feature_size_mm": 1,
  • "accuracy": 0.5
}

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "infos": [
    ]
}

Label Part

Labels the specified model. Labels wrap around a model's surface.

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
model_id
required
string

The ID of the model to label

required
EulerAnglesModel (object) or TransformMatrixModel (object) or DirectionVectorsModel (object)

The orientation of the label (+x left-to-right along text, +y top-to-bottom along text, +z normal to text plane).

required
object

The global position within the build volume of a printer of the model in the scene

label
required
string

The label's text

application_mode
string
Default: "EMBOSS"
Enum: "EMBOSS" "ENGRAVE"
font_size_mm
required
number [ 2 .. 20 ]

The font size of the label

depth_mm
required
number [ 0.2 .. 10 ]

The label's extrusion depth. This depth is a constant offset from the model's surface.

Responses

Request samples

Content type
application/json
{
  • "model_id": "string",
  • "orientation": {
    },
  • "position": {
    },
  • "label": "string",
  • "application_mode": "EMBOSS",
  • "font_size_mm": 2,
  • "depth_mm": 0.2
}

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "infos": [
    ]
}

Add Drain Holes

Add specified drain holes to specified model

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Drain hole parameters

model_id
required
string

The ID of the model to add drain holes to

required
Array of objects (DrainHoleModel) non-empty

List of drain holes to add

Responses

Request samples

Content type
application/json
{
  • "model_id": "string",
  • "drain_holes": [
    ]
}

Response samples

Content type
application/json
{
  • "plugs": "ALL",
  • "warnings": [
    ],
  • "infos": [
    ]
}

Getting Scene Information

Endpoints related to getting information about a scene

Get All Scenes

Get data about all scenes

Responses

Response samples

Content type
application/json
{
  • "scenes": [
    ]
}

Get Scene

Get data about the scene with the given ID, or the most recently created scene if no ID is provided

path Parameters
scene_id
required
string

The unique identifier of the scene

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Get model

Get a model's properties

path Parameters
id
required
string

The unique identifier of the model

scene_id
required
string

The unique identifier of the scene

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "position": {
    },
  • "orientation": {
    },
  • "scale": 0,
  • "units": "MILLIMETERS",
  • "bounding_box": {
    },
  • "original_file": "string",
  • "visible": true,
  • "has_supports": true,
  • "in_bounds": true,
  • "raw_mesh_hash": "string",
  • "canonical_model_hash": "string",
  • "lock": "FREE"
}

Get Print Validation

Calculate the print validation for the current scene

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Responses

Response samples

Content type
application/json
{
  • "per_model_results": {
    }
}

Estimate Print Time

Calculate the estimated print time for the current scene

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Responses

Response samples

Content type
application/json
Example
{
  • "total_print_time_s": 0,
  • "preprint_time_s": 0,
  • "printing_time_s": 0
}

Get Scene Interferences

Returns a list of pairs of IDs of interfering models.

path Parameters
scene_id
required
string

The unique identifier of the scene

Request Body schema: application/json
optional

Interferences parameters

collision_offset_mm
number >= 0

The minimum distance between models for them not to be considered interfering with each other.

Responses

Request samples

Content type
application/json
{
  • "collision_offset_mm": 0
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Exporting

Save .form file

Save the current scene to a .form file

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Full path where the file should be saved

file
required
string

Responses

Request samples

Content type
application/json
{
  • "file": "C:\\Users\\user\\Desktop\\test.form"
}

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Save screenshot file

Save a screenshot of the current scene.

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required

Full path where the image should be saved

file
required
string^.*\.(png|webp)$

The file path to save the .png/.webp screenshot or .webp flyaround to

view_type
string
Default: "ZOOM_ON_MODELS"
Enum: "ZOOM_ON_MODELS" "FULL_BUILD_VOLUME" "FULL_PLATFORM_WIDTH"

The type of view to use when taking the screenshot

yaw
number
Default: 45

Yaw rotation in degrees for the camera's view, where 0º looks down the negative X-axis

pitch
number
Default: 35.264

Pitch rotation in degrees for the camera's view, where 0º looks flat from the horizon and positive angles look down on models (in SLA scenes, toward the build platform)

image_size_px
integer
Default: 820

Size of the largest dimension of the exported image in pixels.

crop_to_models
boolean
Default: true

If the screenshot view should be sized and cropped so the models take up most of the frame. If false, the zooming will be the same for all viewing angles.

Select all models (string) or Array of Apply to a list of specific models (strings) (ModelsSelectionModel)
Default: "ALL"
object

Responses

Request samples

Content type
application/json
Example
{
  • "file": "C:\\Users\\user\\Desktop\\screenshot.png"
}

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Save FPS file

Save the print settings of the current scene to a .fps file

path Parameters
scene_id
required
string

The unique identifier of the scene

Request Body schema: application/json
required

Full path where the FPS file should be saved

file
required
string^.*\.fps$

The file path to save the .fps file to

Responses

Request samples

Content type
application/json
{
  • "file": "C:\\Users\\user\\Desktop\\custom-grey.fps"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Printing

Print

Upload the current scene to a printer or Fleet Control.

By default, only locally discovered printer names or local IP addresses are supported. To upload prints remotely to your Fleet Control queue or printers registered to your Dashboard account, you must be logged in and have an Internet connection. Use the Login endpoint to authenticate with Formlabs Web Services.

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
printer
required
string

Printer serial name, IP address, or Fleet Control Queue ID

job_name
required
string
find_printer_timeout_seconds
integer >= 0
Default: 30

Number of seconds to wait to find the given printer.

print_now
boolean

If true, the job should be printed immediately if the printer's "ready_to_print_now" status is true. Attempting to print now on a printer that does not support it will result in an error. If false, the job should be uploaded to the printer's local queue. Not including this value will default to printing now if the printer is in a ready state, and queueing the job otherwise.

Responses

Request samples

Content type
application/json
{
  • "printer": "10.35.15.12",
  • "job_name": "Test Job"
}

Response samples

Content type
application/json
{
  • "job_id": "string"
}

Remote Access

Endpoints related to remote access and printing that require Internet access and authentication with Formlabs Web Services."

Login

Log in to Formlabs Web Services using an existing formlabs.com account.

Request Body schema: application/json
required

User credentials

One of
username
required
string
password
required
string

Responses

Request samples

Content type
application/json
Example
{
  • "username": "username",
  • "password": "password"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "refresh_token": "string"
}

Log out

Log out of Formlabs Web Services

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Get logged in user information

Get the logged in user's account information

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "string",
  • "persistent_id": "string"
}

Print

Upload the current scene to a printer or Fleet Control.

By default, only locally discovered printer names or local IP addresses are supported. To upload prints remotely to your Fleet Control queue or printers registered to your Dashboard account, you must be logged in and have an Internet connection. Use the Login endpoint to authenticate with Formlabs Web Services.

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
printer
required
string

Printer serial name, IP address, or Fleet Control Queue ID

job_name
required
string
find_printer_timeout_seconds
integer >= 0
Default: 30

Number of seconds to wait to find the given printer.

print_now
boolean

If true, the job should be printed immediately if the printer's "ready_to_print_now" status is true. Attempting to print now on a printer that does not support it will result in an error. If false, the job should be uploaded to the printer's local queue. Not including this value will default to printing now if the printer is in a ready state, and queueing the job otherwise.

Responses

Request samples

Content type
application/json
{
  • "printer": "10.35.15.12",
  • "job_name": "Test Job"
}

Response samples

Content type
application/json
{
  • "job_id": "string"
}

Get Devices

List of previously discovered device statuses

By default, only locally discovered printer names are returned. To include your Fleet Control queues or printers registered to your Dashboard account, you must be logged in and have an Internet connection. Use the Login endpoint to authenticate with Formlabs Web Services.

query Parameters
can_print
boolean

If true, only devices that can receive prints will be returned.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "devices": [
    ]
}

Get Device

Get a previously discovered device's status

path Parameters
id
required
string

The unique identifier of the printer

Responses

Response samples

Content type
application/json
Example
{
  • "id": "string",
  • "product_name": "string",
  • "status": "string",
  • "is_connected": true,
  • "connection_type": "UNKNOWN",
  • "ip_address": "string",
  • "firmware_version": "string"
}

Discover Devices

Discover new devices on the network

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
timeout_seconds
integer

Number of seconds to wait when discovering devices

ip_address
string

Local network IP address to attempt to discover a device at

Responses

Request samples

Content type
application/json
Example
{
  • "timeout_seconds": 10
}

Response samples

Content type
application/json
{
  • "count": 0,
  • "devices": [
    ]
}

Print Settings

Endpoints related to getting available print settings.

List Materials

List all available materials and material settings by printer type. The returned JSON has 3 layers: Printer types (e.g. "Form 4"), Materials (e.g. "Black V5"), and Material Setting (e.g. "0.025mm" or "0.100mm (Legacy)"). These "label" strings at each level are the preferred way of referring to that printer types, materials, and settings. They can presented in a UI as a 3-level dropdown menu, or a flat filtered list. This list is static (it will not change for a given version of the PreFormServer executable). Each value has scene_settings with all data needed to create a new scene. It can be passed directly to a /scene/ POST to create a scene for that printer, material, and materialSettings.

Responses

Response samples

Content type
application/json
{
  • "printer_types": [
    ]
}

Operations

Long-running operations called with ?async=true, which return immediately and can be polled for completion.

Print

Upload the current scene to a printer or Fleet Control.

By default, only locally discovered printer names or local IP addresses are supported. To upload prints remotely to your Fleet Control queue or printers registered to your Dashboard account, you must be logged in and have an Internet connection. Use the Login endpoint to authenticate with Formlabs Web Services.

path Parameters
scene_id
required
string

The unique identifier of the scene

query Parameters
async
boolean

Whether to run the operation asynchronously

Request Body schema: application/json
required
printer
required
string

Printer serial name, IP address, or Fleet Control Queue ID

job_name
required
string
find_printer_timeout_seconds
integer >= 0
Default: 30

Number of seconds to wait to find the given printer.

print_now
boolean

If true, the job should be printed immediately if the printer's "ready_to_print_now" status is true. Attempting to print now on a printer that does not support it will result in an error. If false, the job should be uploaded to the printer's local queue. Not including this value will default to printing now if the printer is in a ready state, and queueing the job otherwise.

Responses

Request samples

Content type
application/json
{
  • "printer": "10.35.15.12",
  • "job_name": "Test Job"
}

Response samples

Content type
application/json
{
  • "job_id": "string"
}

List All Operations

List all in-progress, completed, and failed operations that have been started since this server was launched. Operations are not currently persisted across server restarts. To get the result of a completed or errored operation, call GET /operations/{id}/.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "operations": [
    ]
}

Get Operation Status

Retrieve the status, progress, and result of a long-running operation by its ID.

path Parameters
id
required
string

The unique identifier of the operation.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "status": "IN_PROGRESS",
  • "progress": 0.1,
  • "result": { }
}

API Info

Get information about the API itself

Get API Version

Get the version of the API

Responses

Response samples

Content type
application/json
{
  • "version": "string"
}

Modifying a Scene - deprecated

Endpoints related to modifying the scene

Update Scene

Deprecated. See /scene/{scene_id}/

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Update model

path Parameters
id
required
string

The unique identifier of the model

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Delete model

path Parameters
id
required
string

The unique identifier of the model

Responses

Duplicate model

path Parameters
id
required
string

The unique identifier of the model

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Replace model

path Parameters
id
required
string

The unique identifier of the model

Responses

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "model_properties": {
    }
}

Import model

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "position": {
    },
  • "orientation": {
    },
  • "scale": 0,
  • "units": "MILLIMETERS",
  • "bounding_box": {
    },
  • "original_file": "string",
  • "visible": true,
  • "has_supports": true,
  • "in_bounds": true,
  • "raw_mesh_hash": "string",
  • "canonical_model_hash": "string",
  • "lock": "FREE"
}

Scan to model

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string",
  • "warnings": [
    ],
  • "infos": [
    ]
}

Auto Orient

Responses

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Auto Support

Responses

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Auto Layout

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Auto Pack

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Hollow Model

Deprecated. See /scene/{scene_id}/hollow/

Responses

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "infos": [
    ]
}

Label Part

Deprecated. See /scene/{scene_id}/label/

Responses

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "infos": [
    ]
}

Add Drain Holes

Responses

Response samples

Content type
application/json
{
  • "plugs": "ALL",
  • "warnings": [
    ],
  • "infos": [
    ]
}

Getting Scene Information - deprecated

Endpoints related to getting information about a scene

Get Scene

Deprecated. See /scene/{scene_id}/

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "scene_settings": {
    },
  • "material_usage": {
    },
  • "layer_count": 0,
  • "id": "string"
}

Get model

path Parameters
id
required
string

The unique identifier of the model

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "position": {
    },
  • "orientation": {
    },
  • "scale": 0,
  • "units": "MILLIMETERS",
  • "bounding_box": {
    },
  • "original_file": "string",
  • "visible": true,
  • "has_supports": true,
  • "in_bounds": true,
  • "raw_mesh_hash": "string",
  • "canonical_model_hash": "string",
  • "lock": "FREE"
}

Get Print Validation

Responses

Response samples

Content type
application/json
{
  • "per_model_results": {
    }
}

Estimate Print Time

Responses

Response samples

Content type
application/json
Example
{
  • "total_print_time_s": 0,
  • "preprint_time_s": 0,
  • "printing_time_s": 0
}

Get Scene Interferences

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Exporting - deprecated

Save .form file

Responses

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Save screenshot file

Responses

Response samples

Content type
application/json
{
  • "operationId": "string"
}

Save FPS file

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Printing - deprecated

Print

Deprecated. See /scene/{scene_id}/print/

Responses

Response samples

Content type
application/json
{
  • "job_id": "string"
}

Remote Access - deprecated

Endpoints related to remote access and printing that require Internet access and authentication with Formlabs Web Services."

Print

Deprecated. See /scene/{scene_id}/print/

Responses

Response samples

Content type
application/json
{
  • "job_id": "string"
}

Operations - deprecated

Long-running operations called with ?async=true, which return immediately and can be polled for completion.

Operations - deprecated:

Print

Deprecated. See /scene/{scene_id}/print/

Responses

Response samples

Content type
application/json
{
  • "job_id": "string"
}