Skip to main content

The profile object

The JSON body accepted by POST /api/v1/profiles. A profile is a name plus an ordered list of features that describe the cross-section, walking from one edge of the blank to the other.

Profile fields

FieldTypeRequiredNotes
profileNamestringyesMust not be empty. Not required to be unique.
featuresarrayyesSee Features. Must not be empty.
descriptionstringnoFree text. This travels to the machine and is visible to whoever pulls the profile up — the usual place for an operator note.
owningCatalogIdintegernoMust be one of your tenant's catalogs (see List Catalogs) or you get a 400. Defaults to your tenant's default catalog. Determines which machines can receive the profile — see Machine sync.
categorystringnoFree text, one level of grouping. Also used by the library's browse filters.
subCategorystringnoFree text, nested under category.
paintedSidestringno"Positive", "Negative", or omitted for none.

Fields you may not set: blankWidth (computed by the server as the sum of feature lengths), profileId, revision, and the create/edit stamps. All are assigned server-side and echoed in the response.

Features

features is an alternating, odd-length list:

  • index 0, 2, 4, … must be Straight
  • index 1, 3, 5, … must be anything but Straight
  • therefore it always starts and ends with a Straight, and always has an odd count

Violating this returns:

[ "Features must be a list of feature objects, that alternates between Straight and non-Straight types, and always starts and ends with a Straight." ]

A flat strip with no bends is legal — a single Straight is a valid profile.

Feature types and their fields

Each feature needs type; which other fields matter depends on it. Fields not listed for a type are ignored, and a hemHeight sent on anything other than an OpenHem is discarded.

typeRequired fieldsMeaning
Straightlength > 0A flat segment.
Angleangle, where |angle| < 180A sharp bend of angle degrees.
Radiusradius > 0, radiusQuality, angleA rounded bend.
OpenHemhemHeight > 0, hemDirectionA folded edge with a gap.
ClosedHemhemDirectionA fully flattened folded edge.
TearDropHemhemDirection, hemClampOffset ≥ 0A teardrop-shaped folded edge.

Field reference

FieldTypeNotes
typestringOne of the six above.
lengthdecimalLength of a Straight, in your tenant's units. Must be > 0.
angledecimalBend angle in degrees, not an included angle: 90 is a 90° bend. Must be strictly between -180 and 180. The sign sets the bend direction90 and -90 bend opposite ways.
radiusdecimalRadius of a Radius bend. Must be > 0.
radiusQualitystring"Coarse", "Medium", or "Fine" — how finely the radius is approximated. Required on a Radius; there is no default.
hemDirectionstring"Positive" or "Negative". Required on all three hem types — omitting it is an error, not a default.
hemHeightdecimalGap height of an OpenHem, > 0. Ignored (stored as 0) on every other type.
hemClampOffsetdecimalClamp offset for a TearDropHem, ≥ 0.
namestringOptional label for this feature, for your own external references (e.g. matching a punch pattern). Trimmed; must be unique within the profile, compared case-insensitively. Omit it and nothing changes. Library-side only — feature names are not sent to the machine.

blankWidth is the sum of every feature's length. Angles and hems contribute nothing; a Radius contributes its radius.

Example

A hemmed channel: open hem, up 90°, across, up 90°, teardrop hem.

{
"profileName": "A Sample Profile",
"description": "Rush — check the 3rd bend",
"owningCatalogId": 20115,
"category": "Quirky Parts",
"subCategory": "Awkward",
"features": [
{"type":"Straight", "length":0.5},
{"type":"OpenHem", "hemHeight": 0.25, "hemDirection":"Negative"},
{"type":"Straight", "length":10},
{"type":"Angle", "angle": 90.0},
{"type":"Straight", "length":10},
{"type":"TearDropHem", "hemDirection":"Positive"},
{"type":"Straight", "length":0.5}
]
}

blankWidth comes back as 210.5 + 10 + 10 + 0.5.

Validation errors

A 400 returns a JSON array of messages. The full set:

"ProfileName must not be empty."
"OwningCatalogId must refer to a valid catalog."
"Features list cannot be empty."
"Features must be a list of feature objects, that alternates between Straight and non-Straight types, and always starts and ends with a Straight."
"Feature names must be unique within a profile."
"Valid angle values are -180° - 180°."
"Hems must have a hemDirection of 'Positive' or 'Negative'."
"Open hems require a non-negative hemHeight."
"Teardrop hems require a non-negative hemClampOffset"
"Radius bends require a non-negative radius."
"Radius bends must have a radiusQuality of 'Coarse', 'Medium', or 'Fine'."
"Straight features require a non-negative, non-zero length."

Malformed JSON, or an unrecognized value in an enum field like type or hemDirection, currently returns a 500 rather than a 400. If you get a 500 from a POST, check those first.