Assign a Customer Group to a Customer
Assigns a customer group to a customer.
Request
POST /api/oauth/v2/resource/customers/{uuid}/groups/{groupUuid}
Header
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
URL parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid | string (UUID) | Yes | Unique customer ID |
groupUuid | string (UUID) | Yes | Unique customer group ID |
Note (idempotency): If the customer group is already assigned to the customer, the endpoint still returns
200 OKwithout 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
| Status | Code | Description |
|---|---|---|
| 401 | invalid_client | Invalid or missing access token |
| 403 | insufficient_scope | Scope customers not present |
| 403 | access_denied | Access denied due to missing permission |
| 404 | not_found | Customer or customer group not found (UUID could not be resolved) |
| 404 | not_found | Customer 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."}