v1

latestSwagger 2.02026-07-17290378721.8 KB
datasources

Create a data source.

By defining password and basicAuthPassword under secureJsonData property Grafana encrypts them securely as an encrypted blob in the database. The response then lists the encrypted fields under secureJsonFields.

If you are running Grafana Enterprise and have Fine-grained access control enabled you need to have a permission with action: datasources:create

post/datasources

Request body

accessstring
basicAuthboolean
basicAuthUserstring
databasestring
isDefaultboolean
jsonDataJson
namestring
secureJsonDataobject
typestring
uidstring
urlstring
userstring
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"
}