{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"Treasure Insights","type":"markdown"},"seo":{"title":"Create or Add a Table","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-or-add-a-table","__idx":0},"children":["Create or Add a Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call #POST /reporting/datamodels/{datamodel_id}/datasets/{dataset_id}/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 POST https://${TD_API_ENDPOINT}/reporting/datamodels/xxxxxx/datasets/yyyyyy/tables \\\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\": \"pageviews\",\n      \"definition\": {\n        \"columns\": {\n          \"td_url\": {\n            \"type\": \"text\"\n          },\n          \"time\": {\n            \"type\": \"int\"\n          }\n        }\n      }\n    }'  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here is some more information about the example:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["name"]},". The table name that you are going to ingest."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["definition"]},". List all columns that you’d like to ingest. Each column requires that you identify its ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["type"]},"."]}]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure Data Terminology"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Analytics Platform Terminology"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["text"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int/bigint"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["long"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bigint"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["double"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array type*"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["text"]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the Treasure Console, when working with JSON data (array or object type), it's essential to set the data type as 'string' before transferring the data. This ensures that the Analytics platform can process the data accurately. Please note that the Analytics platform does not directly support JSON array type data and instead transfers it as text data. Therefore, defining the type as 'string' is a necessary step to ensure proper data handling."]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["indexed"]},". This is optional. Indexed is a Boolean attribute; the default value is false."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["timestamp"]},". The Analytics platform does not support ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["unixtimestamp"]},". If you want to use ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["datetime"]}," in a widget, convert ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["unixtimestamp"]}," to text with the timestamp format before you create an Insights model and define the column as a type of ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["timestamp"]},"."]}]}]},"headings":[{"value":"Create or Add a Table","id":"create-or-add-a-table","depth":1}],"frontmatter":{"seo":{"title":"Create or Add a Table"}},"lastModified":"2026-06-01T11:27:28.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/treasure-insights/create-or-add-a-table","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}