Skip to main content

updateEmailAddress()

Updates the given email address.

Returns the updated EmailAddress object.

function updateEmailAddress(emailAddressId: string, params: { primary?: boolean; verified?: boolean }): Promise<EmailAddress>
  • Name
    emailAddressId
    Type
    string
    Description

    The ID of the email address to update.

  • Name
    params
    Type
    { primary?: boolean; verified?: boolean; }
    Description

    The parameters to update the email address.

  • Name
    params.primary?
    Type
    boolean
    Description

    Whether the email address should be the primary email address. Defaults to false, unless it is the first email address added to the user.

  • Name
    params.verified?
    Type
    boolean
    Description

    Whether the email address should be verified. Defaults to false.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const emailAddressId = 'idn_123'

const params = { verified: false }

const response = await clerkClient.emailAddresses.updateEmailAddress(emailAddressId, params)

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint PATCH/email_addresses/{email_address_id}. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on