Creating alert policy over API vs GraphQL

Hi!

I’m trying to automate some alert policies through Terraform, but have hit an issue with the access tokens I’ve generated.

I can manually create an alert policy through the UI, and I can also create an alert policy through the rest api, but when creating an alert policy using the same API key through GraphQL, I get “Your account is not entitled to use this feature.” as a response.

The terraform provider is using GraphQL, so is unable to create an alert policy.

Does the API key need to be set up in a specific way for use on the GraphQL API?

Hi Oliver! To access our GraphQL API, you will need to use a personal API key. You can create a Personal API key using NerdGraph. Check out our docs here:
https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys

Hope this helps!
Caryn

Hi Caryn, thanks for the reply!

I’ve been using a personal API key generated that way for the Terraform/GraphQL process, but unfortunately get the response “Your account is not entitled to use this feature.” The API key is able to manage all the other resource types I’ve tried (e.g. dashboards) but on the alert related features, it doesn’t work.

I can create the various bits of config through the interface directly, so it doesn’t seem to be a permissions issue at an account level.

Thanks!