The API Method

The solution is to use the following API method:

DELETE: projects/{project_id}/test-sets/{test_set_id}/test-cases/{test_set_test_case_id}

So, for example, if you wanted to remote some test cases from Test Set TX2 in project PR1, you would need to use the API method:

DELETE: projects/1/test-sets/2/test-cases/{test_set_test_case_id} 

However the question is, where do you get the final parameter {test_set_test_case_id} from?

That is the unique instance of the test cases in the test set.

Well, we can use another API method to get all of  the test cases in the test set, including that ID value:

GET: projects/{project_id}/test-sets/{test_set_id}/test-case-mapping

We would first call this function to get the list of test cases in our test set:

GET: projects/1/test-sets/2/test-case-mapping

In a sample project, we would get:

[
  {"TestSetTestCaseId":15,"TestSetId":2,"TestCaseId":12,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":16,"TestSetId":2,"TestCaseId":13,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":8,"TestSetId":2,"TestCaseId":2,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":9,"TestSetId":2,"TestCaseId":3,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":10,"TestSetId":2,"TestCaseId":4,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":11,"TestSetId":2,"TestCaseId":5,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":12,"TestSetId":2,"TestCaseId":6,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":13,"TestSetId":2,"TestCaseId":8,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false},
  {"TestSetTestCaseId":14,"TestSetId":2,"TestCaseId":9,"OwnerId":null,"PlannedDate":null,"IsSetupTeardown":false}
]

So now we can loop through the ones we want to remove and call the original delete function:

DELETE: projects/1/test-sets/2/test-cases/8
DELETE: projects/1/test-sets/2/test-cases/9
DELETE: projects/1/test-sets/2/test-cases/15

which would remove the three specified test cases from the test set.