Why can't Admin API key be used for Insights API?

###Insights Question Template

  • There are many ways to achieve a goal in Insights, tell us a bit about your end goal. What insights are you hoping to gain?

I’m trying to utilize the Insights API to fetch the transactions for a particular application from the Transaction table. I’m using the admin’s API key. However, I get an error in response as “{error: Invalid query key.}”. Do we really need to separate query API key to access the Insights API? Why can’t we use the Admin API key for the same?

  • Please include the URL to the Insights dashboard that needs addressing:

  • Let us know which NRQL queries you have tried so far:

Here is the request that I tested:

curl -H “Accept: application/json” -H “X-Query-Key: admin_api_key_here” “https://insights-api.newrelic.com/v1/accounts/accnt#/query?nrql=SELECT+name+FROM+Transaction+WHERE+appname%3D’app_name’

Please let me know if something is wrong with this request.

Helpful Resources:

Hey @siddhant.agarwal - It is not currently possible to use any key other than the Insights Query API to get NRQL data - or the Insert API to send event data.

The idea is that you may have multiple services sending or querying data - while Admins can only have one API key each. There is no limit to the number of insert or query keys you can create, which you can label in order to identify what each key is doing.

1 Like