Skip to content

Assign a Customer Group to a Customer ​

Assigns a customer group to a customer.

Request ​

POST /api/oauth/v2/resource/customers/{uuid}/groups/{groupUuid}

HeaderValue
AuthorizationBearer {access_token}

URL parameters ​

ParameterTypeRequiredDescription
uuidstring (UUID)YesUnique customer ID
groupUuidstring (UUID)YesUnique customer group ID

Note (idempotency): If the customer group is already assigned to the customer, the endpoint still returns 200 OK without creating a duplicate. This makes the endpoint safe to call repeatedly — important for clients with retry logic.

Required scope: customers

Response ​

Success (200 OK) ​

Returns all customer groups assigned to the customer after the assignment.

json
{
  "data": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
      "name": "VIP customers",
      "description": "Customers with a premium contract",
      "color": "#74AFAD"
    }
  ],
  "meta": {
    "total": 1,
    "offset": 0,
    "limit": 1
  }
}

Response fields ​

See List Customer's Groups for the full field description.

Beispiele
bash
curl -X POST "https://my.offisy.at/api/oauth/v2/resource/customers/b2c3d4e5-f6a7-8901-bcde-f01234567890/groups/b2c3d4e5-f6a7-8901-bcde-f01234567890" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{}'
Parameter
Zuerst Token anfordern

Possible errors ​

StatusCodeDescription
401invalid_clientInvalid or missing access token
403insufficient_scopeScope customers not present
403access_deniedAccess denied due to missing permission
404not_foundCustomer or customer group not found (UUID could not be resolved)
404not_foundCustomer and customer group belong to different companies

On 404 due to a company mismatch, the response returns a JSON error object, e.g.:

json
{"error":"not_found","error_description":"Customer group not found."}

Offisy GmbH