# Can't seem to add the integration key via /api/alert-notifications when creating a new notification channel for PagerDuty in Grafana-4.6.1

**URL:** <https://community.grafana.com/t/cant-seem-to-add-the-integration-key-via-api-alert-notifications-when-creating-a-new-notification-channel-for-pagerduty-in-grafana-4-6-1/4339>\
**Category:** General\
**Tags:** api\
**Created:** [December 14, 2017, 10:41pm UTC](https://community.grafana.com/t/cant-seem-to-add-the-integration-key-via-api-alert-notifications-when-creating-a-new-notification-channel-for-pagerduty-in-grafana-4-6-1/4339 "2017-12-14T22:41:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blangen](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@blangen](https://community.grafana.com/u/blangen)\
**Post date:** [December 14, 2017, 10:41pm UTC](https://community.grafana.com/t/cant-seem-to-add-the-integration-key-via-api-alert-notifications-when-creating-a-new-notification-channel-for-pagerduty-in-grafana-4-6-1/4339/1 "2017-12-14T22:41:01Z")

</div>

I’m unable to find detailed documentation on the usage of the alert-notifications API, so I’m kind of shooting in the dark here. My goal is to create a new notification channel to integrate with our PagerDuty service via the API as part of a new deployment, and I can create the notification channel with the correct ‘type’ selected as ‘pagerduty’, and I can make it default to send on all alerts… but, I can’t figure out how to add the integration key, select the option to include images in the notification, or allow the ability to auto resolve the incident in pagerduty once the alert goes back to the OK state.

Here is my API POST code:

curl -s -X POST --header “Content-Type:application/json” [https://user:user@monitor-app.mycompany.com/api/alert-notifications](https://user:user@monitor-app.mycompany.com/api/alert-notifications) --data-binary @- \<\<EOF  
{  
“name”: “new PD notification channel”,  
“Type”: “pagerduty”,  
“isDefault”: true,  
“settings”: {  
“Integration Key”: “6c5906d55d0d657db1acd1220cfd4ae4”  
}  
}  
EOF

Can anyone help me figure out how to add the integration key and also the other 2 options I listed above?

---

<div class="post-metadata">

**Author:** ![blangen](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@blangen](https://community.grafana.com/u/blangen)\
**Post date:** [December 15, 2017, 5:56pm UTC](https://community.grafana.com/t/cant-seem-to-add-the-integration-key-via-api-alert-notifications-when-creating-a-new-notification-channel-for-pagerduty-in-grafana-4-6-1/4339/2 "2017-12-15T17:56:22Z")

</div>

I figured it out by looking at the source for Grafana 4.6.1 in pkg/services/alerting/notifiers/pagerduty.go:

curl -s -X POST --header “Content-Type:application/json” [https://user:user@monitor-app.mycompany.com/api/alert-notifications](https://user:user@monitor-app.mycompany.com/api/alert-notifications) --data-binary @- \<\<EOF  
{  
“name”: “new PD notification channel”,  
“Type”: “pagerduty”,  
“isDefault”: true,  
“settings”: {  
“integrationKey”: “6c5906d55d0d657db1acd1220cfd4ae4”,  
“autoResolve”: true  
}  
}

---

<div class="post-metadata">

**Author:** ![anon80964540](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@anon80964540](https://community.grafana.com/u/anon80964540)\
**Post date:** [January 13, 2021, 4:40pm UTC](https://community.grafana.com/t/cant-seem-to-add-the-integration-key-via-api-alert-notifications-when-creating-a-new-notification-channel-for-pagerduty-in-grafana-4-6-1/4339/3 "2021-01-13T16:40:09Z")

</div>

Closed on January 13, 2021, 4:40pm UTC


