Skip to main content

Retrieve a user

You can search for a user by userId or username. With the retrieve user request, you are also retrieving the list of authenticators that are registered to the given user.

Send an HTTP request to the users endpoint

For detailed information on the HTTP request parameters and response fields, see the Users endpoint page of the API reference documentation.

The endpoint URL is different for retrieval with userId and for retrieval with username.

Send one of the following calls, depending on the chosen parameter:

  • userId: GET https://{instance}.mauth.nevis.cloud/api/v1/users/{userId}
  • username: GET https://{instance}.mauth.nevis.cloud/api/v1/users?username={username}

Your instance ID and the userId or username must be included in the endpoint URL. Your access key must be sent in the Authorization Bearer token header.

If a user exceeds the rate limit for the number of SMS or push authentications, they become blocked. In this case, the HTTP response includes the exceededRateLimits field. When the user gets unblocked, the limit resets. For more information, see SMS rate limiting and Push rate limiting.

HTTP request examples

cURL code sample to get user by userId
# Set $userId
curl "https://$instance.mauth.nevis.cloud/api/v1/users/$userId" \
-H "Authorization: Bearer $access_key"
Python 3 code sample to get user by userId
userId = '7e16ba00-92e2-4fcb-b30e-1af8fdc843aa'
resp = requests.get(f'https://{instance}.mauth.nevis.cloud/api/v1/users/{userId}',
headers = {'authorization': f'Bearer {access_key}'})
print(resp.json())

HTTP response examples

200 OK: User is found.

JSON code sample of a user with a single authenticator
{
"userId": "6a372961-8f09-4804-bf3e-d76cb50777ba",
"username": "009d56ad-9c28-466d-a407-ba5fce45c6bd",
"status": "active",
"createdAt": "2022-05-31T07:55:25Z",
"updatedAt": "2022-05-31T07:55:25Z",
"authenticators": [
{
"authenticatorId": "007d91e4-8b88-45a0-88ea-672efd4f10ea",
"name": "iPhone 12 25.07.2023 10:58:02",
"type": "ios",
"authenticatorType": "app",
"state": "active",
"enrolledAt": "2023-07-25T08:58:07Z",
"updatedAt": "2023-08-29T17:42:01Z",
"uaf": {
"userAgent": "NMASDK/3.3.2.447 (iPhone13,2; iPhoneOS 16.6) ch.nevis.accessapp.muvonda/2.7.20812.812"
}
}
],
"phones": [],
"recoveryCodes": null

}