---
search:
  tags:
    - Relations
    - POST
seo:
  description: >-
    Create a new relation between multiple products using a… Reference for the
    POST /api/v1/{team_slug}/{app_slug}/relations endpoint in the Management
    API.
sidebar:
  label: Create a product relation
  badge: POST
title: Create a product relation
type: openapi-operation
---
Create a new relation between multiple products using a specified relation type

`POST /api/v1/{team_slug}/{app_slug}/relations`

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

Relation data

- `direction` (string) — Default two\_way
- `primary_product_id` (string)
- `product_ids` (string[], required)
- `relation_type_id` (string, required)

Request body example:

```json
{
  "direction": "one_way",
  "primary_product_id": "string",
  "product_ids": [
    "string"
  ],
  "relation_type_id": "string"
}
```

**Responses**

- `200` — Relation created successfully
- `400` — Invalid request (e.g. bad UUID, validation error)
- `401` — Unauthorized access
- `422` — Invalid request and not parsable by backend
- `500` — Internal server error

Response example, 200:

```json
{
  "data": {
    "direction": "string",
    "id": "string",
    "primary_product_id": "string",
    "products": [
      {
        "description": "string",
        "id": "string",
        "image_url": "string",
        "product_name": "string",
        "product_number": "string",
        "slug": "string"
      }
    ],
    "title": "string",
    "type": "string",
    "type_id": "string"
  },
  "details": [
    "string"
  ],
  "success": true
}
```
