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

deletePhoneNumber()

Deletes a PhoneNumber for a given ID.

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

deletePhoneNumber() parameters

NameTypeDescription
phoneNumberIdstringThe ID of the phone number to delete.

deletePhoneNumber() example

const phoneNumberId = 'idn_2bxwW8Fa5Y53QcESgQ6HkTo0cgh'; const response = await clerkClient.phoneNumbers.deletePhoneNumber(phoneNumberId); console.log(response); /* _DeletedObject { object: 'phone_number', id: 'idn_2bxwW8Fa5Y53QcESgQ6HkTo0cgh', slug: null, deleted: true } */

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint DELETE/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