Is there a way to create many dashboards using a json file and the API

Hello. I need to create dashboards for a few hundred servers. I have a JSON file that I would like to use for this. The only difference for each dashboard would be the title and the hostname within the JSON file. Does anyone know how I could do this? I wanted to try and use this with the API. My datasource is influxdb. I was thinking about maybe having my hostnames in a file and reading each line and then using sed to replace the title/server name in the JSON file.

If you wanted to do it with a bash script, you may have an easier time with jq rather than sed. See e.g. https://stackoverflow.com/questions/31034746/how-do-i-update-a-single-value-in-a-json-document-using-jq. But yes, other than that the idea seems sound.

All that said, maybe what you want can be more easily achieved in a single dashboard, where the server name is set via a template variable?

Thanks. I will also try to figure out how to use the template variable to achieve this.

@williamastaten
Alternatively, you could use the Provisioning service.