# Add your whole team: import and SCIM

> Add every human on your domain at once from a CSV, Excel or JSON file, or keep them in step with Okta, Microsoft Entra ID or Google Workspace by SCIM.

Source: https://trotta.email/docs/directory

When your domain's mail comes to Trotta Mail, every human needs a mailbox before the switch. Add them all from one file, or let your identity provider keep the list in step.

## Before you start

- Verify your domain under [Domains](https://trotta.email/console/domains). Addresses are added on domains you verified, and a subdomain only when you verified that subdomain too.
- The owner or an admin adds from a file, on any paid plan. Directory sync is part of Enterprise.
- Only the owner adds admins. Nobody is made owner from a file or a directory.

## From a file

1. On [Team](https://trotta.email/console/team), choose Add many.
2. Choose a CSV, Excel (.xlsx) or JSON file with one human per row. Start from the template if you like.
3. Read the counts: who is added, who is updated, who is skipped and why. Nothing has changed yet.
4. Confirm. A long list keeps going if you close the window.

| Column | What it holds |
| --- | --- |
| email | The address. Also read from address, email address or user principal name. |
| name | Their name. Or first name and last name. |
| role | member or admin. Empty means member. |
| mailbox_only | yes for an address nobody holds yet: a shared address, or someone who has not started. |

Exports from Google Workspace and Microsoft Entra ID read as they come. The first sheet of a workbook is read. Formulas are never run: a row with one is skipped, so type the value instead. Up to 10,000 rows and 5 MB a file.

### What each row does

- A new address gets its mailbox at once, and its human gets an invitation link, the same one Invite a human makes.
- On a domain where single sign-on is set up and tested, they are members at once and simply sign in with it.
- An address already in your organization is updated or left alone, and the row says which.
- Skipped, with the reason: a domain you have not verified, a reserved name such as `postmaster`, another organization's address, an agent inbox, or a repeat of an earlier row.

No password ever comes from a file. Invitations are not emailed: download the links when the import is done and send them yourself. Each works once, for seven days. Importing the same file again adds nobody twice and gives anyone whose link ran out a fresh one.

### Seats

A list bigger than your plan's seats is refused whole, with the numbers, before anything is added. Or choose to add as many as fit: rows are added in file order until the plan is full. Enterprise has no seat limit. Every import is written to the audit trail, with one entry for each human added.

## Directory sync

Your identity provider adds, updates and deactivates your humans here, by SCIM 2.0. A hire gets a mailbox. A new name follows. A leaver is deactivated.

1. Set up an authenticator app on the owner's account under [Security](https://trotta.email/console/security).
2. In [Directory sync](https://trotta.email/console/directory), copy the SCIM URL and make a token. The token is shown once.
3. Paste both into your identity provider, as below, and assign the app to your team.

- The address (userName) is the mailbox. It never changes; a new address is a new user.
- Deactivated, a human is taken out exactly as Remove on the Team page does: they are signed out everywhere, their keys and connected apps stop, and their mailbox is kept, with its mail, belonging to no one.
- Active again, the same mailbox is theirs again, with a fresh invitation or a single sign-on account.
- Groups are not used. The directory adds members; the owner makes admins on the Team page. The owner is never deactivated from the directory.
- While sync is on, the directory decides. Someone you remove on the Team page comes back the next time the directory says they are active.

### Okta

- Open the app you made for single sign-on. On the General tab, under App Settings, turn on SCIM provisioning.
- On the Provisioning tab, under Integration, paste the SCIM URL into SCIM connector base URL. Set Unique identifier field for users to `userName`. Choose Push New Users and Push Profile Updates. Set Authentication Mode to HTTP Header and paste the token.
- Choose Test Connector Configuration, then save.
- Under To App, turn on Create Users, Update User Attributes and Deactivate Users. Leave group push off.
- Okta deactivates, and never deletes. Its password field is ignored.

### Microsoft Entra ID

- Open the enterprise app you made for single sign-on and choose Provisioning. Set Provisioning Mode to Automatic.
- Paste the SCIM URL into Tenant URL and the token into Secret Token. Choose Test Connection. A test asks for a user that does not exist; that is expected.
- Under Mappings, turn off provisioning of groups. Map userName to the attribute that holds the work address, usually `userPrincipalName` or `mail`.
- Set the scope to assigned users, assign your team, and start provisioning.
- Entra ID deactivates a human who is unassigned, disabled or deleted, and removes them 30 days after a deletion. Both are handled.

### Google Workspace

- Google calls this automated user provisioning with custom SCIM profiles. For an app outside its catalog it is a beta, open to a limited number of Google Workspace customers.
- If your Admin console has it, open your Trotta Mail SAML app and set up Autoprovisioning: paste the SCIM URL as the endpoint and the token as the access token.
- If it does not, export your users from the Admin console under Directory, then Users, and add them from the file. Run it again whenever your team changes.

## When something is not added

| What it says | What to do |
| --- | --- |
| This domain is not a verified domain | Verify it under Domains, or its subdomain if the address is on one. |
| This name is reserved | Use another address. Role names like postmaster and abuse belong to the mail system. |
| This address belongs to another organization | It cannot be moved here. Ask its owner to remove it. |
| Only the owner adds admins | Have the owner run the import, or import them as members. |
| Not added: the plan has no room | Add seats under Plan and usage, then import the same file again. |

The routes are in the [API reference](https://trotta.email/docs/api). Your identity provider's own log shows each change it sent, and the audit trail here shows what was done with it.
