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.
Method and endpoint
/workspaces/{workspaceId}/bulkDeleteModels
Parameters
| Parameter | Required | Type | Details |
| {workspaceId} | Yes | String | The workspace ID to delete models in. Example: 75A40874E6B64FA3AE0743278996850F |
Curl example
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" ...]
}'
Response
Successful response
If your response is successful, you receive a 200 OK HTTP status with a response body.
Response header
Content-Type: application/json
Response 200 body
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": []
}
Response if some of the specified models were not deleted
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."
}
]
}
Error responses
| Code | Message | Required amendments |
| 400 | Error parsing request body as JSON | Check you have all the right elements in the request body. |
| Unrecognised property detected | Ensure 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 messages | Specific messages may be returned to the user if the JSON request body is invalid. | |
| 403 | Forbidden | Check if the user is a workspace administrator. |
| 404 | Not Found | Check if the workspace ID specified in the URL is correct. |