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;
userId: string;Target user id.
›phoneId: string;
phoneId: string;Target phone id.
›phone_number?: string | undefined;
phone_number?: string | undefined;Updated phone number value.
›country_code?: string | undefined;
country_code?: string | undefined;Updated country code.
›verified?: boolean | undefined;
verified?: boolean | undefined;Set phone verification status.
›is_primary?: boolean | undefined;
is_primary?: boolean | undefined;Set as primary phone.
Return value
›result?: UserPhone | undefined;
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.