# run-a-multi-tenant-crud-api

Run a multi-tenant JSON CRUD API (create, list, get, CSV export) where tenant isolation is enforced server-side

- **Space:** admin-panels-and-internal-tools-public (https://github.com/Tech-Realm/space-admin-panels-and-internal-tools-public/tree/main/run-a-multi-tenant-crud-api)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** stdlib-http; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use admin-panels-and-internal-tools-public/run-a-multi-tenant-crud-api` or MCP `get_pack admin-panels-and-internal-tools-public/run-a-multi-tenant-crud-api`
- **Files:** CHANGELOG.md, code/admin.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/users.json, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

Run a multi-tenant JSON CRUD API (create, list, get, CSV export) where tenant isolation is enforced server-side

## Goal
Each tenant creates records, sees them in a list and exports them, and can never see another tenant's rows.

## Steps
1. Seed users with tenant + role (`admin.py seed users.json`).
2. `admin.py serve --port 8765` (localhost).
3. POST /api/<resource> to create, GET /api/<resource> to list, GET /api/<resource>.csv to export (admin).

## Edge cases
- Client-sent tenant_id is ignored by design.
- Unknown user -> 401; wrong role -> 403 (logged).

## Don'ts
- Don't expose it beyond localhost without SSO in front (see add-sso-with-keycloak).



---

Canonical URL: https://logicpacks.io/packs/admin-panels-and-internal-tools-public/run-a-multi-tenant-crud-api

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
