2022-06-09 10:08:07 +01:00
---
aliases:
- /docs/oncall/latest/oncall-api-reference/integrations/
2022-10-26 12:32:47 -04:00
canonical: https://grafana.com/docs/oncall/latest/oncall-api-reference/integrations/
2022-06-09 10:08:07 +01:00
title: Integrations HTTP API
weight: 500
---
2022-06-03 08:09:47 -06:00
# Create an integration
```shell
curl "{{API_URL}}/api/v1/integrations/" \
--request POST \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json" \
--data '{
"type":"grafana"
}'
```
The above command returns JSON structured in the following way:
```json
{
2022-06-09 10:08:07 +01:00
"id": "CFRPV98RPR1U8",
"name": "Grafana :blush:",
"team_id": null,
"link": "{{API_URL}}/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
"type": "grafana",
"default_route": {
"id": "RVBE4RKQSCGJ2",
"escalation_chain_id": "F5JU6KJET33FE",
"slack": {
"channel_id": "CH23212D"
}
},
"templates": {
"grouping_key": null,
"resolve_signal": null,
"slack": {
"title": null,
"message": null,
"image_url": null
2022-06-03 08:09:47 -06:00
},
2022-06-09 10:08:07 +01:00
"web": {
"title": null,
"message": null,
"image_url": null
},
"email": {
"title": null,
"message": null
},
"sms": {
"title": null
},
"phone_call": {
"title": null
},
"telegram": {
"title": null,
"message": null,
"image_url": null
2022-06-03 08:09:47 -06:00
}
2022-06-09 10:08:07 +01:00
}
2022-06-03 08:09:47 -06:00
}
```
Integrations are sources of alerts and alert groups for Grafana OnCall.
2022-10-18 14:41:22 -04:00
For example, to learn how to integrate Grafana OnCall with Alertmanager see [Alertmanager ]({{< relref "../integrations/available-integrations/configure-alertmanager/" >}} ).
2022-06-03 08:09:47 -06:00
**HTTP request**
`POST {{API_URL}}/api/v1/integrations/`
# Get integration
```shell
curl "{{API_URL}}/api/v1/integrations/CFRPV98RPR1U8/" \
--request GET \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json"
```
The above command returns JSON structured in the following way:
```json
{
2022-06-09 10:08:07 +01:00
"id": "CFRPV98RPR1U8",
"name": "Grafana :blush:",
"team_id": null,
"link": "{{API_URL}}/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
"type": "grafana",
"default_route": {
"id": "RVBE4RKQSCGJ2",
"escalation_chain_id": "F5JU6KJET33FE",
"slack": {
"channel_id": "CH23212D"
}
},
"templates": {
"grouping_key": null,
"resolve_signal": null,
"slack": {
"title": null,
"message": null,
"image_url": null
2022-06-03 08:09:47 -06:00
},
2022-06-09 10:08:07 +01:00
"web": {
"title": null,
"message": null,
"image_url": null
},
"email": {
"title": null,
"message": null
},
"sms": {
"title": null
},
"phone_call": {
"title": null
},
"telegram": {
"title": null,
"message": null,
"image_url": null
2022-06-03 08:09:47 -06:00
}
2022-06-09 10:08:07 +01:00
}
2022-06-03 08:09:47 -06:00
}
```
2022-06-09 10:08:07 +01:00
This endpoint retrieves an integration. Integrations are sources of alerts and alert groups for Grafana OnCall.
2022-06-03 08:09:47 -06:00
**HTTP request**
`GET {{API_URL}}/api/v1/integrations/<INTEGRATION_ID>/`
# List integrations
```shell
curl "{{API_URL}}/api/v1/integrations/" \
--request GET \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json"
```
The above command returns JSON structured in the following way:
```json
{
2022-06-09 10:08:07 +01:00
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "CFRPV98RPR1U8",
"name": "Grafana :blush:",
"team_id": null,
"link": "{{API_URL}}/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
"type": "grafana",
"default_route": {
"id": "RVBE4RKQSCGJ2",
"escalation_chain_id": "F5JU6KJET33FE",
"slack": {
"channel_id": "CH23212D"
2022-06-03 08:09:47 -06:00
}
2022-06-09 10:08:07 +01:00
},
"templates": {
"grouping_key": null,
"resolve_signal": null,
"slack": {
"title": null,
"message": null,
"image_url": null
},
"web": {
"title": null,
"message": null,
"image_url": null
},
"email": {
"title": null,
"message": null
},
"sms": {
"title": null
},
"phone_call": {
"title": null
},
"telegram": {
"title": null,
"message": null,
"image_url": null
}
}
}
]
2022-06-03 08:09:47 -06:00
}
```
**HTTP request**
`GET {{API_URL}}/api/v1/integrations/`
# Update integration
```shell
curl "{{API_URL}}/api/v1/integrations/CFRPV98RPR1U8/" \
--request PUT \
--header "Authorization: meowmeowmeow" \
--header "Content-Type: application/json" \
--data '{
"templates": {
"grouping_key": null,
"resolve_signal": null,
"slack": {
"title": null,
"message": null,
"image_url": null
}
}
}'
```
The above command returns JSON structured in the following way:
```json
{
2022-06-09 10:08:07 +01:00
"id": "CFRPV98RPR1U8",
"name": "Grafana :blush:",
"team_id": null,
"link": "{{API_URL}}/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
"type": "grafana",
"default_route": {
"id": "RVBE4RKQSCGJ2",
"escalation_chain_id": "F5JU6KJET33FE",
"slack": {
"channel_id": "CH23212D"
}
},
"templates": {
"grouping_key": null,
"resolve_signal": null,
"slack": {
"title": null,
"message": null,
"image_url": null
2022-06-03 08:09:47 -06:00
},
2022-06-09 10:08:07 +01:00
"web": {
"title": null,
"message": null,
"image_url": null
},
"email": {
"title": null,
"message": null
},
"sms": {
"title": null
},
"phone_call": {
"title": null
},
"telegram": {
"title": null,
"message": null,
"image_url": null
2022-06-03 08:09:47 -06:00
}
2022-06-09 10:08:07 +01:00
}
2022-06-03 08:09:47 -06:00
}
```
**HTTP request**
`PUT {{API_URL}}/api/v1/integrations/<INTEGRATION_ID>/`
# Delete integration
2022-06-09 10:08:07 +01:00
2022-06-03 08:09:47 -06:00
Deleted integrations will stop recording new alerts from monitoring. Integration removal won't trigger removal of related alert groups or alerts.
```shell
curl "{{API_URL}}/api/v1/integrations/CFRPV98RPR1U8/" \
--request DELETE \
--header "Authorization: meowmeowmeow"
```
**HTTP request**
`DELETE {{API_URL}}/api/v1/integrations/<INTEGRATION_ID>/`