See How to Use the Plug and Play API in DNA Center – Part 2
Part 2 in the series gives you an example script to automate the PnP process for provisioning multiple devices, and breaks down each of the API calls in case you would like to further customize.