What version of the os are you on? If at least 10.13 you can use the --eraseinstall trigger from startosinstall.
https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/
What version of the os are you on? If at least 10.13 you can use the --eraseinstall trigger from startosinstall.
https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/
Only works if the computers are all running APFS. If thats the case, you're in luck. Otherwise you might need to do it by hand.
There might be a way to mass-perform this via the API, but there is an MDM command to wipe the computer.

that "wipe computer" MDM command is a bit of a misnomer.
It doesn't just wipe the machine, it applies a 6 digit code lock. Then once unlocked it wipes the machine.
Have them boot to a NetInstall Image or a recovery partition.
https://support.apple.com/en-us/HT204904
Whenever I offload macs, I use deploystudio still. (CAN'T WAIT TO CONJURE UP A 1K+ T2 OFFLOAD! ..lol) ,
The MUT has all you need! (For This) - I haven't taken the time to deep dive into an alternative API solution.
1st I create a static computer group for the computers that need to be removed from the JPS. Then I create a spreadsheet with all of the computers I need to delete and use the mut to upload it to the JPS. The Mut places them into the static computer group. Then in the JPS Dashboard I select the Static Computer group, I select the 'Assignments Page', I click view in the bottom right, then I select the 'Action' button in the bottom right, then I select the option 'Delete Computers'. Then I confirm I want to delete the computers and wallah, no longer managed and no longer exist in our JPS Database. (Also, must be removed from ASM or ABM, DEP / Prestage, etc...etc...)
Then boot to deploystudio server & Deploystudio runs a shell script for a 3 pass wipe - then installs an OEM Image. I have 3 Off Network Mac Mini Servers that run independently of one another, Each connected to 2 x24 Port Dumb switches - I can knock out about 200 - 250 computers a day. 3 pass wipe usually takes about 3-4 hours. Very Manageable as you simply need to take 10-20 minutes to swap out / boot the machines to deploystudio server once every 3-4 hours.
diskutil secureErase 4 /dev/DISKhere
$ diskutil secureErase
Usage: diskutil secureErase [freespace] level MountPoint|DiskIdentifier|DeviceNode
Securely erases either a whole disk or a volume's freespace.
Level should be one of the following:
0 - Single-pass zeros.
1 - Single-pass random numbers.
2 - US DoD 7-pass secure erase.
3 - Gutmann algorithm 35-pass secure erase.
4 - US DoE 3-pass secure erase.
Ownership of the affected disk is required.
Note: Level 2, 3, or 4 secure erases can take an extremely long time.
@easdonc we use a one liner to quickly get a computer wiped and OOB'd to Mojave....requires you to have the Mojave installer PKG'd up, and your DP host PKGs over HTTP...
WARNING THIS WILL WIPE THE COMPUTER!!!
cd /tmp; curl --remote-name --progress-bar http://server.domain.com/CasperShare/Packages/<yourWrappedInstaller>.pkg; sudo installer -pkg /tmp/<yourWrappedInstaller>.pkg -target /; /Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --agreetolicense --eraseinstall --nointeraction && reboot
This can be made into a Self Service policy.