Query and mutate New Relic data using the NerdGraph GraphQL API

domain: docs.newrelic.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Obtain a New Relic User API key from the API Keys UI (Account Settings > API Keys) and note your Account ID
  2. Send GraphQL requests via POST to 'https://api.newrelic.com/graphql' with 'Content-Type: application/json' and 'API-Key: YOUR_KEY' header
  3. For NRQL queries embed them in the actor.account.nrql query: '{actor {account(id: YOUR_ACCOUNT_ID) {nrql(query: "SELECT count(*) FROM Transaction SINCE 1 hour ago") {results}}}}'
  4. For mutations such as creating alert policies use the 'alertsPolicyCreate' mutation, passing the account ID and policy input object with name and incident preference
  5. Paginate large results using the 'cursor' field returned in responses; re-send the query with 'cursor: "<value>"' argument to fetch subsequent pages

Known gotchas

Related routes

Create and manage New Relic Synthetics monitors via the NerdGraph GraphQL API
docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-synthetics-tutorial · 6 steps · unrated
Query and mutate Vetspire practice data via its GraphQL API while respecting the maximum query depth limit
developer.vetspire.com · 5 steps · unrated
Create, update, and delete New Relic alert policies via the NerdGraph API
docs.newrelic.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans