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.
POST

/workspaces/{workspaceId}/models/{modelId}/lists/{listId}/items?action=delete

ParameterDetails
{workspaceId}
  • Required
  • Type: String
  • Description: The workspace ID
  • Example: 8a8196b15b7dbae6015b8694411d13fe
{modelId}
  • Required
  • Type: String
  • Description: the model ID
  • Example: 75A40874E6B64FA3AE074327899685
{listId}
  • Required
  • Type: Number
  • Description: the list ID
  • Example: 101000000001
ParameterDetails
action
  • Required
  • Type: String
  • Value: delete
  • Example: ?action=delete

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'

{
   "meta": {
       "schema": "https://api.anaplan.com/2/0/objects/list"
   },
   "status": {
       "code": 200,
       "message": "Success"
   },
   "deleted": 2
}

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)"
           }
       ]
   }
}