Upsert a product group
Creates or updates a single product group. Pass id to update the matching group; omit id
to create a new one. A create returns 201, an update returns 200.
name is the only editable field and is required on both create and update; the update
replaces the group's name. A group's name must be unique within the company, compared
case-insensitively (Flower and flower collide) — a duplicate is rejected with a 400. The
name may contain only letters, digits, spaces, underscores, and the characters
~ # - $ / | % & ' ( ) .; any other special character, and two colons in a row (::), are
rejected with a 400.
Assigning products to a group is not done here: a product's group is set on the product itself, not on this endpoint. This endpoint only defines the group's identity.
Required permission: settings_permissions_product_groups.
BearerAuthorizationBearer <token>API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.
application/json- body
id?stringThe Distru ID of the product group to update, as returned in a product group response. Present updates that group; absent creates a new one.
name*stringThe group's display name. Required on both create and update. Must be unique within the company, compared case-insensitively (Flower and flower collide). May contain only letters, digits, spaces, underscores, and the characters ~ # - $ / | % & ' ( ) .; any other special character, and two colons in a row (::), are rejected with a 400.
The updated product group
*/*- response
A single product group
data?A product group
curl -X POST 'https://app.distru.com/public/v1/product-groups' \ -H 'Content-Type: application/json' \ -d '{ "name": "Flower - Indoor"}'{ "data": { "id": "string", "inserted_datetime": "string", "name": "string", "updated_datetime": "string" }}