Files
dashback/docs/api/routes/labeltemplate/update.md
2026-09-27 22:01:47 +02:00

1.5 KiB

PATCH /labeltemplate/{id}

Protected. Requires a valid session cookie (credentials: 'include').

Update label template (partial)

Updates specified fields of an existing label template for the selected company. When content, width, or height is provided, the thumbnail is automatically re-rendered.

Also available as PUT /labeltemplate/{id}.

Path parameters

Param Required Type Description
id yes integer Label template ID

Body (JSON)

All fields are optional.

{
  "name": "…",
  "width": 448,
  "height": 200,
  "dpi": 203,
  "type": "zpl",
  "content": {
    "objects": []
  }
}
Field Type Description
name string Template name
width integer Canvas width in pixels
height integer Canvas height in pixels
dpi integer Printer DPI — 203 or 300
type string Template type — "zpl"
content object Label editor JSON content

Response 200

Updated label template

{
  "labeltemplate": {
    "id": 1,
    "company_id": 1,
    "name": "…",
    "width": 448,
    "height": 200,
    "dpi": 203,
    "type": "zpl",
    "content": {},
    "thumb": "…"
  }
}

Errors

Status Description
400 Invalid input — {"error":"…"}
401 Unauthorized — {"error":"…"}
404 Label template not found — {"error":"…"}

Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.