Logo
MicroStrategy REST API API Documentation

Save a document as a new object

POST {{baseUrl}}/api/documents/:id/instances/:instanceId/saveAs

Save a document instance by creating a new document. A new document object is created in the metadata, with a new object ID. You obtain the authorization token needed to execute the request using POST /auth/login and the project ID using GET /project; you pass the authorization token and the project ID in the request header. You identify the document and the document instance by specifying the document ID and the document instance ID in the path of the request; you get the document instance ID using POST /documents/{id}/instances. You specify the document creation information in the body parameter of the request; you can specify a name and description for the new document and the folder where the new document should be saved. This returns the message ID of the new document instance.

 

Body PARAM

Key Datatype Required Description 
fields
null Comma-separated, top-level field whitelist that allows the client to selectively retrieve part of the response model. If specified, extra filtering is applied, and for top-level object (if root model is an array, each array element), only the listed fields are kept in the response. For example, "id,elements" keeps only the "id" field and whole "elements" array field, omitting all other fields in the top-level response model.



HEADERS

Key Datatype Required Description 
X-MSTR-AuthToken
string (Required) Authorization token
X-MSTR-ProjectID
string (Required) Project ID
Content-Type
string




RESPONSES

status Created

{ "id": "A3F0BF1BD941D430D6A60BBC9E21DF97" }

Curl
curl -X POST 'baseUrl/api/documents/:id/instances/:instanceId/saveAs?fields=' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-ProjectID: projectId' -H 'Content-Type: application/json' -d '{"overwrite":true,"name":"Document Saved As A New Object","folderId":"publicObjectsFolderId","description":"Document Saved as A New Object","promptBehavior":0}'

ENDPOINTS