# Create a new tenant Create a new tenant with automatic API key provisioning. This endpoint creates a unique tenant with its own isolated data space and dedicated API credentials. Authentication: This endpoint requires a special Partnership API Key (starts with sk-partner-) with the tenants:create scope. The partnership key is passed via the standard x-api-key header along with the tenant ID that owns the partnership key. Required Headers: - X-Api-Key: sk-partner-... (Partnership key provided by Genway team) - X-Tenant-Id: YOUR_TENANT_UUID (Tenant UUID that owns the partnership key) Contact support@genway.ai to obtain your partnership key. Endpoint: POST /tenants Version: 1.0.0 Security: api_key, tenant_id ## Request fields (application/json): - `organization_name` (string, required) Name of the organization/customer Example: "Acme Corporation" - `contact_email` (string, required) Primary contact email for this tenant Example: "admin@acme.com" - `description` (string) Optional description of the tenant/organization Example: "Enterprise customer for user research platform" ## Response 201 fields (application/json): - `tenant_id` (string, required) Unique identifier for the tenant Example: "123e4567-e89b-12d3-a456-426614174000" - `api_key` (string, required) Unique API key for this tenant (store securely) Example: "gw_live_123abc456def789ghi012jkl345mno678pqr" - `organization_name` (string, required) Example: "Acme Corporation" - `contact_email` (string, required) Example: "admin@acme.com" - `description` (string,null) Example: "Enterprise customer for user research platform" - `created_at` (string, required) Example: "2025-06-29T10:30:00Z" ## Response 400 fields (application/json): - `error` (string) Example: "Invalid email format" - `message` (string) Example: "The provided email address is not in a valid format" ## Response 401 fields (application/json): - `error` (string) Example: "Unauthorized" - `message` (string) Example: "Invalid or missing partnership key. Contact support@genway.ai to obtain a valid partnership key." ## Response 409 fields (application/json): - `error` (string) Example: "Organization already exists" - `message` (string) Example: "A tenant with this organization name already exists" ## Response 500 fields (application/json): - `error` (string) Example: "Internal server error" - `message` (string) Example: "An unexpected error occurred while creating the tenant"