Skip to main content

Create a content group

Available since 2021 Update 4

You can use REST APIs to create a new content group which includes name, color, opacity, emailEnabled, recipients.

In this sample workflow, we want to create a new content group object with the name "Finance", the color black, the opacity 50, enabled email, and the recipient with id 54F3D26011D2896560009A8E67019608 .

info

Get the authorization token needed to execute the request with POST /api/auth/login.

info

The DssXmlPrivilegesManageContentBundle privilege is required to create a content group.

Endpoint: POST /api/contentGroups

Sample Request Header:

"accept": "application/json"
"X-MSTR-AuthToken": "vslb4k2o4api370rf2jq2htbm2"

Sample Request Body:

{
"name": "Finance",
"color": 0,
"opacity": 50,
"emailEnabled": true,
"recipients": [
{
"id": "54F3D26011D2896560009A8E67019608"
}
]
}

Sample Curl:

curl -X 'POST' \
'https://demo.microstrategy.com/MicroStrategyLibrary/api/contentGroups' \
-H 'accept: application/json' \
-H 'X-MSTR-AuthToken: idlrja15f7gue2n4esiv7mbn7v' \
-H 'Content-Type: application/json' \
-d '{
"name": "Finance",
"color": 0,
"opacity": 50,
"emailEnabled": true,
"recipients": [
{
"id": "54F3D26011D2896560009A8E67019608"
}
]
}'

Sample Response Body:

{
"id": "D35FC0B04BD79E95612DDB907C4CCDF6",
"name": "Finance",
"color": 0,
"opacity": 50,
"emailEnabled": true,
"dateCreated": "2022-10-25T10:10:57.446+0000",
"dateModified": "2022-10-25T10:10:57.446+0000",
"owner": {
"name": "Administrator",
"id": "54F3D26011D2896560009A8E67019608"
},
"type": 77,
"recipients": [
{
"id": "54F3D26011D2896560009A8E67019608",
"name": "Administrator",
"abbreviation": "Administrator",
"group": false
}
]
}

Sample Response Code: 201 (A new content group is created successfully.)