Add another email address to a user's account
Account profile management
Clerk · Module
Creates an email address for a specified Clerk user and returns the resulting EmailAddress object. Optional flags can make it primary or mark it verified.
Call the backend email-address method with the target user's ID and the address to create. Optional flags control whether the new address is primary and whether Clerk marks it verified; the promise resolves to the created EmailAddress resource.
function createEmailAddress(params: CreateEmailAddressParams): Promise<EmailAddress>| Name | Type | Description |
|---|---|---|
emailAddress | string | The email address to create. |
primary? | boolean | Whether the email address should be the primary email address. Defaults to false unless it is the first email address added to the user. |
userId | string | The ID of the user to create the email address for. |
verified? | boolean | Whether the email address should be verified. Defaults to false. |
Promise<EmailAddress>
const response = await clerkClient.emailAddresses.createEmailAddress({
userId: "user_123",
emailAddress: "testclerk123@gmail.com",
primary: true,
verified: true,
});Creates an email address for the specified user and returns the resulting EmailAddress object.
Account profile management
Identity administration
Trusted server-side provisioning
It creates an email address for a specified user and returns the created EmailAddress object. The required inputs are userId and emailAddress.
Follow-up: What does primary control? It controls whether Clerk designates the new address as the user's primary address; it defaults to false except for the first address.
The method accepts emailAddress, userId, and optional primary and verified flags. primary defaults to false unless this is the first address, while verified defaults to false.
Follow-up: How would you avoid incorrectly trusting an address? Leave verified false unless an authoritative workflow has already verified the address.
The call returns a Promise that resolves to an EmailAddress object. The created address is associated with the user identified by userId.
Follow-up: What lower-level operation does the SDK wrap? It wraps the BAPI POST /email_addresses endpoint.
EmailAddressclerkClientCreateEmailAddressParamsuserIdemailAddress