Provisions partner subscriptions with NerdGraph

The Provisioning API is only available for Partner accounts.

The Provisioning NerdGraph API allows you, as a New Relic partner to create subscriptions for your accounts containing a more extensive range of New Relic products than the Partner API.

The Provisioning API and Partnership API are compatible when it comes to the products supported by both (APM, Mobile, Insights, Browser, Synthetics, and Infrastructure). If you use the Provisioning API to create a subscription for any of the newer products, you will no longer be able to update the account using the Partnership API V2.

The Provisioning API is a GraphQL mutation field named organizationProvisioningUpdatePartnerSubscription. To learn more about how to use this mutation, see Introduction to NerdGraph.

Get started: endpoint and API key

The provisioning API uses your personal API key.

The endpoint for the Provisioning API is:

https://api.newrelic.com/graphql

To get started, run the following command:

curl -v -d'{"query": "mutation { organizationProvisioningUpdatePartnerSubscription(accountId: PARTNER_ACCOUNT_ID, affectedAccountId: ACCOUNT_ID, 
products: [{id: 9200, name: \"Traces\", unitsOfMeasure: [{unit: SPANS_IN_MILLIONS, quantity: 40}]}]) {enqueued errors {message path } } }"}' -H'Content-type: application/json' -H'Api-key: PERSONAL_API_KEY' https://api.newrelic.com/graphql

Product subscriptions for an account

The Provisioning API does not allow you to upgrade or downgrade individual product subscriptions for an account. Instead, the API requires you to replace (add) the configuration for all product subscriptions for the account.

If any product configurations are not included, the Provisioning API automatically provisions the account with a free product (when available).

Mapping for products (productId)

With each account creation call, you must supply at least one New Relic product type. The mutation query only accepts the numeric productId for the type.

APM

The number of allowable hosts per account and the data retention period vary by subscription level within New Relic APM’s pricing structure. For example, New Relic APM allows an unlimited number of allowable hosts for Lite accounts, but only a 24-hour data retention period.

In addition, pricing and data retention depend on whether you select pricing plans based on hosts or compute units (CU). Use the product ID’s integer format to identify the subscription level and type of plan.

Subscription level products.id unitsOfMeasure.unit

Lite

18

Not applicable

Standard

41

HOSTS

Standard Annual

38

HOSTS

Pro (Host)

42

HOSTS

Pro Annual (Host)

39

HOSTS

Enterprise

43

HOSTS

Enterprise Annual

40

HOSTS

Enterprise Annual

40

HOSTS

If you select pricing plans based on compute units (CU), use these product ID integer formats to identify the subscription level and type of plan.

Subscription level products.id unitsOfMeasure.unit

Pro CU

126

COMPUTE_UNIT

Pro Annual CU

127

COMPUTE_UNIT

APM Essentials CU

128

COMPUTE_UNIT

APM Essentials Annual CU

129

COMPUTE_UNIT

Example Requests

APM Pro with 5 hosts

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: :PARTNER_ACCOUNT_ID,
    affectedAccountId: :ACCOUNT_ID,
    products: [
      {
        id: 42,
        unitsOfMeasure: [
          {
            unit: HOSTS,
            quantity: 5
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}

APM Pro CU with 3000 Compute Units

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 126,
        unitsOfMeasure: [
          {
            unit: COMPUTE_UNIT,
            quantity: 3000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Mobile

New Relic Mobile’s pricing structure allows 100,000 monthly active users per account at the Enterprise subscription level. Data retention varies by subscription level. Use the product ID’s integer format to identify the subscription level.

Subscription level products.id unitsOfMeasure.unit.1 unitsOfMeasure.unit.2

Lite

49

Not applicable Not applicable

Enterprise

54

APPS

USERS

Enterprise Annual

55

APPS

USERS

Example Request

Mobile Enterprise with 1 App and 100,000 Monthly Active user

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 54,
        unitsOfMeasure: [
          {
            unit: APPS,
            quantity: 1
          },
          {
            unit: USERS,
            quantity: 100000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Insights

New Relic Insights bases the pricing structure on the number of allowable events stored and the associated data retention policy. For example, data retention for Insights Free is one day.

Subscription level products.id unitsOfMeasure.unit.1 unitsOfMeasure.unit.2

Free

67

Not applicable Not applicable

None

65

Not applicable Not applicable

Pro

66

DATA_RETENTION_IN_DAYS

EVENTS_IN_MILLIONS

Pro Annual

69

DATA_RETENTION_IN_DAYS

EVENTS_IN_MILLIONS

Example Request

Insights Pro with 7 days data retention and 25 million events

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 66,
        unitsOfMeasure: [
          {
            unit: DATA_RETENTION_IN_DAYS,
            quantity: 7
          },
          {
            unit: EVENTS_IN_MILLIONS,
            quantity: 25
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Browser

New Relic Browser’s pricing structure allows an unlimited number of app users, regardless of subscription level. However, the number of allowable page views per month and the data retention period vary by subscription level. For example:

  • Lite accounts include an unlimited number of page views per month and 24-hour data retention.

  • Pro account pricing starts at 500,000 page views per month and three months data retention.

Use the product ID’s integer format to identify the subscription level.

Subscription level products.id unitsOfMeasure.unit

Lite

20

Not applicable

Pro

21

PAGE_VIEWS

Pro Annual

22

PAGE_VIEWS

Example Request

Browser Pro with 500,000 page views

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 42,
        unitsOfMeasure: [
          {
            unit: PAGE_VIEWS,
            quantity: 500000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Synthetics

With New Relic Synthetics' pricing structure, the default number of allowable monitoring checks and the data retention period vary by subscription level. Use the product ID’s integer format to identify the subscription level.

Subscription level products.id unitsOfMeasure.unit.1

Lite

81

Not applicable

Pro

77

CHECKS

Pro Annual

78

CHECKS

Example Request

Synthetics Pro with 10,000 checks

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 77,
        unitsOfMeasure: [
          {
            unit: CHECKS,
            quantity: 10000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Infrastructure

With New Relic Infrastructure’s pricing structure, the default number of instances and the data retention period vary by subscription level. Infrastructure events do not count against your New Relic Insights quota, even though you can query them in Insights.

New Relic Infrastructure offers pricing plans based on Compute Units (CU) only. Use the product ID’s integer format to identify the subscription level.

Subscription level products.id unitsOfMeasure.unit

Infrastructure None

142

Not applicable

Infrastructure Pro (CU)

134

COMPUTE_UNIT

Infrastructure Pro Annual (CU)

135

COMPUTE_UNIT

Infrastructure Essentials (CU)

136

COMPUTE_UNIT

Infrastructure Essentials Annual (CU)

137

COMPUTE_UNIT

Example Request

Infrastructure Pro with 5,000 Compute Units

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 134,
        unitsOfMeasure: [
          {
            unit: COMPUTE_UNIT,
            quantity: 5000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Serverless for Lambda
Subscription level products.id unitsOfMeasure.unit.1

Serverless Annual

9010

INGESTED_EVENTS

Serverless Monthly

9000

INGESTED_EVENTS

Example Request

Serverless Monthly with 3,000 ingested events in millions

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 9000,
        unitsOfMeasure: [
          {
            unit: INGESTED_EVENTS,
            quantity: 3000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Traces
Subscription level products.id unitsOfMeasure.unit.1

Traces Annual

9200

SPANS_IN_MILLIONS

Traces Monthly

9210

SPANS_IN_MILLIONS

Example Request

Traces Annual with 3,000 spans in millions

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 9200,
        unitsOfMeasure: [
          {
            unit: SPANS_IN_MILLIONS,
            quantity: 3000
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Logs
Subscription level products.id unitsOfMeasure.unit.1

Logs Annual Commit - 8 Days

9110

GB_PER_DAY

Logs Annual Commit - 15 Days

9111

GB_PER_DAY

Logs Annual Commit - 30 Days

9112

GB_PER_DAY

Logs Monthly Commit - 8 Days

9100

GB_PER_DAY

Logs Monthly Commit - 15 Days

9101

GB_PER_DAY

Logs Monthly Commit - 30 Days

9102

GB_PER_DAY

Example Request

Logs with 8 days data retention and 100 Gigabytes per day

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 9100,
        unitsOfMeasure: [
          {
            unit: GB_PER_DAY,
            quantity: 100
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}
Metrics
Subscription level products.id unitsOfMeasure.unit.1

Metrics Annual Commit

9310

DPM

Metrics Monthly Commit

9300

DPM

Example Request

Metrics Monthly Commitment with 50 Data Points Per Minute

mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 9300,
        unitsOfMeasure: [
          {
            unit: DPM,
            quantity: 50
          }
        ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}

GraphQL Types

The Provisioning API uses the following GraphQL types:

Subscription
Name Type Description

account_id

Integer

Numeric ID of the partner account for the partnership to which the affected account belongs.

affected_account_id

Integer

Numeric ID of the account to which the changes described in the products field will be applied.

products

Array of Product

Collection of type Product representing the values that will compose the new Subscription for the Affected Account.

Product
Name Type Description

Id

Integer

Numeric ID for the Product to be added to the Subscription.

Name

String

Name of the Product to be added to the Subscription.

Unit of Measure

Array of Unit of Measure

Collection of type Unit of Measure for this single product.

Unit of measure
Name Type Description

quantity

Integer

Numeric value for the amount of units to be applied to the Subscription.

unit

String

Name of the unit to be applied to the product (varies by product line).

Examples

Here are examples of an API call to create a subscription and the JSON response.

Create (replace existing) subscription with many products
 mutation {
  organizationProvisioningUpdatePartnerSubscription (
    accountId: PARTNER_ACCOUNT_ID,
    affectedAccountId: ACCOUNT_ID,
    products: [
      {
        id: 9410,
        unitsOfMeasure: [{unit: INCIDENT_EVENTS, quantity: 50}]
      },
      {
        id: 42,
        unitsOfMeasure: [{unit: HOSTS, quantity: 5 }]
      },
      {
        id: 42,
        unitsOfMeasure: [{unit: PAGE_VIEWS, quantity: 500000}]
      },
      {
        id: 134,
        unitsOfMeasure: [{unit: COMPUTE_UNIT, quantity: 5000}]
      },
      {
        id: 66,
        unitsOfMeasure: [
          {unit: DATA_RETENTION_IN_DAYS, quantity: 7 },
          {unit: EVENTS_IN_MILLIONS, quantity: 25 }
        ]
      },
      {
        id: 9100,
        unitsOfMeasure: [{unit: GB_PER_DAY, quantity: 100 } ]
      },
      {
        id: 9300,
        unitsOfMeasure: [{unit: DPM, quantity: 50 }
        ]
      },
      {
        id: 54,
        unitsOfMeasure: [
          {unit: APPS, quantity: 1 },
          {unit: USERS, quantity: 100000 }
        ]
      },
      {
        id: 9000,
        unitsOfMeasure: [{unit: INGESTED_EVENTS, quantity: 3000 } ]
      },
      {
        id: 77,
        unitsOfMeasure: [{unit: CHECKS, quantity: 10000 } ]
      },
      {
        id: 9200,
        unitsOfMeasure: [{unit: SPANS_IN_MILLIONS, quantity: 3000 } ]
      }
    ]
  ) {
    enqueued
    errors {
      message
      path
    }
  }
}

This query returns the following:

{
  "data": {
    "organizationProvisioningUpdatePartnerSubscription": {
      "enqueued": true,
      "errors": []
    }
  }
}
Create (replace existing) subscription with one product - Logs
mutation {
    organizationProvisioningUpdatePartnerSubscription (
      accountId: :PARTNER_ACCOUNT_ID,
      affectedAccountId: :ACCOUNT_ID,
      products: [
        {
          id: 9110,
          unitsOfMeasure: [
            {
              unit: GB_PER_DAY,
              quantity: 100
            },
            {
              unit: DATA_RETENTION_IN_DAYS,
              quantity: 8
            }

          ]
        }
      ]
    ) {
      enqueued
      errors {
        message
        path
      }
  }
}

This query returns the following:

{
  "data": {
    "organizationProvisioningUpdatePartnerSubscription": {
      "enqueued": true,
      "errors": []
    }
  }
}

Response: Once the Provisioning API has received your request and has validated it is in the right format it will respond with a message like this. This does not mean that your message has been successfully processed or applied; but it has been validated to be in the right format and it enqueued for processing.

{
  "data": {
    "organizationProvisioningUpdatePartnerSubscription": {
      "enqueued": true,
      "errors": []
    }
  }
}

Variations from the Partnership API

These are some key differences between the Provisioning API and the Partner API that frequent Partner API users should know:

Feature Description
API keys

The Provisioning API uses a Personal API key.

The Partner API uses the Partnership API key.

productId and product_id

The product id’s used for the Provisioning API are different than the ones documented for the Partner API.

Curl request format

To make a curl request to the Provisioning API, the format will be different than the Partner API:

  1. The url endpoint is different

  2. The required api key is your personal API key

  3. Provisioning API responds only to HTTP POST requests

Serverless INGESTED_EVENTS units are in millions

sending unitsOfMeasure: [{unit: INGESTED_EVENTS, quantity: 3000 } ] will be interpreted by the Provisioning API as 3,000 million events.

Insights and Mobile require 2 units of measure

Insights requires DATA_RETENTION_IN_DAYS and EVENTS_IN_MILLIONS Mobile requires APPS and USERS.

Logs data retention unit of measure is determined by productID

This is specified in the product name:

  • Logs Annual Commit - 8 Days | product ID: 9110
  • Logs Annual Commit - 15 Days | product ID: 9111
  • Logs Annual Commit - 30 Days | product ID: 9112
  • Logs Monthly Commit - 8 Days | product ID: 9100
  • Logs Monthly Commit - 15 Days | product ID: 9101
  • Logs Monthly Commit - 30 Days | product ID: 9102

For more help

If you need more help, check out these support and learning resources: