Use this call to delete one or more models in a workspace. The models must be closed before they can be deleted. Failure to delete one of the models for some reason, for example the calling user not having access to that model, will not affect the deletion of the rest of the specified models.

This supports administrative cleanup or lifecycle management of models, but is destructive and should be used carefully.

Note:

  • The user must be a workspace administrator in the specified workspace and have access to the specified models.
  • This is a destructive action - be careful when deleting models.
POST

/workspaces/{workspaceId}/bulkDeleteModels

ParameterRequiredTypeDetails
{workspaceId}YesStringThe workspace ID to delete models in. Example: 75A40874E6B64FA3AE0743278996850F

curl -X POST 'https://api.anaplan.com/2/0/workspaces/{workspaceId}/bulkDeleteModels' \
-H 'Authorization: AnaplanAuthToken {anaplan_auth_token}'
-H 'Content-Type: application/json'
--data-raw '{
 "modelIdsToDelete": ["<model_id_to_delete_1", "<model_id_to_delete_2" ...]
}'

If your response is successful, you receive a 200 OK HTTP status with a response body.

Content-Type: application/json

If all the specified models were successfully deleted:

{
  "meta":{
     "schema": "https://api.anaplan.com/2/0/objects/bulkDeleteModelsResponse"
  },
  "status":{
     "code": 200,
     "message": "Success"
  },
  "modelsDeleted": 4,
  "bulkDeleteModelsFailures": []
}

When some of the models were not deleted, their ID will be shown alongside a message:

{
  "meta":{
     "schema": "https://api.anaplan.com/2/0/objects/bulkDeleteModelsResponse"
  },
  "status":{
     "code": 200,
     "message": "Success"
  },
  "modelsDeleted": 1,
  "bulkDeleteModelsFailures": [
     {
       "modelId": "BC24B51B39CF4701ACF7CBFD2ED93C36",
       "message": "Model is open. Please close the model before trying again."
     },
     {
       "modelId": "EA8467B737A144C5B73CD56BA86085A0",
       "message": "Something went wrong. Deleting this model failed."
     },
     {
       "modelId": "Incorrect_Model_Id",
       "message": "Model ID does not exist."
     }
  ]
}

CodeMessageRequired amendments
400Error parsing request body as JSONCheck you have all the right elements in the request body.

Unrecognised property detectedEnsure only the supported properties are included in the request body.

Expected mandatory field 'modelIdsToDelete'Add the mandatory fields for the call to be successful.

Other messagesSpecific messages may be returned to the user if the JSON request body is invalid.
403ForbiddenCheck if the user is a workspace administrator.
404Not FoundCheck if the workspace ID specified in the URL is correct.