* fixing things * Update add-authentication-for-data-source-plugins.md * Docs: Sync release branch with latest docs (#32986) * Docs: Sync release branch with latest docs * Fixed what branch to update * Elasticsearch: Force re-rendering of each editor row type change (#32993) (#32996) (cherry picked from commit136460d369) Co-authored-by: Giordano Ricci <me@giordanoricci.com> * ReleaseNotes: Updated changelog and release notes for 7.5.4 (#32973) (#32998) * ReleaseNotes: Updated changelog and release notes for 7.5.4 (#32973) * ReleaseNotes: Updated changelog and release notes for 7.5.4 * Update index link * Fix boldness * Update CHANGELOG.md Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update codespell words * Update docs/sources/release-notes/release-notes-7-5-4.md * Update CHANGELOG.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/release-notes/release-notes-7-5-4.md * Change bold markers * Fix escaping * Update drone yaml Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com> Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> (cherry picked from commita516ff00db) * Add old release notes Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * fixing things * Merge branch 'v7.5.x' of https://github.com/grafana/grafana into backport-32916-to-v7.5.x * Update add-authentication-for-data-source-plugins.md * Update license-restrictions.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> Co-authored-by: Giordano Ricci <me@giordanoricci.com> Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
519 lines
12 KiB
Markdown
519 lines
12 KiB
Markdown
+++
|
||
title = "Admin HTTP API "
|
||
description = "Grafana Admin HTTP API"
|
||
keywords = ["grafana", "http", "documentation", "api", "admin"]
|
||
aliases = ["/docs/grafana/latest/http_api/admin/"]
|
||
+++
|
||
|
||
# Admin API
|
||
|
||
The Admin HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given
|
||
the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user
|
||
must have the Grafana Admin permission. (The default admin user is called `admin` and has permission to use this API.)
|
||
|
||
## Settings
|
||
|
||
`GET /api/admin/settings`
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
GET /api/admin/settings
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
## Grafana Stats
|
||
|
||
`GET /api/admin/stats`
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
GET /api/admin/stats
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Global Users
|
||
|
||
`POST /api/admin/users`
|
||
|
||
Create new user. Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
POST /api/admin/users HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
Note that `OrgId` is an optional parameter that can be used to assign a new user to a different organization when [auto_assign_org]({{< relref "../administration/configuration.md#auto-assign-org" >}}) is set to `true`.
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Password for User
|
||
|
||
`PUT /api/admin/users/:id/password`
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
Change password for a specific user.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
PUT /api/admin/users/2/password HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Permissions
|
||
|
||
`PUT /api/admin/users/:id/permissions`
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
PUT /api/admin/users/2/permissions HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Delete global User
|
||
|
||
`DELETE /api/admin/users/:id`
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
DELETE /api/admin/users/2 HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Pause all alerts
|
||
|
||
`POST /api/admin/pause-all-alerts`
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
POST /api/admin/pause-all-alerts HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
JSON Body schema:
|
||
|
||
- **paused** – If true then all alerts are to be paused, false unpauses all alerts.
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Auth tokens for User
|
||
|
||
`GET /api/admin/users/:id/auth-tokens`
|
||
|
||
Return a list of all auth tokens (devices) that the user currently have logged in from.
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
GET /api/admin/users/1/auth-tokens HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Revoke auth token for User
|
||
|
||
`POST /api/admin/users/:id/revoke-auth-token`
|
||
|
||
Revokes the given auth token (device) for the user. User of issued auth token (device) will no longer be logged in
|
||
and will be required to authenticate again upon next activity.
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
POST /api/admin/users/1/revoke-auth-token HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Logout User
|
||
|
||
`POST /api/admin/users/:id/logout`
|
||
|
||
Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in
|
||
and will be required to authenticate again upon next activity.
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
POST /api/admin/users/1/logout HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Reload provisioning configurations
|
||
|
||
`POST /api/admin/provisioning/dashboards/reload`
|
||
|
||
`POST /api/admin/provisioning/datasources/reload`
|
||
|
||
`POST /api/admin/provisioning/plugins/reload`
|
||
|
||
`POST /api/admin/provisioning/notifications/reload`
|
||
|
||
Reloads the provisioning config files for specified type and provision entities again. It won't return
|
||
until the new provisioned entities are already stored in the database. In case of dashboards, it will stop
|
||
polling for changes in dashboard files and then restart it with new configurations after returning.
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
POST /api/admin/provisioning/dashboards/reload HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|
||
|
||
## Reload LDAP configuration
|
||
|
||
`POST /api/admin/ldap/reload`
|
||
|
||
Reloads the LDAP configuration.
|
||
|
||
Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
|
||
|
||
**Example Request**:
|
||
|
||
```http
|
||
POST /api/admin/ldap/reload HTTP/1.1
|
||
Accept: application/json
|
||
Content-Type: application/json
|
||
```
|
||
|
||
**Example Response**:
|
||
|
||
```http
|
||
HTTP/1.1 200
|
||
Content-Type: application/json
|
||
|
||
```
|