---
search:
  tags:
    - Attribute Templates V2
    - PUT
seo:
  description: >-
    Bulk-upserts attribute-to-item… Reference for the PUT
    /api/v2/{team_slug}/{app_slug}/attribute-templates/relationships endpoint in
    the Management API v2.
sidebar:
  label: Upsert attribute relationships
  badge: PUT
title: Upsert attribute relationships
type: openapi-operation
---
Bulk-upserts attribute-to-item relationships. Each item expands to one relationship per listed item id.

`PUT /api/v2/{team_slug}/{app_slug}/attribute-templates/relationships`

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

- `items` (AttributeRelationshipItem[], required)

Request body example:

```json
{
  "items": [
    {
      "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
      "item_ids": [
        "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": [
    {
      "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
      "item_ids": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ],
  "errors": [
    {
      "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
      "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
      "message": "string"
    }
  ]
}
```
