This doc explains how to use the Partnership API to manage accounts. For child accounts, you'd use the child account object.
Requirements
The Partnership API is not available to your organization unless you're specifically instructed by your New Relic representative that you should use it.
You may not be able to use some aspects of this object. Before using, first read the requirements.
Account object attributes
Here are the Partnership API account object's attributes.
Type:
String
Default:
(none)
The account name attribute is required for new accounts.
This name must be unique in New Relic's database. If the specified name is not unique, it will be auto-incremented with a numeric suffix as follows:
conflicting_name_1
conflicting_name_2
etc.
Type:
String
Default:
(none)
Primary contact phone number for the account.
Type:
Boolean
Default:
False
This flag allows API access to application data. This must be set to true for partnerships remotely administering accounts.
Type:
Boolean
Default:
False
Use this flag to indicate a test account. Test accounts are assumed to contain garbage data and are ignored by internal systems. The data they generate may be deleted at any time.
Type:
Array
Default:
(none)
An array defining a list of users. There are some restrictions in place dependent on the status of your account:
For all other accounts, which have users on our original user model: When you first create an account, this field is required, and only one user can be defined: the account Owner. To add additional users, use the Partnership API user object.
When creating an account with this object, it can take some time for the account settings to populate. This means that the returned response may initially show aspects that are not true (for example, it may return a response showing default Lite subscriptions).
To specify an empty JSON array, don't use subscriptions: [ {} ]. Instead, use this format:
subscriptions: [ ]
The account API does not include an attribute to create a child account. Instead, to create child accounts, use the parent account's Account settings page in the New Relic UI.
Account API calls
Here are the URL patterns for account API functions. If using this URL pattern, send an HTTP header containing the Partner API key along with the JSON request body. For example:
GET .../api/v2/partners/:PARTNER_ID/accounts/:ID
x-api-key: :PARTNER_ACCOUNT_KEY
Content-Type: application/json
{ JSON data }
Call
Resource URL pattern
List (index) all accounts of a partner.
GET /api/v2/partners/PARTNER_ID/accounts
Show the attributes of an account.
GET /api/v2/partners/PARTNER_ID/accounts/:ID
Update the attributes of an account.
PUT /api/v2/partners/PARTNER_ID/accounts/:ID
Create an account with the given parameters.
POST /api/v2/partners/PARTNER_ID/accounts
Cancel an account.
DELETE /api/v2/partners/PARTNER_ID/accounts/:ID
Status definitions
When an account is created or listed with an API call, the account status is included automatically. Some of these statuses don't apply to all pricing models.
Account status
Definition
pending
Free account created, but primary admin is not yet activated.
paid_pending
Account created with a paid subscription, but the primary admin is not yet activated.
new
Free account, active primary admin, no application data has been collected.
paid_new
Paid subscription, active primary admin, no application data has been collected.
active
Free subscription, receiving application data.
paid_active
Paid subscription, receiving application data.
upgraded
Account's subscription was upgraded.
downgraded
Account's subscription was downgraded.
cancelled
The New Relic account subscription has been cancelled.
suspended
The New Relic account has been suspended because the primary admin has not validated their email address.
JSON example
Here is an example of a JSON request and response using the Partnership API account object.
Partnerships with more than 1000 accounts return a paginated response. To specify a page, add the following parameter to the query:
?page=
Here are examples of calls using the Partnership API account object. Note that these are examples, and that for some accounts, the users and subscriptions attributes don't apply and will be ignored.
Here's an example of creating an account for an organization on our original pricing model and on our original user model. For an example call of creating an account for organizations with the newer models, see the example after this one.
Here's an example of creating an account for a customer partnership that is on our New Relic One pricing and our New Relic One user model. For more on restrictions on API use, see requirements.
You can only use the Partnership API account object to update the name, phone_number, testing and allow_API_access values. To update subscription and users values, you must use the Partnership API subscription object and Partnership API user object.