> For the complete documentation index, see [llms.txt](https://docs.tylt.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tylt.money/tylt-embedded-wallet-service/user-management/get-user.md).

# Get User

Retrieves a user’s account details and current KYC summary.

### Endpoint

```http
GET /whitelabel/users/get
```

### Request Headers

```http
x-tlp-apikey: <api-key>
x-tlp-signature: <hmac-signature>
```

### Query Parameters

Provide at least one of the following user identifiers: `endUserEmail`, `endUserId`, or `externalUserId`.

| Field            | Type   |    Required | Description                         |
| ---------------- | ------ | ----------: | ----------------------------------- |
| `endUserEmail`   | String | Conditional | End user’s registered email address |
| `endUserId`      | Number | Conditional | Tylt's end-user ID                  |
| `externalUserId` | String | Conditional | Merchant’s own user identifier      |

At least one identifier is required.

### Example Request

```http
GET /whitelabel/users/get?externalUserId=user-10021
```

The signature must be calculated over the query object:

```json
{
  "endUserId": 20001, // Optional: Provide one user identifier only
  "endUserEmail": "joe@example.com", // Optional: Alternative to endUserId and externalUserId
  "externalUserId": "user-10021", // Optional: Alternative to endUserId and endUserEmail
}
```

### Code Snippet

{% tabs %}
{% tab title="JavaScript (Axios)" %}

```javascript
import crypto from 'crypto';
import axios from 'axios';

const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

const queryParams = {
    endUserId: 20001, // Optional: Provide one user identifier only
    endUserEmail: "joe@example.com", // Optional: Alternative to endUserId and externalUserId
    externalUserId: "user-10021", // Optional: Alternative to endUserId and endUserEmail
};

const rawPayload = JSON.stringify(queryParams);
const signature = crypto.createHmac('sha256', apiSecret).update(rawPayload).digest('hex');

const headers = {
    'x-tlp-apikey': apiKey,
    'x-tlp-signature': signature
};

const queryString = new URLSearchParams(queryParams).toString();
axios.get(`https://api.tylt.money/whitelabel/users/get?${queryString}`, { headers })
    .then(response => console.log(response.data))
    .catch(error => console.error('Error:', error.response ? error.response.data : error.message));
```

{% endtab %}
{% endtabs %}

### Successful Response

```json
{
  "msg": "",
  "data": {
    "endUserId": 1012,
    "emailId": "joe@example.com",
    "externalUserId": "user-10021",
    "kycStatus": "approved",
    "walletOpsAllowed": true
  }
}
```

### Response Fields

| Field              | Description                                                 |
| ------------------ | ----------------------------------------------------------- |
| `endUserId`        | Tylt end-user ID                                            |
| `emailId`          | End user’s registered email address                         |
| `externalUserId`   | Merchant-provided user identifier                           |
| `kycStatus`        | Current overall KYC status                                  |
| `walletOpsAllowed` | Indicates whether wallet operations are currently permitted |

A value of `false` for `walletOpsAllowed` may indicate that:

* KYC has not been completed
* KYC is pending or rejected
* The user is suspended
* The user requires additional verification
* Wallet operations have been restricted by Tylt

### Possible Errors

| HTTP Status | Message                                                         | Description                                        |
| ----------- | --------------------------------------------------------------- | -------------------------------------------------- |
| `400`       | `One of endUserEmail, endUserId or externalUserId is required.` | No user identifier was provided                    |
| `401`       | `Api Key authentication failed!`                                | Authentication failed                              |
| `403`       | `API key or owner is inactive.`                                 | API access or merchant account is inactive         |
| `403`       | `IP not whitelisted.`                                           | Request originated from an unauthorized IP address |
| `403`       | `End user is suspended.`                                        | The identified user is suspended                   |
| `404`       | `End user not found for this owner.`                            | No matching user exists under the merchant         |
