Box Developer Documentation
Latest version

Create email alias

post
https://api.box.com/2.0
/users/:user_id/email_aliases

Adds a new email alias to a user account..

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The ID of the user.

Request Body

stringin bodyrequired
"alias@example.com"

The email address to add to the account as an alias.

Note: The domain of the email alias needs to be registered to your enterprise. See the domain verification guide for steps to add a new domain.

Response

application/jsonEmail alias

Returns the newly created email alias object.

application/jsonClient error

An unexpected client error.

post
Create email alias
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X POST "https://api.box.com/2.0/users/12345/email_aliases" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "email": "alias@example.com"
     }'
TypeScript Gen
await client.emailAliases.createUserEmailAlias(newUser.id, {
  email: newAliasEmail,
} satisfies CreateUserEmailAliasRequestBody);
Python Gen
client.email_aliases.create_user_email_alias(new_user.id, new_alias_email)
.NET Gen
await client.EmailAliases.CreateUserEmailAliasAsync(userId: newUser.Id, requestBody: new CreateUserEmailAliasRequestBody(email: newAliasEmail));
Java
BoxUser user = new BoxUser(api, "0");
user.addEmailAlias("user+alias@example.com");
Python
user_id = '33333'
user = client.user(user_id)
email_alias = user.add_email_alias('alias@example.com')
.NET
BoxEmailAlias alias = await client.UsersManager
    .AddEmailAliasAsync(userId: "33333", email: "user+foo@example.com");
Node
client.users.addEmailAlias('33333', 'user+baz@example.com')
    .then(alias => {
        /* alias -> {
            type: 'email_alias',
            id: '12345',
            is_confirmed: false,
            email: 'user+baz@example.com' }
        */
    });
iOS
client.users.createEmailAlias(
    userId: "33333",
    email: "user+alias@example.com"
) { (result: Result<EmailAlias, BoxSDKError>) in
    guard case let .success(alias) = result else {
        print("Error adding email alias")
        return
    }

    print("Added email alias \(alias.email) — user must confirm")
}

Response Example

{
  "id": "11446498",
  "type": "email_alias",
  "email": "alias@example.com",
  "is_confirmed": true
}