v1

latestSwagger 2.02026-07-17290378721.8 KB
service_accounts

Create service account

Required permissions (See note in the introduction for an explanation): action: serviceaccounts:write scope: serviceaccounts:*

Requires basic authentication and that the authenticated user is a Grafana Admin.

post/serviceaccounts

Request body

isDisabledboolean
namestring
role'Viewer' | 'Editor' | 'Admin'

Example request

{
  "name": "grafana",
  "role": "Admin"
}

Response

(empty)

accessControlobject
avatarUrlstring
idinteger
isDisabledboolean
loginstring
namestring
orgIdinteger
rolestring
tokensinteger

Example response

{
  "accessControl": {
    "serviceaccounts:delete": true,
    "serviceaccounts:read": true,
    "serviceaccounts:write": true
  },
  "avatarUrl": "/avatar/85ec38023d90823d3e5b43ef35646af9",
  "login": "sa-grafana",
  "name": "grafana",
  "orgId": 1,
  "role": "Viewer"
}