Logo
MicroStrategy REST API API Documentation

Create a consolidation

POST {{baseUrl}}/api/model/consolidations

This API creates a consolidation in this changeset. When creating a consolidation, the API also creates a list of the embedded consolidation elements defined in the request body and then returns the full definition of the newly created consolidation.

Please provide destinationFolderId, it is required for the object to be committed to metadata. The user can include the objectInfoReference of the drillMap, the subtotal option in the request body.

A changeset ID is required to execute the request, and it can be obtained using the changeset creation API. An authorization token is required to execute the request and can be obtained using Authentication endpoints.

To add the newly created consolidation to metadata, commit using the POST /model/{changesetId}/commit API.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
X-MSTR-AuthToken
string (Required) Authorization Token
X-MSTR-MS-Changeset
string (Required) Changeset ID
Content-Type
string




RESPONSES

status Created

{ "information": { "versionId": "60E586C4CAB748CB9FCB0E3B9BF04B9A", "primaryLocale": "en-US", "objectId": "78B5870872E140FBA196428AA97CCE94", "subType": "consolidation", "name": "New Consolidation2", "destinationFolderId": "98FE182C2A10427EACE0CD30B6768258" }, "drillMap": { "objectId": "431367544A6C1EC401599989093E375C", "subType": "drill_map", "name": "Category Sales Report prompted on Category Item Drill Map" }, "elements": [ { "id": "6004F7D6703049389BCA5F87B4E7FAFF", "name": "element1", "type": "calculation", "format": { "header": [], "values": [] }, "expression": { "text": "1", "tree": { "type": "constant", "variant": { "type": "double", "value": "1.0" } } } } ], "subtotal": "enable" }

Curl
curl -X POST 'baseUrl/api/model/consolidations' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-MS-Changeset: rd_changesetId' -H 'Content-Type: application/json' -d '{"information":{"name":"New Consolidation2","destinationFolderId":"publicObjectsFolderId","subType":"consolidation"},"drillMap":{"objectId":"431367544A6C1EC401599989093E375C"},"elements":[{"name":"element1","type":"calculation","expression":{"tree":{"type":"constant","variant":{"type":"double","value":1}}}}],"subtotal":"enable"}'

ENDPOINTS