How to get all pending users with Atlas Admin API? Using this method from the doc returns only 50 entries. There don’t seem to be pagination options like the ListUsers endpoint.
How to get all pending users?
How to get all pending users with Atlas Admin API? Using this method from the doc returns only 50 entries. There don’t seem to be pagination options like the ListUsers endpoint.
How to get all pending users?
Thanks for raising this one. You can use the after
query parameter with the _id
value of the last pending user from the previous request. An example below:
'https://realm.mongodb.com/api/admin/v3.0/groups/{group_id}/apps/{app_id}/user_registrations/pending_users?after=63d748faee3c72db5f1bbc08'
Note: the List Users API will utilise the user_id
value, the List Pending Users API will require the _id
value as pending users do not have a user_id
I had 53 pending users in my test environment, after specifying the after
query parameter with the _id
value of 50th pending user, the next 3 are returned. Example response:
[
{"_id":"63d748fe5dee77476b4f70aa","domain_id":"63d7447f78613e6d6ec96df0","login_ids":[{"id_type":"email","id":"pendinguser51"}],"user_id":""},
{"_id":"63d74902ee3c72db5f1bbd97","domain_id":"63d7447f78613e6d6ec96df0","login_ids":[{"id_type":"email","id":"pendinguser52"}],"user_id":""},
{"_id":"63d749075970c7cd4fe73f21","domain_id":"63d7447f78613e6d6ec96df0","login_ids":[{"id_type":"email","id":"pendinguser53"}],"user_id":""}
]
I have created a request to have our documentation updated to note that the after
query parameter can be specified using the _id
value for pending users.
Regards,
Jason
Update : The list pending users API documentation has been updated with the after
parameter and what values to provide.