# Update company two-factor alias

Source: https://developer.avalara.com/products/returns/integration-guides/managed-returns/asq2206617581230/

Guide: Avalara Managed Returns API (U.S. and Canada)

# Update company two-factor alias

Update the email address that a company two-factor authentication (2FA) alias forwards to by using the `updateCompanyTwoFactorAlias` GraphQL mutation.

The `updateCompanyTwoFactorAlias` mutation updates the email address that the company two-factor authentication 2FA or MFA alias forwards to.

This setting applies at the company level. Each company has exactly 1 alias and 1 forwarding email address. When you change it, the system replaces the forwarding email for the entire company, across every return and tax authority, not only the one you are currently configuring. Confirm that this change is intended before you run the mutation.

Key considerations:

-   **Company-wide impact**: The forwarding email is shared across all returns and tax authorities configured for the company.

-   **Validation handling**: If the change is rejected, for example, because the email format is invalid, the call still returns normally with `success: false` and the reason in the `message` field. Check the `success` field instead of relying only on the absence of GraphQL errors.

## View request

```
mutation UpdateCompanyTwoFactorAlias($input: UpdateCompanyTwoFactorAliasInput!) {
  updateCompanyTwoFactorAlias(input: $input) {
    success
    message
    alias {
      aliasId
      alias
      email
      externalId
      sources {
        id
        name
      }
    }
  }
}
```

**Input variables**:

```
{
  "input": {
    "companyId": "1234567",
    "email": "customer@example.com"
  }
}
```

Table 1. Input variable details

Argument

Type

Description

`companyId`

`ID!`

The unique identifier of the company whose alias you want to change.

`email`

`String!`

The email address that the alias forwards 2FA emails to.

## View response

```
{
  "data": {
    "updateCompanyTwoFactorAlias": {
      "success": true,
      "message": null,
      "alias": {
        "aliasId": "5501",
        "alias": "k3m9x2@2fa.example.com",
        "email": "customer@example.com",
        "externalId": "1234567",
        "sources": [
          {
            "id": "3",
            "name": "Returns"
          }
        ]
      }
    }
  }
}
```

**Response field descriptions**:

Response field

Description

`success`

Indicates whether the alias was updated.

`message`

Describes the result, if a message is returned.

`alias`

The alias after the update. For field details, see the `alias` field of `companies(twoFactorSettings)`.

## Next step

To view incoming security codes sent by tax authorities, see Query received two-factor security codes. To submit authority credentials, see [Grant authority access and trigger extraction](/managed-returns/skf6239163889825/ "Submit portal credentials for a tax authority, validate credentials and 2-factor authentication, and start background return extraction by using the grantAuthorityAccess GraphQL mutation.").