---
search:
  tags:
    - Tags V2
    - PUT
seo:
  description: >-
    Bulk-upserts tag relationships to a product,… Reference for the PUT
    /api/v2/{team_slug}/{app_slug}/tags/relationships endpoint in the Management
    API v2.
sidebar:
  label: Upsert tags relationships
  badge: PUT
title: Upsert tags relationships
type: openapi-operation
---
Bulk-upserts tag relationships to a product, variant or variant group. Each item names the target with item_id plus item_type (product, variant or variant_group).

`PUT /api/v2/{team_slug}/{app_slug}/tags/relationships`

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

- `relationships` (UpsertTagRelationshipItem[], required)

Request body example:

```json
{
  "relationships": [
    {
      "tag_id": "39c8a0b3-fbe8-4801-95bf-e8a0792edf1d",
      "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
      "item_type": "product",
      "order": 0
    }
  ]
}
```

**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": [
    {
      "tag_id": "39c8a0b3-fbe8-4801-95bf-e8a0792edf1d",
      "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
      "item_type": "product",
      "order": 0
    }
  ],
  "errors": [
    {
      "tag_id": "39c8a0b3-fbe8-4801-95bf-e8a0792edf1d",
      "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
      "item_type": "product",
      "message": "string"
    }
  ]
}
```
