Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

getPhoneNumber()

Retrieves a single PhoneNumber by its ID, if the ID is valid.

function getPhoneNumber: (phoneNumberId: string) => Promise<PhoneNumber>;

getPhoneNumber() parameters

NameTypeDescription
phoneNumberIdstringThe ID of the phone number to retrieve.

getPhoneNumber() example

const phoneNumberId = 'idn_2bxwW8Fa5Y53QcESgQ6HkTo0cgh'; const response = await clerkClient.phoneNumbers.getPhoneNumber(phoneNumberId); console.log(response); /* _PhoneNumber { id: 'idn_2bxwW8Fa5Y53QcESgQ6HkTo0cgh', phoneNumber: '15551234567', reservedForSecondFactor: false, defaultSecondFactor: false, verification: _Verification { status: 'verified', strategy: 'admin', externalVerificationRedirectURL: null, attempts: null, expireAt: null, nonce: null }, linkedTo: [] } */

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint GET/phone_numbers/{phone_number_id}. See the BAPI reference(opens in a new tab) for more details.

What did you think of this content?

Clerk © 2024