Skip to main content

Data table API

Last updated 10/03/2026

For how to call the API, see the calling method described in the Open API document.

Overview​

  1. The data table API supports some of the data table operations available in the UI, helping you meet the need to automate operations on data tables.

  2. The data table API supports the following operations on data tables:

    • Create a data table
    • Update an existing data table
    • Associate a data table with a main property
    • Remove the association between a data table and a main property
  3. Create a data table:

You can create a data table that doesn't exist yet, upload a file for the first time, and specify the name and type of each field in the data table.

  1. Update an existing data table:

Only updates to the data table's content are supported. Adding or deleting data table fields or changing their types isn't supported.

You can perform a Replacement Update of the entire table's content, or an Incremental Update based on existing data.

  1. Associate a data table with a main property:

You can associate an existing data table with a main property to generate dimension table properties.

  1. Remove the association between a data table and a main property:

You can remove the association between an associated data table and a main property, which deletes the generated dimension table properties.

Note

1. Create a data table​

Creating a data table takes two steps:

  • Upload the file
  • Create the data table using the uploaded file

1.1 Upload a file​

The maximum upload file size is 100M. Supported file types are Excel and CSV

Endpoint URL

/open/datatable/uploadFile

Request method

POST

Content-Type

multipart/form-data

Request query parameters

Parameter nameExampleParameter typeRequiredParameter locationDescription
tokenxxxStringYesQuery key
projectId0numberYesqueryID of the project that the data table to be created belongs to.
file"/path/to/my_datatable.xls"fileYesbodymultipart/form-data; the uploaded CSV/Excel table. The first column is the primary key
curl --location --request POST 'http://xxx.com/xxx/open/datatable/uploadFile?projectId=390' \
--form 'file=@"/path/to/my_datatable.xls"'

Output parameters

fileId (this fileId is used in the next step, which is creating the data table)

1.2 Create a data table​

Endpoint URL

/open/datatable/createDatatable

Request method

POST

Content-Type

application/json

Request query parameters

Parameter nameParameter typeRequiredParameter locationDescription
tokenStringYesQuery key
projectIdnumberYesqueryID of the project that the data table to be created belongs to.
fileIdstringYesbodyID of the uploaded file
datatableNamestringYesbody

Data table name

Must start with a lowercase letter and can contain lowercase letters, numbers, and underscores

datatableColumns

array

Yesbody

The name of each column and its data type

Column names must start with a letter, can contain letters, numbers, and underscores "_", and can be up to 50 characters long

columnNamestringYesColumn name
dataTypestringYesColumn data type

Code example

curl --location --request POST 'http://xxx.com/xxx/open/datatable/createDatatable?projectId=390' \
--header 'Content-Type: application/json' \
--data-raw '{
"fileId": "xxxxxxx",
"datatableName": "xxx",
"datatableColumns": [
{
"columnName": "aaa",
"dataType": "string"
}
]
}'

Output parameters

Parameter nameData typeDescription
succeededRowCountnumberSuccessful rows
failedRowCountnumberFailed rows

2. Update an existing data table​

Endpoint URL

/open/datatable/updateDatatable

Request method

POST

Content-Type

application/json

Request query parameters

Parameter nameData typeRequiredParameter locationDescription
tokenStringYesQuery key
projectIdnumberYesqueryID of the project that the data table to be created belongs to.
datatableNamestringYesqueryData table name
updateTypeenum(INCR_UPDATE/REPL_UPDATE)YesqueryUpdate type. INCR_UPDATE is Incremental Update, and REPL_UPDATE is Replacement Update, which replaces the entire table's content
filefileYesbodymultipart/form-data; the uploaded CSV/Excel table. The first column is the primary key

Code example

curl -X POST 'http://xxx.com/open/datatable/updateDatatable?projectId=11&token=YOUR_TOKEN&datatableName=city_dim&updateType=INCR_UPDATE'\
--form "file=@/path/to/file"

Endpoint URL

/open/datatable/bindAssociatedProperty

Request method

POST

Content-Type

application/json

Request query parameters

Parameter nameData typeRequiredParameter locationDescription
tokenStringYesQuery key
projectIdNumberYesqueryID of the project that the data table to be created belongs to.
datatableNameStringYesbodyData table name
associatedPropertyNameStringYesbodyAssociated property name
associatedPropertyTableTypeString(user/event)YesbodyAssociated property type
timestampJoinFormat

Enum

NobodyIf the main property is a time type (timestamp), you can bind dimension table properties after granularity calculation based on the timestamp

timestampJoinFormat supports the following granularity types.

ValueDescription
DATE_STR_YEARThe property is formatted as a "yyyy" string before dimension table properties are bound
DATE_STR_MONTHThe property is formatted as "yyyy-MM" before dimension table properties are bound
DATE_STR_DAYThe property is formatted as "yyyy-MM-dd" before dimension table properties are bound
DATE_STR_HOURThe property is formatted as "yyyy-MM-dd HH" before dimension table properties are bound
DATE_STR_MINUTEThe property is formatted as "yyyy-MM-dd HH:mm" before dimension table properties are bound
DATE_STR_SECONDThe property is formatted as "yyyy-MM-dd HH:mm:ss" before dimension table properties are bound
DATE_STR_MILLISECONDThe property is formatted as "yyyy-MM-dd HH:mm:ss.SSS" before dimension table properties are bound

Code example

curl --location --request POST 'http://xxx.com/xxx/open/datatable/bindAssociatedProperty?projectId=390' \
--header 'Content-Type: application/json' \
--data-raw '{
"datatableName": "xxxxxxx",
"associatedPropertyName": "aaa",
"associatedPropertyTableType": "user",
"timestampJoinFormat": "DATE_STR_YEAR"
}'

Output parameters

Parameter nameData typeDescription
dimensionPropertiesArray
columnNameStringDimension table property name
selectTypeStringDimension table data type

Endpoint URL

/open/datatable/unbindAssociatedProperty

Request method

POST

Content-Type

application/json

Request query parameters

Parameter nameData typeRequiredParameter locationDescription
tokenStringYesQuery key
projectIdNumberYesqueryID of the project that the data table to be created belongs to.
datatableNameStringYesbodyData table name
associatedPropertyNameStringYesbodyAssociated property name
associatedPropertyTableTypeString(user/event)YesbodyAssociated property type

Code example

curl --location --request POST 'http://xxx.com/xxx/open/datatable/unbindAssociatedProperty?projectId=390' \
--header 'Content-Type: application/json' \
--data-raw '{
"datatableName": "xxxxxxx",
"associatedPropertyName": "aaa",
"associatedPropertyTableType": "user"
}'
Was this page helpful?