# Change Email

## Change email

<mark style="color:green;">`POST`</mark> `https://api.vaultoro.com/v1/user/changeEmail`

This endpoint is used to request a confirmation link to change email. When the user requests a confirmation link, an email containing a confirmation link is sent to the user's current email. If the user has enabled 2FA, OTP will be optional in the request body.

#### Headers

| Name           | Type   | Description  |
| -------------- | ------ | ------------ |
| Authentication | string | Bearer token |

#### Request Body

| Name     | Type   | Description                                            |
| -------- | ------ | ------------------------------------------------------ |
| otp      | string | If the user has enabled 2FA, this will be sent in body |
| password | string | User's existing password                               |
| newEmail | string | The new email that the user wants to have              |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{    "name": "Cake's name",    "recipe": "Cake's recipe name",    "cake": "Binary cake"}
```

{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```
{    "message": "Ain't no cake like that."}
```

{% 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://api-docs.vaultoro.com/change-email.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.
