@ -11,15 +11,16 @@ parent = "http_api"
# Alerting Notification Channels API
This page documents the Alerting Notification Channels API.
## Identifier (id) vs unique identifier (uid)
The identifier (id) of a notification channel is an auto-incrementing numeric value and is only unique per Grafana install.
The unique identifier (uid) of a notification channel can be used for uniquely identify a notification channel between
multiple Grafana installs. It's automatically generated if not provided when creating a notification channel. The uid
allows having consistent URL's for accessing notification channels and when syncing notification channels between multiple
Grafana installs, see [alert notification channel provisioning ](/administration/provisioning/#alert-notification-channels )
for more information.
allows having consistent URLs for accessing notification channels and when syncing notification channels between multiple
Grafana installations, refer to [alert notification channel provisioning ]({{< relref "../administration/provisioning.md#alert-notification-channels" >}} ).
The uid can have a maximum length of 40 characters.
@ -29,7 +30,7 @@ Returns all notification channels that the authenticated user has permission to
`GET /api/alert-notifications`
**Example R equest**:
**Example r equest**:
```http
GET /api/alert-notifications HTTP/1.1
@ -38,7 +39,7 @@ Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -65,13 +66,11 @@ Content-Type: application/json
## Get all notification channels (lookup)
Returns all notification channels, but with less detailed information.
Accessible by any authenticated user and is mainly used by providing
alert notification channels in Grafana UI when configuring alert rule.
Returns all notification channels, but with less detailed information. Accessible by any authenticated user and is mainly used by providing alert notification channels in Grafana UI when configuring alert rule.
`GET /api/alert-notifications/lookup`
**Example R equest**:
**Example r equest**:
```http
GET /api/alert-notifications/lookup HTTP/1.1
@ -80,7 +79,7 @@ Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -109,9 +108,9 @@ Content-Type: application/json
`GET /api/alert-notifications/uid/:uid`
Will return the notification channel given the notification channel uid.
Returns the notification channel given the notification channel uid.
**Example R equest**:
**Example r equest**:
```http
GET /api/alert-notifications/uid/team-a-email-notifier HTTP/1.1
@ -120,7 +119,7 @@ Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -146,9 +145,9 @@ Content-Type: application/json
`GET /api/alert-notifications/:id`
Will return the notification channel given the notification channel id.
Returns the notification channel given the notification channel id.
**Example R equest**:
**Example r equest**:
```http
GET /api/alert-notifications/1 HTTP/1.1
@ -157,7 +156,7 @@ Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -181,11 +180,11 @@ Content-Type: application/json
## Create notification channel
You can find the full list of [supported notifiers ](/alerting/notifications/#all-supported-notifier ) at the alert notifiers page.
You can find the full list of [supported notifiers ](/alerting/notifications/#all-supported-notifier ) on the alert notifiers page.
`POST /api/alert-notifications`
**Example R equest**:
**Example r equest**:
```http
POST /api/alert-notifications HTTP/1.1
@ -205,7 +204,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
}
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -232,7 +231,7 @@ Content-Type: application/json
Updates an existing notification channel identified by uid.
**Example R equest**:
**Example r equest**:
```http
PUT /api/alert-notifications/uid/cIBgcSjkk HTTP/1.1
@ -253,7 +252,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
}
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -281,7 +280,7 @@ Content-Type: application/json
Updates an existing notification channel identified by id.
**Example R equest**:
**Example r equest**:
```http
PUT /api/alert-notifications/1 HTTP/1.1
@ -303,7 +302,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
}
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -331,7 +330,7 @@ Content-Type: application/json
Deletes an existing notification channel identified by uid.
**Example R equest**:
**Example r equest**:
```http
DELETE /api/alert-notifications/uid/team-a-email-notifier HTTP/1.1
@ -340,7 +339,7 @@ Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -357,7 +356,7 @@ Content-Type: application/json
Deletes an existing notification channel identified by id.
**Example R equest**:
**Example r equest**:
```http
DELETE /api/alert-notifications/1 HTTP/1.1
@ -366,7 +365,7 @@ Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -384,7 +383,7 @@ You can find the full list of [supported notifiers](/alerting/notifications/#all
`POST /api/alert-notifications/test`
**Example R equest**:
**Example r equest**:
```http
POST /api/alert-notifications/test HTTP/1.1
@ -400,7 +399,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
}
```
**Example R esponse**:
**Example r esponse**:
```http
HTTP/1.1 200
@ -410,4 +409,3 @@ Content-Type: application/json
"message": "Test notification sent"
}
```