Skip to content

Create Customer Group ​

Creates a new customer group.

Request ​

POST /api/oauth/v2/resource/customers/groups

HeaderValue
AuthorizationBearer {access_token}
Content-Typeapplication/json

Body parameters ​

FieldTypeRequiredDescription
namestringYesName of the customer group (max. 50 characters). Leading and trailing spaces are removed. Emoji and other 4-byte characters are not allowed
descriptionstringNoDescription of the customer group. Emoji and other 4-byte characters are not allowed
colorstringNoColor as hex code (format #RRGGBB, default: #74AFAD)

Note: The name of a customer group is not unique. Every POST call creates a new customer group, even if a customer group with the same name already exists. A sync script that runs repeatedly will create duplicates this way. Check with GET /customers/groups whether the customer group already exists before creating it.

Response ​

Success (201 Created) ​

json
{
  "data": {
    "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "name": "Stammkunden",
    "description": "Kunden mit regelmäßigen Terminen",
    "color": "#74AFAD"
  }
}

Response fields ​

See Customer Group Details for the full field description.

Beispiele
bash
curl -X POST "https://my.offisy.at/api/oauth/v2/resource/customers/groups" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Muster GmbH",
    "description": "beispiel",
    "color": "beispiel"
  }'
Parameter
Zuerst Token anfordern

Possible errors ​

StatusCodeDescription
400validation_errorInvalid request data
401invalid_clientInvalid or missing access token
403insufficient_scopeScope customers not present
403access_deniedThe owning user of your API access does not have permission to create customer groups in the OAuth client's company (error_description: Insufficient permission for this resource.)

Examples for 400 validation_error:

json
{"error":"validation_error","error_description":"name is required."}
json
{"error":"validation_error","error_description":"name must not exceed 50 characters."}
json
{"error":"validation_error","error_description":"color must be a hex value in the format #RRGGBB."}
json
{"error":"validation_error","error_description":"name must not contain emoji or other 4-byte characters."}

Offisy GmbH