Skip to content

Packs / admin-panels-and-internal-tools-public

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

Install

logicpacks pack use admin-panels-and-internal-tools-public/run-a-multi-tenant-crud-api
get_pack admin-panels-and-internal-tools-public/run-a-multi-tenant-crud-api

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: stdlib-http
  • Checks: 1 in outcome/checks.yaml
  • Code: admin.py
  • Tools: python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from 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/ to create, GET /api/ to list, GET /api/.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).