This doc explains how to use the Partnership API to add and manage users.
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 can use the user object only if your organization has users on our original user model. Before using the API, read the Partnership API requirements.
User object attributes
The user object stores customer information. One or more users can be associated with an account. In addition a specific user may be associated with multiple accounts.
This is the list of attributes in the user object. Ensure you assign the owner attribute to one user when creating a New Relic account.
Important
New Relic recommends a maximum of 1,000 accounts per user. Additional accounts may result in limited access to some New Relic features.
Type:
String
Default:
(none)
This attribute is required for new users.
The email address of the user. If a user record already exists for this email address, it will be linked to this account. Any settings in the current user object creation process will be ignored.
Email names containing special characters require URL encoding. For example, instead of +, use the URL encoded substitution %2B.
Type:
String
Default:
(none)
This attribute is required for new users.
The password for this user is ignored if the email address matches a pre-existing user record. As of Partnership API version 2, passwords passed as part of an account creation call must meet the requirements.
Caution
Passwords passed as part of an account provisioning call that do not conform to this format will generate an error and cause the operation to fail.
Type:
String
Default:
(none)
This attribute is required for new users.
The first name for this user.
Type:
String
Default:
(none)
This attribute is required for new users.
The last name for this user.
Type:
Boolean
Default:
False
A flag to indicate whether this user is the owner of the account. When creating a New Relic account, you must assign one user an owner role.
Here are the URL patterns for user-related 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 users of an account.
GET /api/v2/partners/PARTNER_ID/accounts/ACCOUNT_ID/users
Update the role of a person in the account.
PUT /api/v2/partners/PARTNER_ID/accounts/ACCOUNT_ID/users/ID
Create (add) a user to an account.
Only one user may be created per POST operation.
POST /api/v2/partners/PARTNER_ID/accounts/ACCOUNT_ID/users
Delete a user from an account.
Deleting a user removes that user from the specified account. Owners cannot be removed from accounts via the Partnership API.