---
agentTools:
  projectIndex: https://evolutionscript.readme.io/llms.txt
---

# Change Email

## Email change with success

The JSON returned has the **activation** param **false** /, ex:

```json
{
  status:"success",
  activation: false,
  token: ''
}
```

## Requires confirmation

The JSON required has the **activation** param **true**, ex:

```json
{
  status:"success",
  activation: true,
  token: 'activationToken....'
}
```

Then use that token for the Confirm Email Change request.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Api with Access Token",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://yoursite.com/api/"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/user/update/email": {
      "post": {
        "summary": "Change Email",
        "description": "",
        "operationId": "change-email",
        "parameters": [
          {
            "name": "Authentication",
            "in": "header",
            "description": "Ex: Bearer {access_token} should be replaced with the user access token.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer {access_token}"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "New email address."
                  },
                  "password": {
                    "type": "string",
                    "description": "User password or Two-Factor code if it is active."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "No requires email activation": {
                    "value": "{\n  status:\"success\",\n  activation: false,\n  token: ''\n}"
                  },
                  "Requires email activation": {
                    "value": "{\n  status:\"success\",\n  activation: true,\n  token: 'activationToken....'\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  status:\"success\",\n  message: \"invalidrequest\"\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "65bd0d9a8cfebc004220b8d8:65c5cbef68503500479da215"
}
```