Skip to content

Tenant Context

Work within a specific tenant’s scope for focused operations.

Tenant context is your current working tenant. When set, list views filter to that tenant automatically:

The tenant switcher is available to global administrators only. Regular tenant users are always scoped to their own tenant and do not see switching controls.

BenefitDescription
FocusSee only relevant data
SafetyReduce accidental cross-tenant operations
EfficiencyLess filtering needed
ClarityAlways know which tenant you’re working in

Lens displays the current tenant context in the header. A Context: <name> label appears below the tenant switcher button whenever a tenant is active:

┌─────────────────────────────────────────────────────────────┐
│ ┌──────────────────────────────────────────────────────┐ │
│ │ MANTIS [Acme Corp ▼] │ │
│ │ Context: Acme │ │
│ │ │ │
│ │ Dashboard │ │
│ │ Deployments │ │
│ │ Solutions │ │
│ │ Targets │ │
│ │ Environments │ │
│ │ Tenants ← │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ Tenant context active. Data filtered to Acme Corp. │
│ │
└─────────────────────────────────────────────────────────────┘

When no tenant is active the button shows All Tenants and no Context: label appears.

  1. Click the tenant selector button in the header
  2. Choose your tenant — the dropdown shows ★ Favorites first, then Recent (last 5), then the full list
  3. The view updates immediately to show only that tenant’s data
┌─────────────────────────────────────────────────────────────┐
│ Select Tenant │
├─────────────────────────────────────────────────────────────┤
│ │
│ Search: [________________________] │
│ │
│ ★ Favorites │
│ ● Acme Corp (current) ★ │
│ ───────────────────────────────────────────────────────── │
│ Recent │
│ ○ Beta Inc │
│ ───────────────────────────────────────────────────────── │
│ ○ Gamma LLC │
│ ○ Delta Co │
│ ───────────────────────────────────────────────────────── │
│ ○ All Tenants (no filter) │
│ │
└─────────────────────────────────────────────────────────────┘
  1. Navigate to Tenants
  2. Click Set as context on any tenant row — or open the tenant detail page and use the Set as context button there
  3. When that tenant is already active, the button shows Active context ✓ with a Clear button to remove the context

Press Ctrl+K (Windows/Linux) or Cmd+K (macOS) to open the tenant command palette. Type to filter, use / to navigate, Enter to select, and Esc to close.

Tenant context is a Lens UI feature; there is no mantisctl context command. When using the CLI or REST API, scope each operation to a tenant explicitly — for example, pass --tenant-id <id> to mantisctl deployment commands, or include a tenant_id in API request bodies and query parameters.

When context is set, list views automatically pass the active tenant’s ID to the API, so only that tenant’s resources appear.

┌─────────────────────────────────────────────────────────────┐
│ Targets - Acme Corp │
├─────────────────────────────────────────────────────────────┤
│ │
│ Showing targets assigned to Acme Corp │
│ │
│ ┌────────────────┬──────────┬────────────────────────────┐│
│ │ Name │ Status │ Environment ││
│ ├────────────────┼──────────┼────────────────────────────┤│
│ │ acme-web-01 │ ● Online │ Production ││
│ │ acme-web-02 │ ● Online │ Production ││
│ │ acme-api-01 │ ● Online │ Staging ││
│ │ acme-db-01 │ ● Online │ Production ││
│ └────────────────┴──────────┴────────────────────────────┘│
│ │
└─────────────────────────────────────────────────────────────┘

Only deployments for the current tenant are shown:

┌─────────────────────────────────────────────────────────────┐
│ Deployments - Acme Corp │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────┬─────────┬────────────┬──────────┬────────┐ │
│ │ Solution │ Version │ Environment│ Status │ Time │ │
│ ├────────────┼─────────┼────────────┼──────────┼────────┤ │
│ │ portal │ 1.4.0 │ Production │ ✓ Done │ 10m │ │
│ │ auth │ 2.1.0 │ Staging │ ✓ Done │ 1h │ │
│ │ portal │ 1.3.0 │ Staging │ ✓ Done │ 2d │ │
│ └────────────┴─────────┴────────────┴──────────┴────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

When creating a new deployment, the tenant field is pre-filled from the active context:

┌─────────────────────────────────────────────────────────────┐
│ New Deployment │
├─────────────────────────────────────────────────────────────┤
│ │
│ Tenant: [Acme Corp ▼] (from context) │
│ Solution: [Select solution... ▼] │
│ Version: [Select version... ▼] │
│ Environment: [Select environment ▼] │
│ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ Tenant pre-selected from current context. │ │
│ │ Change if deploying to a different tenant. │ │
│ └───────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

Select All Tenants (no filter) to remove the tenant context and see resources across all tenants. For single-tenant resource lists — solutions, sequences, actions, deployments, and environments — a Tenant column appears naming each row’s owning tenant (“Global” if the resource is not scoped to a specific tenant).

┌─────────────────────────────────────────────────────────────┐
│ Deployments - All Tenants │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────┬─────────┬────────────────┬──────────────┐ │
│ │ Solution │ Version │ Tenant │ Status │ │
│ ├────────────┼─────────┼────────────────┼──────────────┤ │
│ │ portal │ 1.4.0 │ Acme Corp │ ✓ Done │ │
│ │ auth │ 2.1.0 │ Beta Inc │ ✓ Done │ │
│ │ worker │ 3.0.0 │ Gamma LLC │ ⟳ Running │ │
│ │ base-cfg │ 1.0.0 │ Global │ ✓ Done │ │
│ └────────────┴─────────┴────────────────┴──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

The Tenant column is present in the All Tenants view for solutions, sequences, actions, deployments, and environments. Targets and storage do not yet show this column.

The active tenant is stored in a session cookie (mantis_active_tenant):

ActionContext Effect
Page refreshRetained
Navigate awayRetained
New tabInherited
Browser closeCleared

Favorites and Recents are stored in localStorage (per-user, per-browser) and survive browser restarts.

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

https://lens.example.com/deployments?tenant=01890a5d-ac96-774b-b001-2f08e3f1c4d2

This is useful for sharing a tenant-filtered view without changing the recipient’s persistent context.

When working on one tenant:

  1. Set context at start of session
  2. Complete all tenant-related tasks
  3. Clear or switch context when done

For administrative tasks:

  • Reviewing overall health
  • Comparing versions across tenants
  • Bulk operations

Before deployments or changes:

┌─────────────────────────────────────────────────────────────┐
│ Confirm Deployment │
├─────────────────────────────────────────────────────────────┤
│ │
│ ⚠ Please verify: │
│ │
│ Tenant: Acme Corp │
│ Solution: customer-portal │
│ Version: 1.4.0 │
│ Environment: Production │
│ │
│ This will deploy to 8 targets. │
│ │
│ [Cancel] [Deploy] │
│ │
└─────────────────────────────────────────────────────────────┘

Cause: Tenant has no assigned targets

Solution: Assign targets to the tenant or clear context

Cause: Context filtering hides other tenants’ data

Solution: Clear context or select All Tenants

Cause: Session cookie cleared (browser closed or cookies purged)

Solution: Re-authenticate and set context again