Logo
MicroStrategy REST API API Documentation

Update a cube's definition through Modeling service

PUT {{baseUrl}}/api/model/cubes/:cubeId

Update a cube's definition through Modeling service, based on the definition provided in request body, which includes, information, filter, template, options, timeBased, and advancedProperties. For FFSQL cube, table field can also be included while filter is not supported. The definition of the newly created cube is returned in response. To publish the updated cube, please call POST /api/v2/cubes/{cubeId}.

In the request body, filter needs to be in either tree or tokens format. If both are provided, only tree is used.

For custom expressions, expression needs to be in either tree or tokens format. If both are provided, only tree is used. For inline custom expressions, only the tree format is supported.

  • Tokens are a semi-structured representation of MicroStrategy expression text that includes object references. For example, let’s say a filter expression is Revenue > Cost. When the filter expression is represented as tokens, the text is broken down into pieces (tokens) with information about what these pieces represent in the metadata: (Revenue, RevenueID), (>, GreaterThanID), (Cost, Cost_ID).

The project ID is required to create a cube in metadata. An authorization token is required to execute the request and can be obtained using Authentication endpoints.

This API does not allow editing name or destinationFolderId, use save API to do that instead.

 

Body PARAM

Key Datatype Required Description 
showExpressionAs
null This parameter specifies the format in which the expressions are returned in response. This parameter applies to the expressions in a fact or attribute and custom expressions used in a filter, prompt, security filter, custom group, etc. Expressions are presented in the following formats: * "text": A human readable, but non-parsable text, describing the expression. This is the default format that is always returned in the response. * "tree": A tree data structure fully defining the expression. This format can be used if you want to examine and modify the expression programmatically. * "tokens": A list of parsed tokens. This format can be used if you want to examine and modify the expression using the parser component. Note that generating tokens requires additional time. Tokens are a semi-structured representation of MicroStrategy expression text that includes object references. For example, let’s say a filter expression is "Revenue > Cost". When the filter expression is represented as tokens, the text is broken down into pieces (tokens) with information about what these pieces represent in the metadata: ("Revenue", Revenue_ID), (">", GreaterThan_ID), ("Cost", Cost_ID). If omitted, the expression is returned in "text" format. If `tree`, the expression is returned in "text" and "tree" formats. If `tokens`, the expression is returned in "text" and "tokens" formats.
showFilterTokens
null Specify whether the cube "filter" is returned in "tokens" format, along with "text" and "tree" formats. The cube filter is presented in the following formats: * "text": A human readable, but non-parsable text, describing a filter's qualification. * "tree": A tree data structure fully defining the filter's qualification. * "tokens": A list of parsed tokens that define a filter's qualification. Be aware that generating tokens requires additional time. If omitted or `false`, only "text" and "tree" formats are returned. If `true`, all "text", "tree" and "tokens" formats are returned.



HEADERS

Key Datatype Required Description 
X-MSTR-AuthToken
string (Required) Authorization Token
Curl
curl -X PUT 'baseUrl/api/model/cubes/:cubeId?showExpressionAs=&showFilterTokens=' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-ProjectID: rd_projectId' -d '{"information":{"subType":"report_cube","name":"Year, Category Analysis","destinationFolderId":"publicObjectsFolderId"}}'

ENDPOINTS