v1

latestOpenAPI 3.0.32026-07-14314472448.6 KB
datasources

Update an existing data source.

Similar to creating a data source, password and basicAuthPassword should be defined under secureJsonData in order to be stored securely as an encrypted blob in the database. Then, the encrypted fields are listed under secureJsonFields section in the response.

If you are running Grafana Enterprise and have Fine-grained access control enabled you need to have a permission with action: datasources:write and scopes: datasources:*, datasources:uid:* and datasources:uid:1 (single data source).

put/datasources/uid/{uid}

Path parameters

uidstring required

Request body

accessstring
basicAuthboolean
basicAuthUserstring
databasestring
isDefaultboolean
jsonDataJson
namestring
secureJsonDataobject
typestring
uidstring
urlstring
userstring
versioninteger

The previous version -- used for optimistic locking

withCredentialsboolean

Response

(empty)

idinteger required

ID Identifier of the new data source.

messagestring required

Message Message of the deleted dashboard.

namestring required

Name of the new data source.

Example response

{
  "id": 65,
  "message": "Data source added",
  "name": "My Data source"
}