# Get User Wallet Info

## Overview

{% hint style="success" %}

### Endpoint

* **Method:** GET
* **URL:** `/user`
  {% endhint %}

{% hint style="success" %}

### Header

* **Field:** Authorization
* **Value:** `Bearer + (Access token)`
  {% endhint %}

### Responses

#### Success (Code 200)

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "user": {
    "identifier": "fake@example.com", 
     "id": "5ebac534954b54139806c112",
          },
  "wallets": [
    {
      "id": "656ab9db6a378b91ab1871be",
      "address": "0x8e9DD3c1Db3254d968967CbC367542C343273629",
      "smartAccount": "0x8e9DD3c1Db3254d968967CbC367542C343273629",
      "custodial": true,
      "user": "5ebac534954b54139806c112"
      "type":"evm"
    }
  ]
}
</code></pre>

* **`user`**: User information.
  * **`id`**: User ID.
  * **`identifier`**: User's email address.
* **`wallets`**: Array of user wallets.
  * **`id`**: Wallet ID.
  * **`address`**: Wallet address.
  * **`custodial`**: Indicates whether the wallet is custodial (true/false).
  * **`user`**: User ID associated with the wallet.
  * **`smartAccount`**: Smart Account address for account abstraction and paymaster.<br>
* **Media Type**: application/json
* **Example Value**: An object containing the all information about the user.

#### Unauthorized (Code 401)

```json
{
  "code": 401,
  "message": "Please Authenticate"
}
```

* **Media Type**: application/json
* **Example Value**: An error response indicating unauthorized access.

**Internal Server Error (Code 500)**

```json
{
  "error": "Internal Server Error"
}
```

* **Media Type**: application/json
* **Example Value**: An error response indicating an internal server error.

## Usage

1. Once connected to the Xerial server use the given **access token** to request the User account  and Wallet information.
2. **Send a GET request** to the `/api/user` endpoint to retrieve user information and associated wallets.
3. **Handle the response accordingly** based on success, unauthorized access or internal server error.

**Note:** Ensure the user is authenticated before making the request.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xerial.gitbook.io/xerial-doc/xerial-apis/xerial-global-wallets/get-user-wallet-info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
