---
title: "Update the authenticated user's email (OTP-gated, requires confirmation link click)"
method: PATCH
path: "/v1/users/email"
tags: ["Users"]
---

# Update the authenticated user's email (OTP-gated, requires confirmation link click)

`PATCH /v1/users/email`

## Request

- Base URL: `https://identity-api.paymongo.com`
- URL: `https://identity-api.paymongo.com/v1/users/email`
- Auth: HTTP bearer

Two-call flow with the same payload (only `code` differs). Empty `code` issues the OTP challenge to the current email. Populated `code` verifies the OTP and stages the email change — the new address is stored in email_confirmations with a 1-day expiry and a confirmation link is sent to it. The user's email is only swapped when the link is clicked.

## Request body

- UserUpdateEmailRequestEnvelopeDTO
  - `data` object
    - `attributes` UserUpdateEmailRequestDTO
      - `code` string
      - `current_password` string, required
      - `email` string, required
      - `factor` 'email' | 'sms' | 'totp'

## Response `200`

Staged the email change (populated code in request)

- object: Standard response containing data and its metadata if any
  - `data` object
    - `attributes` UserUpdateEmailPendingAttributesDTO
      - `expires_at` integer
      - `pending_email` string
    - `id` string
    - `type` string
  - `has_more` boolean

## Other responses

- `201`: Issued an OTP challenge (empty code in request)
- `400`: Bad Request
- `401`: Unauthorized
- `410`: Gone
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error
- `502`: Bad Gateway

---

[API](https://skmtc.dev/paymongo/apis/identity.md) - [All operations](https://skmtc.dev/paymongo/apis/identity/llms.txt) - [OpenAPI document](https://skmtc.dev/paymongo/apis/identity/revisions/cc3056164874?raw)
