# API Multi Tenancy Patterns

> Design multi-tenant REST APIs: silo/pool/bridge isolation, tenant routing, verified JWT tenantId, noisy-neighbor limits, and cache key prefixes. Use when building SaaS APIs or reviewing cross-tenant data risks.

- Skill: `deangrant/api-multi-tenancy-patterns` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add deangrant/api-multi-tenancy-patterns`
- Raw SKILL.md: https://api.skillmd.com/api/skills/deangrant/api-multi-tenancy-patterns/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: deangrant (https://skillmd.com/u/deangrant)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/deangrant/api-multi-tenancy-patterns

---


# Multi-Tenancy Patterns

Use this skill when one deployment serves **many tenants**.

---

## 1. Isolation models

| Model | Idea |
| ----- | ---- |
| Silo | Separate infra per tenant |
| Pool | Shared infra; tenant discriminator |
| Bridge | Hybrid (sensitive silo + pooled) |

---

## 2. API rules

- Route/resolve tenant from **verified** token claims — never trust raw
  client-supplied tenant IDs alone.
- Enforce tenant on every query and cache key.
- Per-tenant rate limits; guard noisy neighbors.
- Cross-tenant access = critical security bug (BOLA class).

---

## 3. Quick checklist

- [ ] Isolation model chosen deliberately.
- [ ] Tenant identity verified cryptographically.
- [ ] Data access scoped in all layers.
- [ ] Cache/queue keys prefixed by tenant.
- [ ] Per-tenant quotas.

See [reference.md](reference.md) and [examples.md](examples.md).

