> ## Documentation Index
> Fetch the complete documentation index at: https://docs.regentra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Companies & Contacts

> Organize MSP customers and the people inside them; import from Microsoft 365; track tickets and assets per company.

Companies are your MSP customers. Contacts are the individuals inside those companies. Together, they're the foundation of every [Ticket](/psa/tickets), [Asset](/psa/assets), [Invoice](/psa/invoices-quotes), and portal interaction in the PSA.

## What it does

* **Company management** — Create customers manually or bulk-import from Microsoft 365 tenants
* **Contact management** — Add portal contacts per company; send invites and password resets
* **Automatic syncing** — [Microsoft Entra ID](/integrations/microsoft-entra) integration pulls users and devices in the background
* **Portal access** — Contacts can submit and track tickets via the [Portal](/psa/portal)
* **Relationship tracking** — Ticket and asset counts per company and contact, surfaced inline

## How to add a company

<Steps>
  <Step title="Open the Companies page">
    In the PSA module sidebar, click **Companies**.
  </Step>

  <Step title="Click Add Company">
    Enter the company name, phone, address, and website. Click **Create**.
  </Step>

  <Step title="(Optional) Import from Microsoft 365">
    Click **Import from Microsoft 365**. Provide the company name and tenant details. You'll be redirected to grant admin consent; sign in as a Microsoft 365 admin. Users and devices sync automatically in the background.
  </Step>
</Steps>

<Tip>
  After a company is created, the detail page has a **Sync With M365** button that re-runs the per-company Entra sync on demand. Use it to pull a fresh snapshot of users + devices for that one customer without waiting for the next scheduled cycle. See [Microsoft Entra ID](/integrations/microsoft-entra#per-company-sync).
</Tip>

## Archiving and deleting companies

Removing a customer is a **two-stage process** designed to make accidental data loss nearly impossible. Stage 1 (Archive) is reversible; Stage 2 (Permanent delete) is irreversible and intentionally gated.

### Stage 1 — Archive (reversible)

Archiving hides a company from operational views while preserving every record tied to it. Tickets, assets, invoices, contacts, password-vault entries, and history all stay in the database. The QuickBooks Customer is flipped to `Active=false` (recoverable on restore).

<Steps>
  <Step title="Open the company detail page">
    In the PSA sidebar, click **Companies** and select the company you want to archive.
  </Step>

  <Step title="Scroll to the Danger zone and click Archive company">
    Provide an optional reason (captured in the audit log and visible in the Archive view).
  </Step>

  <Step title="Confirm">
    The company is hidden from the default list, search results, integration sync candidates, and every picker dropdown (new ticket / invoice / project / password / contact). It returns to view under **Show archived** at the top of the Companies list.
  </Step>
</Steps>

While archived, the company is blocked from receiving new resources:

* New tickets, invoices, projects, contacts, SLA policies, password entries / folders, notification subscriptions, asset reassignments
* QuickBooks Customer sync (re-sync would reactivate the QB row)
* Microsoft 365 / Entra sync
* Promotion to a Compliance tenant
* Customer portal login (both password and SSO paths return "Portal access is paused")

**Restore** is symmetric: from the Archive view, click **Restore** on any archived row to clear the archive state and reactivate the QB Customer link.

<Note>
  Archive requires Admin, MSP Admin, or Compliance Admin. The action is idempotent — clicking Archive on an already-archived company is a no-op.
</Note>

### Stage 2 — Permanent delete (irreversible)

Permanent deletion physically removes the company row and most of its dependencies. Only **Super Admin** can perform this action, and only on a company that has already been archived.

Before permanent delete is allowed, the system **blocks** the action when any of these are true:

* The company is not yet archived (Stage 1 must complete first)
* One or more invoices for this company still have an outstanding balance
* The company has been promoted to a Compliance tenant (the linked Organization must be archived first to preserve the promotion audit trail)

The confirmation modal shows the full impact:

* **Records that will become unassigned** (kept in the DB but lose their company link): tickets, assets, contacts, invoices, KB articles, KB folders, quotes, projects, password folders, password entries
* **Records that will be permanently deleted** (cascade): per-customer SLA policies
* **QuickBooks Customer** is set to `Active=false` (best-effort soft-delete)

To complete the deletion, the Super Admin must **type the exact company name** into the confirmation field — the Submit button stays disabled until the typed value matches the row's `name` exactly (case-sensitive). The server re-validates the match inside the same transaction as the delete, so there is no race window.

<Warning>
  Permanent delete cannot be undone. Neon database snapshots provide a \~24-hour recovery window for catastrophic mistakes; after that, the row is gone. Use Archive for any case where there is even a 1% chance you might want the customer back.
</Warning>

If you have hundreds of stale customers to clear, archive them first. The Archive view supports per-row restore and per-row permanent delete; there is no batch permanent-delete by design.

## How to manage contacts

<Steps>
  <Step title="Open the Contacts page">
    In the PSA module sidebar, click **Contacts**.
  </Step>

  <Step title="Add a new contact">
    Click **Add Contact**. Enter name, email, phone (optional), and assign a company. Optionally send a welcome email with a portal setup link.
  </Step>

  <Step title="Bulk import contacts">
    Click **Template** to download a CSV; fill in name, email, phone, and company. Click **Import CSV** and upload. Duplicates are skipped; errors are reported per row.
  </Step>

  <Step title="Send invite or reset password">
    For each contact, **Send Invite** (if pending setup) sends the welcome email. **Reset Password** (if active) sends a password-reset link.
  </Step>
</Steps>

## Organization & relationships

Companies appear as collapsible groups on the Contacts list. Contacts without a company are shown in a separate "No Company Assigned" section. Each contact shows:

* **Status badges** — Active or Inactive
* **Pending Setup flag** — shown if invited but hasn't set a password
* **Ticket & asset counts** — how many tickets and assets are linked
* **Company link** — click to view all contacts in that company

When a contact is inactive, **Send Invite** and **Reset Password** are hidden. Companies show total contacts, tickets, and asset counts on the main Companies page.

## Microsoft 365 integration

The **Import from Microsoft 365** flow requires admin consent. Once granted:

* All users in the tenant are synced as contacts
* Devices (computers, mobile) are synced as [Assets](/psa/assets)
* Syncs run in the background; new users and devices appear automatically
* One sync per import request; not a live monitor

See [Microsoft Entra ID](/integrations/microsoft-entra) for full integration details.

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Can I assign multiple companies to one contact?">
    No. Each contact belongs to zero or one company. If a person works across multiple clients, create separate contact records for each.
  </Accordion>

  <Accordion title="What happens when I import from Microsoft 365?">
    The system fetches all users and devices from the tenant and creates or updates contacts and assets. Existing contacts are not modified unless their Microsoft 365 record changed.
  </Accordion>

  <Accordion title="Can I revoke portal access for a contact?">
    Yes. Toggle the contact to Inactive. They lose portal access immediately, but their historical data remains.
  </Accordion>

  <Accordion title="How do I bulk-delete contacts?">
    Currently one at a time via the detail page. If you need bulk operations, contact support.
  </Accordion>

  <Accordion title="How do I delete a company?">
    See [Archiving and deleting companies](#archiving-and-deleting-companies) above. Archive (reversible) is the right action 99% of the time. Permanent delete is Super Admin only and requires the company to be archived first.
  </Accordion>

  <Accordion title="What happens to existing tickets and invoices when I archive a company?">
    Nothing — they're preserved exactly as-is. The company is just hidden from operational views (pickers, search, dashboards). Restoring the company brings everything back unchanged.
  </Accordion>
</AccordionGroup>
