#62 API: Create Tenant
Description
EditImplement endpoint to create a new tenant (system_admin only).
Endpoint: POST /api/v1/tenants
Request Body:
- name: string (required, unique)
- display_name: string (optional)
- settings: object (optional, tenant-specific settings)
- admin_email: string (required, first admin user)
Response: Created tenant with encrypted client key
Required Permissions: system_admin only
Implementation Requirements:
- Generate unique tenant ID (UUID)
- Generate encrypted client key (Fernet)
- Create default roles for tenant
- Send invitation to admin email
- Initialize tenant settings
- Create tenant-specific database schemas if needed
With ultra attention to details and correctness.
Before closing: write comment summarizing implementation with screenshot.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...