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

# Update phone — step 4: commit a deferred change (admin)

POST https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange
Content-Type: application/json

Applies a phone-number change that was deferred with `deferCommit: true`. Requires an authorized admin access token. VLens re-validates the OTP request and the user's Digital Identity before applying the new phone number. Step 4 of the update-phone-number flow — only needed when the deferred-commit variant was used in step 3.

Reference: https://docs.vlenseg.com/api-reference/vlens-api/digital-identity-account-management/post-digital-identity-update-phone-commit-phone-change

## Authentication

- `ApiKey` header (required) — Static API key issued to your tenant. Required on every request.
- `Authorization` header (bearer token, required) — Admin JWT from /api/credentials/Login. Required for admin operations.

## Servers

- `https://api.vlenseg.com` (Production, default)
- `https://api.vlens.co` (Staging)

## Request

### Body (application/json)

This endpoint expects an object.

- `phoneNumberOtpRequestId` (string, required) — The `phoneNumberOtpRequestId` that was validated with `deferCommit: true` in `POST /api/DigitalIdentity/UpdatePhone/ValidatePhoneOtp`.

## Response

### 200

Phone number updated.

- `data` (ApiDigitalIdentityUpdatePhoneCommitPhoneChangePostResponsesContentApplicationJsonSchemaData, required)
- `error_code` (integer, required, nullable)
- `error_message` (string, required, nullable)
- `error_descriptions` (string, required, nullable)

## Types

### ApiDigitalIdentityUpdatePhoneCommitPhoneChangePostResponsesContentApplicationJsonSchemaData

- `isPhoneNumberConfirmed` (boolean, required) — Whether the new phone number is confirmed. `true` on success.

## Examples

**Request**

```json
{
  "phoneNumberOtpRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

**Response**

```json
{
  "data": {
    "isPhoneNumberConfirmed": true
  },
  "error_code": 0,
  "error_message": null,
  "error_descriptions": null
}
```

**SDK Code**

```python Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
import requests

url = "https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange"

payload = { "phoneNumberOtpRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }
headers = {
    "ApiKey": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
const url = 'https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange';
const options = {
  method: 'POST',
  headers: {ApiKey: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"phoneNumberOtpRequestId":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}'
};

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

```go Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
package main

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

func main() {

	url := "https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange"

	payload := strings.NewReader("{\n  \"phoneNumberOtpRequestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}")

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

	req.Header.Add("ApiKey", "<apiKey>")
	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 Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
require 'uri'
require 'net/http'

url = URI("https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange")

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

request = Net::HTTP::Post.new(url)
request["ApiKey"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phoneNumberOtpRequestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}"

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

```java Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange")
  .header("ApiKey", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phoneNumberOtpRequestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}")
  .asString();
```

```php Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange', [
  'body' => '{
  "phoneNumberOtpRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}',
  'headers' => [
    'ApiKey' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
using RestSharp;

var client = new RestClient("https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange");
var request = new RestRequest(Method.POST);
request.AddHeader("ApiKey", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"phoneNumberOtpRequestId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Digital Identity - Account Management_postDigitalIdentityUpdatePhoneCommitPhoneChange_example
import Foundation

let headers = [
  "ApiKey": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["phoneNumberOtpRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vlenseg.com/api/DigitalIdentity/UpdatePhone/CommitPhoneChange")! 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()
```