{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Treasure Insights","type":"markdown"},"seo":{"title":"Update an Insights Model Relation","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"update-an-insights-model-relation","__idx":0},"children":["Update an Insights Model Relation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You cannot use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH"]}," to modify an Insights model relation. Instead, delete the existing relation and recreate it with the updated definition."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, suppose data model ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A"]}," currently relates ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["table1"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["table2"]}," on the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," column. After retrieving the relation ID (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/treasure-insights/reference-insights-model-endpoints"},"children":["Get a List of Data Model Relations"]},"), you can add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["table3"]}," to the relation by:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Deleting the existing relation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creating a new relation that includes all three tables."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the API endpoint, select the appropriate ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["endpoint for your region"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X DELETE https://<api endpoint>/reporting/datamodels/xxxxxx/relations/yyyyyy \\\n-H 'authorization: TD1 xxxx/xxxxxxxxxxxxxx' \\\n-H 'accept: application/json'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -v -X POST https://<api endpoint>/reporting/datamodels/xxxxxx/relations \\\n-H 'authorization: TD1 xxxx/xxxxxxxxxxxxxx' \\\n-H 'cache-control: no-cache' \\\n-H 'accept: application/json' \\\n-H 'content-type: application/json' \\\n-d '{\n  \"definition\": [\n    {\"dataset\": \"ds1\", \"table\": \"table1\", \"column\": \"name\"},\n    {\"dataset\": \"ds1\", \"table\": \"table2\", \"column\": \"name\"},\n    {\"dataset\": \"ds2\", \"table\": \"table3\", \"column\": \"name\"}\n  ]\n}'\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Update an Insights Model Relation","id":"update-an-insights-model-relation","depth":1}],"frontmatter":{"seo":{"title":"Update an Insights Model Relation"}},"lastModified":"2026-03-10T06:52:05.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/treasure-insights/update-an-insights-model-relation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}