Products
The catalog layer — products, images, batches. One product can have many passports (one per serialised unit).
/api/v1/productsCreate a product
Create a product. The category template is resolved automatically from the `category` slug — must match a seeded category (e.g. `batteries`, `textiles`, `jewelry`). Model strings are unique within the workspace.
/api/v1/products/{id}Get a single product
Read one product by ID. Returns the full document including default field values, image URLs, template reference, and the running `passportCount`. Counts as one v1 read.
/api/v1/productsList products
Paginated list of every product the workspace owns, sorted by `createdAt` descending. Page size capped at 100. Filter by category slug, status (`active` / `archived`), or a free-text search across name + model.
/api/v1/products/{id}Update a product
Patch one or more product fields. Send only the keys you want to change — omitted fields stay untouched. The whole-array semantics on `imageUrls` are intentional: your CMS is the canonical image set, so a PATCH with `imageUrls: ["a","b"]` replaces whatever was there. To append a single image without rewriting the list, use the multipart upload endpoint instead.
/api/v1/products/{id}/imagesUpload a product image
Upload a single image file (multipart/form-data, field name `file`) and append it to the product's `imageUrls` array. Use this when you don't have a CDN URL ready — the image lands in our R2 bucket and the public URL is returned in the response.