---
title: "Set relationship"
method: POST
path: "/storage/relationships"
tags: ["Storage - Relationships"]
---

# Set relationship

`POST /storage/relationships`

Set relationships between models within a connector dataset, or between native object models within the native dataset. Native unify models are not supported.

## Request body

- object — Request body schema.
  - `datasetUuid` string, uuid, required — Dataset identifier.
  - `relationships` object[], required — Relationships to create or update.
    - `fromModelUuid` string, required
    - `fromColumnSlug` string, required
    - `fromPropertySlug` string, nullable, required
    - `toModelUuid` string, required
    - `toColumnSlug` string, required
    - `toPropertySlug` string, nullable, required
    - `fromSelectedColumnSlugs` string[], nullable, required
    - `toSelectedColumnSlugs` string[], nullable, required
    - `relation` 'oneToMany' | 'oneToOne' | 'manyToOne', required
    - `uuid` string, uuid

## Response `200`

Successful response

- object
  - `relationships` object[], required — Updated relationships.
    - `uuid` string, required
    - `workspaceUuid` string, required
    - `fromDatasetUuid` string, required
    - `fromModelUuid` string, required
    - `fromColumnSlug` string, required
    - `fromPropertySlug` string, nullable, required
    - `toDatasetUuid` string, required
    - `toModelUuid` string, required
    - `toColumnSlug` string, required
    - `toPropertySlug` string, nullable, required
    - `fromSelectedColumnSlugs` string[], nullable, required
    - `toSelectedColumnSlugs` string[], nullable, required
    - `relation` 'oneToMany' | 'oneToOne' | 'manyToOne', required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.net/getcargo/apis/cargo-api.md) · [All operations](https://skmtc.net/getcargo/apis/cargo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getcargo/cargo-api/versions/1d5a19e01d83/schema)
