# Wallet

Each Dentity user will have a corresponding wallet. This wallet will be used to save credentials that are issued by the issuer through Dentity. You can see more about how a credential is added to a wallet [here](/reference/wallets-and-credentials/api-endpoints/credential.md).

{% hint style="info" %}
A user will be created when you call API to create a wallet successfully. If the user already has a Dentity wallet, the API will return the wallet ID.
{% endhint %}

## Create Wallet&#x20;

<mark style="color:green;">`POST`</mark> `https://api.dentity.com/core/api/v1/programmatic/wallet`

This is the first step in the process. A Dentity wallet must be created before any credentials can be issued to the wallet holder. &#x20;

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                          | Type   | Description                                                                                    |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------- |
| firstName<mark style="color:red;">\*</mark>   | String | First name                                                                                     |
| phoneNumber<mark style="color:red;">\*</mark> | Object | <p>Phone number<br>{</p><p>    "dialCode": "+1", </p><p>    "phone": "2048089972"<br>}<br></p> |
| email<mark style="color:red;">\*</mark>       | String | Email                                                                                          |
| lastName<mark style="color:red;">\*</mark>    | String | Last name                                                                                      |

{% tabs %}
{% tab title="200: OK Create a new wallet successfully. User wallet address will be returned." %}

```javascript
{
   walletId: "62ccf87d452c6c3ab43a815e"
}
```

{% endtab %}

{% tab title="400: Bad Request Occurs when a phone number or email already exists in the Dentity system or when the wrong data type is entered." %}

```javascript
{
   message: "User email or phone number already exists or wrong data type"
}  
```

{% endtab %}

{% tab title="500: Internal Server Error Please contact the Dentity system administrator as soon as possible" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.dentity.com/reference/wallets-and-credentials/api-endpoints/wallet.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.
