[resolved] Create postgres datasource using API

Hi all,
i’m trying to add a new datasource using API (I have to deploy it on ~300 different orgs so it must be scripted), but I can’t finc the way to set password.

I’ve tried password field with no success.
I tried to put password in “jsonData” , but it does not work neither

When I curl API (get) on an existing postgres datasource, I get

{
“user” : “grafanareader”,
“url” : “db.mycompany.com:9999”,
“access” : “proxy”,
“id” : 2143,
“database” : “base”,
“jsonData” : {
“keepCookies” : [],
“sslmode” : “require”
},
“password” : “”,
“orgId” : 1,
“readOnly” : false,
“typeLogoUrl” : “public/app/plugins/datasource/postgres/img/postgresql_logo.svg”,
“type” : “postgres”,
“basicAuth” : false,
“name” : “PG_DB”,
“isDefault” : false
}

When I try to post the same thing with a value in password field, and access it into grafana, password field is empty.

If I curl again this new created datasource, I see my password in password field…

Any idea ?

resolved, I had to use secureJsonData field.

“secureJsonData”: {
“password”: “abcdef”
},