I copied these instructions from somewhere a while ago:
“As far as I understand there is a difference between the name of the IR entity and the name for the associated IR code set. When you delete an IR entity the associated IR code set is not deleted with it for some reason. I.e. you can create an IR entity with the same name as a previously deleted one but the associated IR code set must be named differently, otherwise you will see the error message you mentioned.
There is a way to delete IR code sets via the API:
1. Go to IP of your remote/doc/core-rest/
2. Click on authorize in the lower right hand corner
3. Log in with web-configurator as username and the PIN of your remote
4. Scroll down to the infrared section
5. Click on GET /ir/codes/custom, then Try it out and Execute
6. Copy the device ID of the IR code set you want to delete from the response body
7. Scroll further down to DELETE /ir/codes/custom/{codeSetId}
8. Click on Try it out, paste the deviceID into the CodeSetID field and execute
9. To check if the code set has been deleted repeat steps 1 to 5
Similarly you can update an existing IR code set file:
1. Go to POST /ir/codes/custom/{codeSetId}
2. Click on Try it out, enter the deviceID you want to update in the CodeSetID field
3. Select the updated file and click on execute
4. In the response body you should see how many commands were added/updated/deleted etc.”