Skip to content

Fit calibration values from measured readings (nothing is saved)

POST
/api/v1/printers/{printer_id}/calibration/{tray}/fit
curl --request POST \
--url https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/calibration/example/fit \
--header 'Content-Type: application/json' \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \
--data '{ "readings": [ { "across_mm": 1, "col_gap": 1, "down_mm": 1, "row_gap": 1 } ], "type": "example", "version": 1 }'
printer_id
required
Printer Id

Printer id (a page printer).

string format: uuid

Printer id (a page printer).

tray
required
Tray

Tray key.

string
>= 1 characters <= 100 characters

Tray key.

Media typeapplication/json
FitRequest
object
readings
required
Readings
Array<object>
>= 3 items <= 200 items
ReadingIn
object
across_mm
required
Across Mm

Ink offset to the right, mm.

number
>= -20 <= 20
col_gap
required
Col Gap

Vertical gap S1, S2, … counted from 1.

integer
>= 1 <= 1000
down_mm
required
Down Mm

Ink offset downwards, mm.

number
>= -20 <= 20
row_gap
required
Row Gap

Horizontal gap Z1, Z2, … counted from 1.

integer
>= 1 <= 1000
type
required
Type

Sheet type key.

string
>= 1 characters <= 200 characters
version
Version

Defaults to the current version.

Any of:
integer
>= 1

Example generated

{
"readings": [
{
"across_mm": 1,
"col_gap": 1,
"down_mm": 1,
"row_gap": 1
}
],
"type": "example",
"version": 1
}

Successful Response

Media typeapplication/json
FitResponse
object
flagged
required
Flagged

0-based indices into readings of those further than 0.3 mm from the fit.

Array<integer>
out_of_range
required
Out Of Range

Names of values outside the allowed ranges.

Array<string>
residuals_mm
required
Residuals Mm
Array<number>
values
required
CalibrationIn

A printer’s measured deviation; the hub applies the inverse when it renders (D17).

Offsets are millimetres (±10, at most 2 decimals), scales are factors (0.95 to 1.05, at most 6 decimals), rotation is degrees (±2, at most 6 decimals, positive is clockwise). The bounds are checked by the service and reported as calibration_out_of_range; the fit endpoint returns values of this shape even when they are outside the bounds.

object
offset_x_mm
Offset X Mm

Mm; allowed -10.0 to 10.0, at most 2 decimals (checked by the service).

number
0 >= -10 <= 10
offset_y_mm
Offset Y Mm

Mm; allowed -10.0 to 10.0, at most 2 decimals (checked by the service).

number
0 >= -10 <= 10
rotation_deg
Rotation Deg

Degrees, positive is clockwise; allowed -2.0 to 2.0, at most 6 decimals (checked by the service).

number
0 >= -2 <= 2
scale_x
Scale X

Factor; allowed 0.95 to 1.05, at most 6 decimals (checked by the service).

number
default: 1 >= 0.95 <= 1.05
scale_y
Scale Y

Factor; allowed 0.95 to 1.05, at most 6 decimals (checked by the service).

number
default: 1 >= 0.95 <= 1.05

Example

{
"values": {
"offset_x_mm": 0,
"offset_y_mm": 0,
"rotation_deg": 0,
"scale_x": 1,
"scale_y": 1
}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}