Use this call to delete items from a list. You must provide the list ID or Code to identify each list item.
This supports controlled cleanup or synchronization when items are removed from the source system or are no longer needed in the model.
You can delete one or more list items in one API call by providing different identifiers for each item. For example, provide the ID for one item and code for another.
Notes:
- To use this call, you must be a Workspace Administrator.
- A maximum of 100,000 list items can be deleted with a single call.
Method and endpoint
/workspaces/{workspaceId}/models/{modelId}/lists/{listId}/items?action=delete
Parameters
| Parameter | Details |
{workspaceId} |
|
{modelId} |
|
{listId} |
|
Query parameters
| Parameter | Details |
action |
|
Curl example
curl -X POST 'https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/lists/{listId}/items?action=delete' \
-H 'Authorization: AnaplanAuthToken {anaplan_auth_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Response
Response 200 body with successful deletion
{
"meta": {
"schema": "https://api.anaplan.com/2/0/objects/list"
},
"status": {
"code": 200,
"message": "Success"
},
"deleted": 2
}
Response 200 Body when id or code does not exist
The response body contains a JSON object which has a deleted field and a failures field that contains information about any errors encountered while performing the delete action. Each item contains the identifier specified in the request.
{
"meta": {
"schema": "https://api.anaplan.com/2/0/objects/list"
},
"status": {
"code": 200,
"message": "Success"
},
"result": {
"numberOfItemsDeleted": 1,
"failures": [
{
"requestIndex": 1,
"failureType": "Not found",
"failureMessageDetails": "Code 'Region 1' not found"
},
{
"requestIndex": 2,
"failureType": "Ambiguous criteria",
"failureMessageDetails": "Specifying both ID and code not supported (201000000001:i1)"
}
]
}
}