Upsert a company group
Creates or renames a single company group in one endpoint. Pass id to rename the matching
existing group; omit id to create a new one. A create responds 201, an update responds 200.
Company groups are the labels you use to organize your business relationships (customers and
vendors); price tiers can target or exclude companies by group.
name is required and must be unique within your company — reusing a name already taken by
another of your groups is rejected with a 400. On update, name fully replaces the stored name;
there are no other editable fields, so this endpoint only ever sets the group's name.
Renaming a group does not change its ID, so any price tier that already targets or excludes this group keeps doing so under the new name. Creating a group does not attach it to any company relationship — membership is managed separately.
Required permission: settings_permissions_company_relationship_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?stringID of the group to update. Present → the matching group owned by your company is renamed (404 if no such group exists for you). Absent → a new group is created.
name*stringDisplay name of the company group. Required on both create and update. Leading/trailing whitespace is trimmed, and the result must be non-empty, at most 255 characters, and unique among your company's groups (a duplicate returns 400). Allowed characters are letters, digits, spaces, underscores, and ~#-$/|%&'().; it may not contain two colons in sequence (::). Any other character is rejected with a 400. On update this replaces the existing name.
The updated company group
*/*- response
A single company group
data?A company group
curl -X POST 'https://app.distru.com/public/v1/company-groups' \ -H 'Content-Type: application/json' \ -d '{ "name": "Key Accounts"}'{ "data": { "id": "string", "inserted_datetime": "string", "name": "string", "updated_datetime": "string" }}