---
title: "Create a batch of product groups. If a group already exists, an update is applied."
method: POST
path: "/product-groups/batch"
tags: ["Product groups"]
---

# Create a batch of product groups. If a group already exists, an update is applied.

`POST /product-groups/batch`

Batch process helps to add multiple product groups in one request.
⚠️ Endpoint is available only in the Enterprise interface.

## Headers

- `Accept-Language` string

## Request body

- object
  - `product_groups` ProductGroup[], required — List of the CareCloud product groups.
    - `product_group_id` string — The unique ID of the product group.
    - `name` string, required — Name of the product group.
    - `parent_product_group_id` string — The unique ID of the parent product group. If `parent_external_id` is also set, both parameters have to represent the same product group. [GET /product-groups](https://carecloud.readme.io/reference/getproductgroups)
    - `parent_external_id` string — The unique external ID of the parent product group. If `parent_product_group_id` is also set, both parameters have to represent the same product group.
    - `code` string — Code of the product group.
    - `external_id` string, required — The external unique ID of the product group.
    - `store_id` string — The unique ID of the store where the product group is valid. The product group is global if this value is not set. [GET /stores](https://carecloud.readme.io/reference/getstores)
    - `partner_id` string — The unique ID of the partner. If the partner is not set, the partner is selected from the logged in user. [GET /partners](https://carecloud.readme.io/reference/getpartners)
    - `last_change` string — Timestamp of the last change. Format: `YYYY-MM-DD HH:MM:SS`. All times are in the local timezone.
    - `state` 0 | 1 | 2 — State of the product group. *Possible values are: 0 - deleted / 1 - active*
  - `error_processing` 1 | 2 — The parameter describes the batch method behavior in case of error occurs. *Possible values are: 1 - It returns the first error found and rollback all previous changes (this is also the default behavior if the parameter is not set) / 2 - It creates all valid records and creates an error report from failed attempts.*

## Response `204`

No Content

## Other responses

- `400` — Bad input parameter. The response body's `error.error_data.invalid_params[]` array lists the parameters that caused the failure, each carrying a `reason` code. See the `BadRequestErrorBody` schema for the generic reason taxonomy. Operations with domain-specific business rules document additional reasons at the operation level.
- `401` — The client has invalid credentials or auth token.
- `403` — The client does not exist or the client tried to access an unauthorized property or resource.
- `404` — The resource was not found.
- `405` — The resource does not support the specified HTTP method.
- `429` — Too many requests - more than the resource limit.
- `500` — Server is not working as expected.
- `503` — Temporary state when the service is temporarily unavailable, overloaded or there is a maintenance window.

---

[API](https://skmtc.net/crmcarecloud/apis/rest-api-reference.md) · [All operations](https://skmtc.net/crmcarecloud/apis/rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crmcarecloud/rest-api-reference/revisions/329c06dbf8d9/schema)
