{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Treasure Insights","type":"markdown"},"seo":{"title":"Create an Insights Model Dataset","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":"create-an-insights-model-dataset","__idx":0},"children":["Create an Insights Model Dataset"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you create or add a dataset to an Insights model, consider the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Definition"]},". Define the definition to have the same schema defined in the YAML file that was used to create the Insights model (POST /reporting/datamodels)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Database/table names"]},". Specify the database and table names, and their column information including: “type(required, currently only “presto” is available)”, indexed (optional, default value: false)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Dataset name"]},". There are no restrictions on what you name the dataset. Treasure Data recommends that you use the same name as the database."]}]},{"$$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 POST https://${api endpoint}/reporting/datamodels/xxxxxx/datasets \\\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      \"name\": \"new_table\",\n      \"definition\": {\n        \"type\": \"presto\",\n        \"database\": \"new_db\",\n        \"tables\": {\n          \"new_table\": {\n            \"columns\": {\n              \"id\": {\n                \"type\": \"text\",\n                \"indexed\": true\n              }\n            }\n          }\n        }\n      }\n    }'\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Create an Insights Model Dataset","id":"create-an-insights-model-dataset","depth":1}],"frontmatter":{"seo":{"title":"Create an Insights Model Dataset"}},"lastModified":"2026-03-10T06:52:05.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/treasure-insights/create-an-insights-model-dataset","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}