Create plugin data source via API


Looking at the docs for the create data source API: Data source HTTP API | Grafana Labs

I’m trying to create multiple instances of this data source (installed via plugin) via that API: JSON plugin for Grafana | Grafana Labs

But I can’t seem to find all the necessary fields ( Whitelisted Cookies, Forward OAuth Identity) for example, that are present in the Create Data Source form in Grafana itself.

Every data source can have its own custom fields and they are stored in the JsonData (unencrypted data) or secureJsonData (encrypted data like passwords) fields.

When creating a data source, you don’t need to define every field unless you need them to have a value that is not the default value.

The JsonData section of the provisioning docs has all the standard fields listed: Provisioning | Grafana Labs and I don’t think the CSV data source has any non-standard fields.

Whitelisted Cookies is keepCookies and Forward OAuth Identity (not sure if this is even usable in the Json data source) is oauthPassThru

A snippet from the json that you would post to the data source http endpoint:

  "jsonData": {
    "keepCookies": [
    "oauthPassThru": true