Logo
MicroStrategy REST API API Documentation

Create a custom calendar

POST {{baseUrl}}/api/model/calendars

This API creates a custom calendar in current changeset. If the calendar is created successfully, the full definition of the newly created custom calendar will be returned.

The request body must include the objectInfoReference of the base calendar. Base calendar must be a system calendar and user should have use access to it.

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 calendar 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




RESPONSES

status Created

{ "information": { "versionId": "C72577EE06374C2F94C3CB8C43BF7813", "acg": 255, "primaryLocale": "en-US", "objectId": "00B905A9A5524266A6FAC06357E70012", "subType": "calendar_custom", "name": "new custom calendar", "ownerId": "54F3D26011D2896560009A8E67019608", "destinationFolderId": "636200232691438EA7CA6CB26CCDB4EF" }, "baseCalendar": { "objectId": "1414DF67F20B4E4F910E418C8DCE7274", "subType": "calendar_system", "name": "Gregorian Calendar" }, "tablePrefix": "MSTR_", "calendarBegin": { "dynamicYearOffset": -5 }, "calendarEnd": { "staticYear": "2022" }, "weekStartDay": "Sunday" }



Curl
curl -X POST 'baseUrl/api/model/calendars' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-MS-Changeset: rd_changesetId' -d '{"information":{"name":"new custom calendar"},"baseCalendar":{"objectId":"1414DF67F20B4E4F910E418C8DCE7274"},"tablePrefix":"MSTR_","calendarBegin":{"dynamicYearOffset":-5},"calendarEnd":{"staticYear":"2022"},"weekStartDay":"Sunday"}'

ENDPOINTS