How can I recreate a custom object after delete?

I had the same problem, and after some hints from support and some searching and experimenting I managed to work out an answer.

You need to perform

DELETE https://api.hubspot.com/crm/v3/schemas/[objectTypeId]/purge

The documentation is (currently) wrong, you can’t use the objectType as the parameter for purge. Instead, you need the objectTypeId, which is a value given to you as a property in the JSON data returned when you create the custom schema. It looks like 2-12345678.

There seems to be no way to find out what the objectTypeId is once you’ve deleted the custom schema. The error when you try to create a new schema with the same name as the deleted one doesn’t tell you what the objectTypeId is either, which is a bit of a problem.