NewWacht Bench is live — AI-assisted development for Wacht

updatePhone()

Updates one phone identifier by id for a specific user.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function updatePhone(userId: string, phoneId: string) {  const client = await wachtClient();  return client.users.updatePhone(userId, phoneId, { verified: true });}

Signature

function updatePhone(  userId: string,  phoneId: string,  request: UpdatePhoneRequest,): Promise<UserPhone>

Parameters

userId: string;
Target user id.
phoneId: string;
Target phone id.
phone_number?: string | undefined;
Updated phone number value.
country_code?: string | undefined;
Updated country code.
verified?: boolean | undefined;
Set phone verification status.
is_primary?: boolean | undefined;
Set as primary phone.

Return value

result?: UserPhone | undefined;
Operation result payload.

Behavior

  • Applies a partial update and returns the server-side updated resource.
  • Treat omitted optional fields as unchanged unless explicitly documented otherwise.

On this page