Skip to content

Switching Tenants

Navigate between tenants efficiently in Lens.

The fastest way to switch tenants:

┌─────────────────────────────────────────────────────────────┐
│ ┌──────────────────────────────────────────────────────┐ │
│ │ MANTIS [Acme Corp ▼] │ │
│ │ Context: Acme │ │
│ │ ─────────────────│ │
│ │ │ Search… │ │ │
│ │ │ ──────────── │ │ │
│ │ │ ★ Favorites │ │ │
│ │ │ Acme Corp ★ │ │ │
│ │ │ ──────────── │ │ │
│ │ │ Recent │ │ │
│ │ │ Beta Inc │ │ │
│ │ │ ──────────── │ │ │
│ │ │ Gamma LLC │ │ │
│ │ │ Delta Co │ │ │
│ │ │ ──────────── │ │ │
│ │ │ All Tenants │ │ │
│ │ └──────────────┘ │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
  1. Click the tenant name in the header
  2. Search or scroll to find the tenant — the dropdown shows Favorites first, then Recent (last 5), then the full list
  3. Click the tenant name to switch; click ★/☆ on a row to pin or unpin it as a favorite
  4. A Context: <name> indicator appears below the button confirming the active tenant
ShortcutAction
Ctrl+K / Cmd+KOpen quick switcher
Type tenant nameFilter list
/ Move selection
EnterSelect tenant
EscCancel

The quick-switcher opens a centered command palette with the same Favorites → Recent → full list ordering as the header dropdown.

  1. Go to Tenants in sidebar
  2. Find the tenant row and click Set as context — or click through to the tenant detail page and use the Set as context button there
  3. When a tenant is the active context its button changes to Active context ✓ with a Clear button beside it
┌─────────────────────────────────────────────────────────────┐
│ Tenants │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────┬──────────────┬───────────────────────┐ │
│ │ Name │ Description │ Actions │ │
│ ├───────────────┼──────────────┼───────────────────────┤ │
│ │ Acme Corp │ Enterprise │ [Active context ✓][Clear] │
│ │ Beta Inc │ SMB customer │ [Set as context] │ │
│ │ Gamma LLC │ Startup │ [Set as context] │ │
│ └───────────────┴──────────────┴───────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

To see data across all tenants, select All Tenants (no filter) at the bottom of the header dropdown or command palette. This clears the active tenant context.

┌─────────────────────────────────────────────────────────────┐
│ Tenant Selector │
├─────────────────────────────────────────────────────────────┤
│ │
│ ● Acme Corp (current) │
│ ○ Beta Inc │
│ ○ Gamma LLC │
│ ───────────────────────────────────────────────────────── │
│ ○ All Tenants (no filter) │
│ │
└─────────────────────────────────────────────────────────────┘

The active tenant context is a Lens UI concept selected from the tenant switcher; it is not a mantisctl command. CLI and API calls scope to a tenant per command via the tenant ID (see CLI Tenant Selection below).

Lens remembers the last 5 tenants you switched to. They appear in the Recent section of the dropdown and command palette whenever you have no search query active. Recent history is stored per-user in localStorage and survives browser restarts.

┌─────────────────────────────────────────────────────────────┐
│ Switch Tenant │
├─────────────────────────────────────────────────────────────┤
│ │
│ Recent: │
│ ○ Acme Corp (current) │
│ ○ Beta Inc │
│ ○ Gamma LLC │
│ │
│ ───────────────────────────────────────────────────────── │
│ │
│ All Tenants: │
│ ○ Alpha Co │
│ ○ Delta Inc │
│ ○ Epsilon Ltd │
│ ... │
│ │
└─────────────────────────────────────────────────────────────┘

Pin frequently used tenants so they always appear at the top of the list:

┌─────────────────────────────────────────────────────────────┐
│ Tenant Selector │
├─────────────────────────────────────────────────────────────┤
│ │
│ ★ Favorites: │
│ ○ Acme Corp ★ │
│ ○ Beta Inc ★ │
│ │
│ Recent: │
│ ○ Gamma LLC │
│ │
│ All: │
│ ○ Delta Co │
│ ... │
│ │
└─────────────────────────────────────────────────────────────┘

To favorite a tenant, click the ★/☆ icon on any tenant row in the dropdown or command palette. Clicking again removes the pin. Favorites are stored per-user in localStorage and survive browser restarts.

A ?tenant=<id> query parameter scopes a single view to that tenant without writing the session cookie. The context reverts to the persisted cookie value as soon as you navigate to a URL that omits the parameter.

# Deployments scoped to a specific tenant for this view only
https://lens.example.com/deployments?tenant=01890a5d-ac96-774b-b001-3a17f4029de3
# Targets scoped to a specific tenant for this view only
https://lens.example.com/targets?tenant=01890a5d-ac96-774b-b001-4b28051340fc

These links are useful for sharing a specific filtered view with another admin. The recipient’s persistent tenant context (session cookie) is not changed.

Save URLs with tenant context:

Bookmarks:
├── Beta Deployments → lens.example.com/deployments?tenant=01890a5d-ac96-774b-b001-3a17f4029de3
└── All Targets → lens.example.com/targets

Tenant-aware commands take a numeric --tenant-id. There is no session-context or target list subcommand in mantisctl; use the flags per command.

Terminal window
# Deploy to a specific tenant
mantisctl deployment create --solution-id customer-portal \
--tenant-id 42 \
--environment-id Production
# List deployments (optionally filter by tenant ID)
mantisctl deployment list --tenant-id 43
# Show a deployment's status
mantisctl deployment show abc123

The tenant switcher — header dropdown, command palette (Ctrl+K/Cmd+K), and Set as context buttons — is only visible to global administrators. Regular tenant users are always scoped to their own tenant and never see these controls.

For frequent switching:

  • Ctrl+K / Cmd+K → Quick switch
  • Type first few letters → Filter
  • Enter → Select

Pin your primary tenants for quick access.

When you need to look at a specific tenant’s data without changing your active context, use a ?tenant=<id> URL. Navigate away and your context is unchanged.

Always confirm the active tenant before actions:

  • Check the header shows the correct tenant name
  • Confirm the Context: <name> indicator below the button
  • Double-check before triggering deployments

Cause: Tenant doesn’t exist or hasn’t been created yet

Solution:

  1. Verify tenant name spelling
  2. Ensure the tenant hasn’t been deleted
  3. Check with your administrator

Cause: Session cookie blocked or browser set to clear cookies on close

Solution:

  1. Check that cookies are enabled for the Lens domain
  2. Re-authenticate if your session expired
  3. Use ?tenant=<id> URL parameters for a view-scoped workaround

Cause: Stale cache or context not updated

Solution:

  1. Refresh the page
  2. Clear context (select All Tenants) and re-select
  3. Check the URL for a ?tenant= parameter that may be overriding the cookie