---
title: "Update the authenticated user's password (OTP-gated)"
method: PATCH
path: "/v1/users/password"
tags: ["Users"]
---

# Update the authenticated user's password (OTP-gated)

`PATCH /v1/users/password`

## Request

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

Two-call flow with the same payload. Empty `code` validates the payload and issues an OTP challenge — response has `data.type = "challenge"` and carries `expiration_at`/`resend_at`/`factor`. Populated `code` re-validates, verifies the OTP, applies the new password, and returns fresh tokens — response has `data.type = "jwt"`. Both flows return 201; clients discriminate on `data.type`.

## Request body

- UserUpdatePasswordRequestEnvelopeDTO
  - `data` object
    - `attributes` UserUpdatePasswordRequestDTO
      - `code` string
      - `current_password` string, required
      - `factor` 'email' | 'sms' | 'totp'
      - `password` string, required
      - `password_confirmation` string, required

## Response `201`

Applied the new password (populated code in request)

- object: Standard response containing data and its metadata if any
  - `data` object
    - `attributes` UserUpdatePasswordSuccessAttributesDTO
      - `expiry_timer` integer
      - `organization_id` string
      - `user_contact_number` string
      - `user_first_name` string
      - `user_last_name` string
    - `id` string
    - `type` string
  - `has_more` boolean

## Other responses

- `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)
