Skip to main content

Lock the schema

Available since 2021 Update 1

tip

You can try out this workflow at REST API Playground.

Learn more about MicroStrategy REST API Playground here.

This workflow sample demonstrates how to lock the schema.

You want to lock the schema in the MicroStrategy Tutorial project with an “absolute_individual“ lock. The project ID is B7CA92F04B9FAE8D941C3E9B7E0CD754.

info

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

Get the project ID from GET /api/projects.

tip

In the response, the "lockType" can be:

  • "absolute_individual": Place using the POST schema lock API. When placed, no one, including the administrator, can perform changes on the schema objects. The purpose of this lock is to prevent accidental modifications to the schema in a project.
  • "exclusive_constituent": When the changeset is created with "schemaEdit" = true, an "exclusive_constituent" lock is placed on the schema. It is a lock exclusive to the changeset holding the lock; only that changeset can change the schema or its constituents (tables, attributes, etc.).
  • "absolute_constituent": Not in use.

Lock the schema using POST /api/model/schema/lock.

Sample Request Header:

"accept": "application/json"
"X-MSTR-AuthToken": "ouddou5qdd421ndfpjqd6ssman"
"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754

Sample Request Body:

{
"lockType": "absolute_individual"
}

Sample Curl:

curl -X POST "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/schema/lock" \
-H "accept: */*" \
-H "X-MSTR-AuthToken: ouddou5qdd421ndfpjqd6ssman" \
-H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" \
-H "Content-Type: application/json"
-d '{"lockType":"absolute_individual"}'

Sample Response Body: Empty

Response Code 201 (The schema is locked successfully.)