You can configure via the API as mentioned, but I find it so easy to configure via the dashboard that working on a script to configure via the API is an unnecessary waste of time.
Just configure from scratch and that's it. Meraki is too easy.
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.
Please, if this post was useful, leave your kudos and mark it as solved.