Skip to content

Latest commit

 

History

History
131 lines (99 loc) · 4.44 KB

File metadata and controls

131 lines (99 loc) · 4.44 KB
title user: changePassword
description Update your own password.
ms.localizationpriority medium
author yyuank
ms.reviewer iamut
ms.subservice entra-users
doc_type apiPageType
ms.date 08/16/2024

user: changePassword

Namespace: microsoft.graph

Update the signed-in user's password. Any user can update their password without belonging to any administrator role. To update another user's password in either delegated or app-only scenarios, update the passwordProfile property of the user instead. See Example 3: Update the passwordProfile of a user and reset their password.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

POST /me/changePassword

[!INCLUDE me-apis-sign-in-note]

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json. Required.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
currentPassword String Your current password.
newPassword String Your new password.

Response

If successful, this method returns a 204 No Content response code.

Example

The following example shows a request to update your own password.

Request

POST https://graph.microsoft.com/v1.0/me/changePassword
Content-type: application/json

{
    "currentPassword": "xWwvJ]6NMw+bWH-d",
    "newPassword": "0eM85N54wFxWwvJ]"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

HTTP/1.1 204 No Content

Related content