API to find users who have last active status as "Pending invite"

Hi Team,
Is there any API to find out which users do not have an account and which users have an account but since they have not logged in once there last active status is “Pending invite”

1 Like

Hi @Bikash.Singh

Pending users are interesting. In that technically pending users don’t exist on an account. They are there in the UI, but while they are pending they are not listed as users on the account in any real sense.

So, I don’t think a Users API (unless pending users was built into the API) would be able to pull these out.

Right now it’s certainly not possible.

I suggest you add your use case and vote over to the thread below, and I’ll get that +1 logged internally for you :slight_smile:

2 Likes

Hi @RyanVeitch

Thanks for your confirmation.
Also, could you confirm if for a user we keep creating account with same details(same name, email, etc), will it create a new account with every request or would it inactivate the previous account and create a new one, or would the API do nothing?

1 Like

Where specifically are you thinking?

If you are on the New Relic Account Sign Up page and you keep entering the same details, you will keep one single user, but have created many accounts that user has access to. None de-activated. (You can see all accounts you have access to here: https://rpm.newrelic.com/accounts/

If you in an account looking at the Users and Roles page, and you keep hitting Add User & entering the same details, you should see errors noting that the user already exists in the account.

As noted that User Management API does not yet exist, so I’m not sure what the expected behaviour would be with that.

1 Like

Thanks again @RyanVeitch

Actually I was planning to use the partnership API for creating users, but in case the user already exists, I want to avoid re-creation of the same user (some users who have not logged in once have there status set as pending).

If I understand correctly, what you are suggesting is the partnership API should throw an error when a user is going to get created with the same name and email ? (if his/her account was already created with those details)

1 Like

Sorry - I had forgotten about this post in which you discussed having access to the partner API…

In that case, I believe the partner API should throw an error, as in our user database, email addresses must be unique. We can not have multiple separate user entries in that DB with the same email address.

I will test this with a internal testing account & the partner API, and I’ll update here with my findings

@Bikash.Singh - Confirmed with the Partnership API that you will get an error, see below:

Sorry this screenshot is rather ugly with the obfuscation, but, there are plenty of email addresses and API keys that shouldn’t be shown…

You’ll see the first call above the orange line. The successful response includes the new list of all users on the selected account.

Below the orange line is the second call, with the same new user’s details, the error message being:

{"error":{"accountview":["User already exists for this account"]}}
2 Likes

Hi @RyanVeitch

Awesome. Thanks for such a detailed explanation Ryan, really appreciate it :slight_smile:

This clearly answers my query.

1 Like

Awesome! Happy to help :smiley:

1 Like

Hi @RyanVeitch

If you see in the attached screenshot, a user with same mail is getting created without throwing an error( I suppose it is due to it being in pending invite which you confirmed is only UI part).

Could you please confirm if a user is created with the same details already existing in new relic with “pending invite” status, what would be the result:

  1. User gets created
  2. An error is thrown(if yes, what is the error and it’s code)
  3. No Changes
1 Like

Hmm, with pending users I’m not sure what the expected behaviour is.

I don’t have a SAML enabled test account to try with, but as I noted before, Pending users don’t technically exist on the account, or in the account DB, it does make some sense that you are seeing multiple users, the DB itself isn’t yet blocking that double addition.

My assumption is that once that pending user is activated, it will clash with the existing user, I have no idea if that will throw an error or not. But I’ll ask internally and get you an update when I hear back.

sure Ryan, thanks for your time, waiting for your response

2 Likes