OK. here's the situation. we are 1:1 with student iPads at the high school level. we replaced the older student 1:1 devices and are in the process of repurposing the old one to be used on carts in the elementary schools. for the most part they have all been wiped and are good to go, however every so often one pops up that has not been wiped yet.
my goal is to have a self service policy that asks for the serial number and then runs a script that issues the remote wipe command via the API, and then just let DEP configure the device.
i just don't know the API command
I wrote this proof of concept for sending remote wipes to macOS devices. It uses the API and should give you an idea of where to start: https://github.com/rustymyers/jamfMDMTools
You could probably adapt it to iOS devices, but the key command is:
https://' '/JSSResource/computercommands/command/' '/passcode/' '/id/' + computerid
This is the article I used to learn about the API: https://bryson3gps.wordpress.com/2014/03/30/the-jss-rest-api-for-everyone/
Hope that helps!