Create dataset format programmatically

I have about 40-50 s3 directories with parquet files inside. I want to map each dir and apply a format so they can be queried. I can obviously do this from the UI - but it’s going to be painful - is there anyway to script this either via SQL or REST - I couldn’t obviously see from the documentation how to do this

http://docs.dremio.com/rest-api/catalog/post-catalog-id.html provides an example on promoting files/folders using the REST API.

awesome - thanks for the reference