---
search:
  tags:
    - Variant Groups V2
    - PUT
seo:
  description: >-
    Bulk-upserts the variant group… Reference for the PUT
    /api/v2/{team_slug}/{app_slug}/products/variant-groups/templates endpoint in
    the Management API v2.
sidebar:
  label: Upsert product variant group templates
  badge: PUT
title: Upsert product variant group templates
type: openapi-operation
---
Bulk-upserts the variant group templates of a product.

`PUT /api/v2/{team_slug}/{app_slug}/products/variant-groups/templates`

**Request body** (`application/json`, required)

- `variant_groups` (VariantGroupTemplateItem[], required)

Request body example:

```json
{
  "variant_groups": [
    {
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "name": "string",
      "slug": "string",
      "description": "string",
      "priority": 0,
      "attributes": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ]
}
```

**Responses**

- `200` — OK (partial success possible)
- `400` — Request-level failure
- `401` — Request-level failure
- `403` — Request-level failure
- `500` — Request-level failure

Response example, 200:

```json
{
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "slug": "string",
      "description": "string",
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "priority": 0,
      "attributes": [
        {
          "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
          "attribute_key": "string",
          "attribute_name": "string",
          "template_key": "string",
          "template_name": "string"
        }
      ],
      "variants": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "variant_name": "string",
          "variant_number": "string",
          "status": "string"
        }
      ],
      "translations": {
        "name": [
          {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "locale": "string",
            "value": "string"
          }
        ],
        "slug": [
          {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "locale": "string",
            "value": "string"
          }
        ],
        "description": [
          {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "locale": "string",
            "value": "string"
          }
        ]
      },
      "channel_statuses": [
        {
          "channel_id": "bbe8aa76-a4bb-46f6-a785-df8e831cc459",
          "channel_slug": "string",
          "status": "string"
        }
      ],
      "images": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "url": "string",
          "title": "string",
          "priority": 0
        }
      ],
      "tags": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "key": "string",
          "name": "string"
        }
      ],
      "videos": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "url": "string",
          "title": "string"
        }
      ],
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "errors": [
    {
      "name": "string",
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "message": "string"
    }
  ]
}
```
