For New Relic users on our original user model, we store a list of the users who can access your account in a database by their email address, assigned role, and their first and last name if provided. You can view this data from New Relic's user interface and from the API Explorer (v2).
Tip
To obtain the same information from the New Relic API Explorer (v2), select Users > GET List.
Requirements
This generates a list of users on our original user model. It doesn't list users on our newer user model.
List all account users
To obtain a list of all users on the original user model for your account, use this command:
curl -X GET 'https://api.newrelic.com/v2/users.json' \
-H "x-api-key:$API_KEY" -i
The output will appear similar to this:
HTTP/1.1 200 OKContent-Type: application/json
{ "users": [ { "id": 123456, "first_name": "My", "last_name": "Name", "email": "my.name@mywebsite.com", "role": "owner" }, { "id": 654321, "first_name": "Adam", "last_name": "Admin", "email": "adam.admin@mywebsite.com", "role": "admin" }, { "id": 345123, "first_name": "Any", "last_name": "User", "email": "any.user@mywebsite.com", "role": "user" }, ...
Listing by user email
If you know all or part of the user's email, you can use this command to return the role, name, and user id
. The filter[email]=
clause specifies the known part of the email (for example, "my.name"
).
Note: Character matching is a simple string. No regular expression capability is available, so multiple matches may occur if the selected string is not unique.
curl -X GET 'https://api.newrelic.com/v2/users.json' \
-H "x-api-key:$API_KEY" -i \
-d 'filter[email]=my.name'
The output for this command will be the same as the first entry in the Listing all account users example.
Listing by user id
If you know the user id
, you can use this command to return the role, name, and email. The filter[ids]=
clause specifies the user id
.
curl -X GET 'https://api.newrelic.com/v2/users.json' \
-H "x-api-key:$API_KEY" -i \
-d 'filter[ids]=123456'
You can also use this command, which embeds the user id
in the URL and omits the filter.
curl -X GET 'https://api.newrelic.com/v2/users/123456.json' \
-H "x-api-key:$API_KEY" -i
The output for this command will be the same as the first entry in the Listing all account users example.