box-node-sdk

EmailAliasesManager

List user’s email aliases

Retrieves all email aliases for a user. The collection does not include the primary login for the user.

This operation is performed by calling function getUserEmailAliases.

See the endpoint docs at API Reference.

await client.emailAliases.getUserEmailAliases(newUser.id);

Arguments

Returns

This function returns a value of type EmailAliases.

Returns a collection of email aliases.

Create email alias

Adds a new email alias to a user account..

This operation is performed by calling function createUserEmailAlias.

See the endpoint docs at API Reference.

await client.emailAliases.createUserEmailAlias(newUser.id, {
  email: newAliasEmail,
} satisfies CreateUserEmailAliasRequestBody);

Arguments

Returns

This function returns a value of type EmailAlias.

Returns the newly created email alias object.

Remove email alias

Removes an email alias from a user.

This operation is performed by calling function deleteUserEmailAliasById.

See the endpoint docs at API Reference.

await client.emailAliases.deleteUserEmailAliasById(newUser.id, newAlias.id!);

Arguments

Returns

This function returns a value of type undefined.

Removes the alias and returns an empty response.