# New Relic

New Relic: applications, alert policies/conditions, deployments, NRQL queries. Exposes **27 actions** covering the API surface an agent needs - read and write.

## What it can do

| Method | What it does |
| --- | --- |
| `newrelic_applications_list` | List applications - GET /applications. |
| `newrelic_application_get` | Get one application - GET /applications/&#123;id&#125;. |
| `newrelic_application_update` | Update an application - PUT /applications/&#123;id&#125;. |
| `newrelic_application_metrics_list` | List available metrics for an application - GET /applications/&#123;app_id&#125;/metrics. |
| `newrelic_application_metric_data` | Get metric data for an application - GET /applications/&#123;app_id&#125;/metrics/data. |
| `newrelic_alert_policies_list` | List alert policies - GET /alert_policies. |
| `newrelic_alert_policy_get` | Get one alert policy - GET /alert_policies/&#123;id&#125;. |
| `newrelic_alert_policy_create` | Create an alert policy - POST /alert_policies. |
| `newrelic_alert_policy_update` | Update an alert policy - PUT /alert_policies/&#123;id&#125;. |
| `newrelic_alert_policy_delete` | Delete an alert policy - DELETE /alert_policies/&#123;id&#125;. |
| `newrelic_alert_conditions_list` | List alert conditions for a policy - GET /alert_conditions. |
| `newrelic_alert_condition_get` | Get one alert condition - GET /alert_conditions/&#123;id&#125;. |
| `newrelic_alert_condition_create` | Create an alert condition - POST /alert_conditions. |
| `newrelic_alert_condition_update` | Update an alert condition - PUT /alert_conditions/&#123;id&#125;. |
| `newrelic_alert_condition_delete` | Delete an alert condition - DELETE /alert_conditions/&#123;id&#125;. |
| `newrelic_deployments_list` | List deployments for an application - GET /applications/&#123;app_id&#125;/deployments. |
| `newrelic_deployment_create` | Create a deployment - POST /applications/&#123;app_id&#125;/deployments. |
| `newrelic_deployment_delete` | Delete a deployment - DELETE /applications/&#123;app_id&#125;/deployments/&#123;id&#125;. |
| `newrelic_key_transactions_list` | List key transactions - GET /key_transactions. |
| `newrelic_key_transaction_get` | Get one key transaction - GET /key_transactions/&#123;id&#125;. |
| `newrelic_labels_list` | List all labels - GET /labels. |
| `newrelic_label_create` | Create a label - POST /labels. |
| `newrelic_label_update` | Update a label - PUT /labels/&#123;key&#125;. |
| `newrelic_label_delete` | Delete a label - DELETE /labels/&#123;key&#125;. |
| `newrelic_users_list` | List users - GET /users. |
| `newrelic_user_get` | Get one user - GET /users/&#123;id&#125;. |
| `newrelic_nrql_query` | Execute an NRQL query via NerdGraph GraphQL - POST /graphql. |

## How to get credentials

This connector uses an **API key / token**. Create one in the provider
dashboard, then paste it into FlyMyAI:

- **`NEWRELIC_API_KEY`** - New Relic - API keys - create a User key. (https://one.newrelic.com/api-keys)

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `NEWRELIC_API_KEY` | New Relic - API keys - create a User key. |

## Troubleshooting

- **`401 Unauthorized` / `403 Forbidden`** - the token is wrong, expired, or missing a required scope; regenerate it.
- **`429 Too Many Requests`** - provider rate limit; retry after a short backoff.
- **Unexpected `4xx` on writes** - double-check required fields; the agent confirms before write actions.

## Links

- [New Relic API documentation](https://docs.newrelic.com/docs/apis/rest-api-v2/)
