Listing users for your account

New Relic stores the list of individuals who can use 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).

When using these examples, replace the ${API_KEY} placeholder with your REST API key or Admin's API key.

To obtain the same information from the New Relic API Explorer (v2), select Users > GET List, and include your REST API key or Admin's API key.

Listing all account users

To obtain a list of all users 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 OK
Content-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.

For more help

Additional documentation resources include:

Recommendations for learning more: