> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.littglobal.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.littglobal.com/_mcp/server.

# Update User Profile - Password

POST TBD/api/v2/users/update-profile/password
Content-Type: application/json

This API endpoint is utilized to change the password of existing user profiles. It plays a crucial role in maintaining the security of the registered users. Besides safeguarding user details, it also allows for easy password updates should the users decide to change their current passwords.

### Request Body

- `old_password` (String): The existing password of the user profile.
- `new_password` (String): The new password that will replace the old password.
- `new_password_confirmation` (String): The confirmation of the new password. This should match the new_password field.
    

### Response

As this API is merely for updating the password, it does not provide a response as a confirmation of the update, it is representative with an empty array. If the change is not successful (for example, the old password does not match the current password), an error will be thrown.

Reference: https://docs.littglobal.com/litt-white-label/api-reference/user-profile/update-user-profile-password

## Request

### Query parameters

- `api_token` (string, optional)

### Body (application/json)

This endpoint expects an object.

- `api` (string, optional)
- `data` (ApiV2UsersUpdateProfilePasswordPostRequestBodyContentApplicationJsonSchemaData, optional)

## Response

### 200

Update User Profile - Password

- `message` (string, optional)
- `api` (string, optional)
- `status` (string, optional)
- `data` (list of any, optional)

## Types

### ApiV2UsersUpdateProfilePasswordPostRequestBodyContentApplicationJsonSchemaData

- `old_password` (string, optional)
- `new_password` (string, optional)
- `new_password_confirmation` (string, optional)

## Examples

**Request**

```json
{
  "api": "update-user-profile-password",
  "data": {
    "old_password": "Secret123!!",
    "new_password": "Secret456!!",
    "new_password_confirmation": "Secret456!!"
  }
}
```

**Response**

```json
{
  "message": "Password has been changed",
  "api": "update-user-profile-password",
  "status": "success",
  "data": []
}
```

**SDK Code**

```python User Profile_updateUserProfilePassword_example
import requests

url = "https://tbd/api/v2/users/update-profile/password"

querystring = {"api_token":"{{token}}"}

payload = {
    "api": "update-user-profile-password",
    "data": {
        "old_password": "Secret123!!",
        "new_password": "Secret456!!",
        "new_password_confirmation": "Secret456!!"
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript User Profile_updateUserProfilePassword_example
const url = 'https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"api":"update-user-profile-password","data":{"old_password":"Secret123!!","new_password":"Secret456!!","new_password_confirmation":"Secret456!!"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go User Profile_updateUserProfilePassword_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D"

	payload := strings.NewReader("{\n  \"api\": \"update-user-profile-password\",\n  \"data\": {\n    \"old_password\": \"Secret123!!\",\n    \"new_password\": \"Secret456!!\",\n    \"new_password_confirmation\": \"Secret456!!\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby User Profile_updateUserProfilePassword_example
require 'uri'
require 'net/http'

url = URI("https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"api\": \"update-user-profile-password\",\n  \"data\": {\n    \"old_password\": \"Secret123!!\",\n    \"new_password\": \"Secret456!!\",\n    \"new_password_confirmation\": \"Secret456!!\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java User Profile_updateUserProfilePassword_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D")
  .header("Content-Type", "application/json")
  .body("{\n  \"api\": \"update-user-profile-password\",\n  \"data\": {\n    \"old_password\": \"Secret123!!\",\n    \"new_password\": \"Secret456!!\",\n    \"new_password_confirmation\": \"Secret456!!\"\n  }\n}")
  .asString();
```

```php User Profile_updateUserProfilePassword_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D', [
  'body' => '{
  "api": "update-user-profile-password",
  "data": {
    "old_password": "Secret123!!",
    "new_password": "Secret456!!",
    "new_password_confirmation": "Secret456!!"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp User Profile_updateUserProfilePassword_example
using RestSharp;

var client = new RestClient("https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"api\": \"update-user-profile-password\",\n  \"data\": {\n    \"old_password\": \"Secret123!!\",\n    \"new_password\": \"Secret456!!\",\n    \"new_password_confirmation\": \"Secret456!!\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift User Profile_updateUserProfilePassword_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "api": "update-user-profile-password",
  "data": [
    "old_password": "Secret123!!",
    "new_password": "Secret456!!",
    "new_password_confirmation": "Secret456!!"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://tbd/api/v2/users/update-profile/password?api_token=%7B%7Btoken%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```