---
search:
  tags:
    - Collections V2
    - PUT
seo:
  description: >-
    Bulk-upserts product-to-collection relationships;… Reference for the PUT
    /api/v2/{team_slug}/{app_slug}/collections/products endpoint in the
    Management API.
sidebar:
  label: Upsert collections relationships
  badge: PUT
title: Upsert collections relationships
type: openapi-operation
---
Bulk-upserts product-to-collection relationships; sort_order is authoritative on conflict.

`PUT /api/v2/{team_slug}/{app_slug}/collections/products`

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

- `products` (UpsertCollectionProductItem[], required)

Request body example:

```json
{
  "products": [
    {
      "collection_id": "4bdef85c-3f50-4006-a713-2350da665f80",
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "sort_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": [
    {
      "collection_id": "4bdef85c-3f50-4006-a713-2350da665f80",
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "sort_order": 0
    }
  ],
  "errors": [
    {
      "collection_id": "4bdef85c-3f50-4006-a713-2350da665f80",
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "message": "string"
    }
  ]
}
```
