# Insightsモデルリレーションの更新

`PUT`または`PATCH`を使用してInsightsモデルのリレーションを変更することはできません。代わりに、既存のリレーションを削除して、更新された定義で再作成します。

たとえば、データモデル`A`が現在`table1`と`table2`を`id`列でリレーションしているとします。リレーションIDを取得した後([データモデルリレーションのリストを取得](/ja/products/customer-data-platform/treasure-insights/reference-insights-model-endpoints)を参照)、次の方法で`table3`をリレーションに追加できます:

1. 既存のリレーションを削除します。
2. 3つのテーブルすべてを含む新しいリレーションを作成します。


APIエンドポイントについては、[お使いの地域に適したエンドポイント](/apis/endpoints/endpoints)を選択してください。


```bash
curl -X DELETE https://<api endpoint>/reporting/datamodels/xxxxxx/relations/yyyyyy \
-H 'authorization: TD1 xxxx/xxxxxxxxxxxxxx' \
-H 'accept: application/json'
```


```bash
curl -v -X POST https://<api endpoint>/reporting/datamodels/xxxxxx/relations \
-H 'authorization: TD1 xxxx/xxxxxxxxxxxxxx' \
-H 'cache-control: no-cache' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
  "definition": [
    {"dataset": "ds1", "table": "table1", "column": "name"},
    {"dataset": "ds1", "table": "table2", "column": "name"},
    {"dataset": "ds2", "table": "table3", "column": "name"}
  ]
}'
```