# Invite people

_For tartan 0.9.36._

An invite is a one-time link to a role in your organization.

An invite is a one-time link to a role in your organization. The person joins with it and makes their own passkey.

You need the Admin role to invite an Admin, Tech or Viewer. Only an Owner invites an Owner.

## The roles

| Role | Does |
|---|---|
| Owner | Everything, and the organization's keys |
| Admin | People, firewall, sites, sharing |
| Tech | Devices, rules, names, tech access |
| Viewer | Reads |

## 1. Make the invite

In the console, open **People** and choose **Invite a person**. Pick the **Role**, and optionally a **Name** (locked
once set). For **Identifier**, choose **From their sign-in** or **A handle you choose**. In an organization with SSO,
enter their **Work sign-in** instead (their Microsoft sign-in name). Leave **Approve their computer when they join** on
to approve the computer they join from, then choose **Create invite**.

With the CLI:

```sh
tartan user invite --org acme --role tech --name "<their name>" --handle <their handle>
```

- `--approve_device` approves the computer they join from, so no second approval is needed. It is on by default
  for a Tech or Viewer, and with `--upn` in an organization with SSO; off for an Admin without SSO; never for an Owner.
- In an organization with SSO, give `--upn <name@domain>` (their work sign-in name): their SSO sign-in must match it to
  join.
- Your passkey approves this one invite.

## 2. Hand over the link

The answer holds the invite code and a join link, shown once. The console shows it as **The invite**, with the
command to run. Give it only to that person, privately.

An invite that approves the computer lasts 48 hours, or 7 days when it names their work sign-in. Any other invite
lasts 7 days. The console says how long it is good for.

## 3. They join

The person [installs the `tartan` CLI](install-cli.md) and runs:

```sh
tartan join "<the link>"
```

`join` shows the control (Tartan's control plane), the organization and the sign-in the link names, and asks before anything is sent. With SSO,
they sign in with Microsoft in the browser. Then one passkey prompt creates their passkey.

## A lost or stray link

In the console, **People** has a **Pending invites** tab: **Revoke** ends an invite, **New link** replaces it.

```sh
tartan user invite list --org acme
tartan user invite renew --org acme --id <invite id>
tartan user invite revoke --org acme --id <invite id>
```

`invite list` shows open invites by id, never the code or link. `renew` kills the old link and shows a new one
once. `renew` and `revoke` each ask for your passkey. `revoke` stops the code and link at once. Several revokes share one passkey prompt
in one batch: put one `user invite revoke --id <invite id>` per line in a file, then run
`tartan batch run --file <file>`.

## Someone leaves

```sh
tartan user remove --org acme --user <user id>
```

It removes the person from every organization you administer in this session: their roles, their admin and tech devices,
and their credentials when no role is left. In the console, pick the person on **People** and choose **Remove from
every org you administer**.

## Check it worked

```sh
tartan user join list --org acme
tartan people list --org acme
```

`join list` shows who joined, from which computer, and that computer's state now. `people list` shows names and
roles. If the invite didn't approve their computer, approve it: [Admins and passkeys](admins-passkeys.md).

## Next

- [Admins and passkeys](admins-passkeys.md)
- [SSO with Entra](sso-entra.md)
- [The audit log](audit-log.md)
