> ## Documentation Index
> Fetch the complete documentation index at: https://docs.engagefabric.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new tenant



## OpenAPI

````yaml /api-reference/openapi.json post /tenants
openapi: 3.0.0
info:
  title: EngageFabric API
  description: >-
    EngageFabric is a multi-tenant SaaS gamification framework. This API
    provides endpoints for managing players, tracking events, quests,
    adventures, leaderboards, lobbies, and real-time features.
  version: 1.0.0
  contact:
    name: EngageFabric Support
    url: https://engagefabric.com
    email: support@engagefabric.com
  license:
    name: Proprietary
    url: https://engagefabric.com/terms
servers:
  - url: https://api.engagefabric.com
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags:
  - name: auth
    description: Authentication endpoints
  - name: tenants
    description: Tenant management
  - name: projects
    description: Project management
  - name: players
    description: Player management and game state
  - name: events
    description: Event ingestion and tracking
  - name: quests
    description: Quest management and progress
  - name: adventures
    description: Adventure/season management
  - name: leaderboards
    description: Leaderboard rankings
  - name: lobbies
    description: Multiplayer lobby management
  - name: chat
    description: Real-time chat
  - name: rules
    description: Rules engine configuration
paths:
  /tenants:
    post:
      tags:
        - tenants
      summary: Create a new tenant
      operationId: TenantController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTenantDto'
      responses:
        '201':
          description: Tenant created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantEntity'
        '409':
          description: Tenant with slug already exists
      security:
        - JWT: []
components:
  schemas:
    CreateTenantDto:
      type: object
      properties:
        name:
          type: string
          description: Tenant name
          example: Acme Corporation
          minLength: 2
          maxLength: 255
        slug:
          type: string
          description: >-
            Tenant slug (URL-friendly identifier, lowercase alphanumeric and
            hyphens)
          example: acme-corp
          minLength: 2
          maxLength: 100
        plan:
          type: string
          description: Subscription plan
          enum:
            - FREE
            - STARTER
            - PROFESSIONAL
            - ENTERPRISE
          default: FREE
        metadata:
          type: object
          description: Additional metadata (JSON object)
          example:
            industry: SaaS
            companySize: 50-100
      required:
        - name
        - slug
    TenantEntity:
      type: object
      properties:
        id:
          type: string
          description: Unique tenant identifier
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Tenant name
          example: Acme Corporation
        slug:
          type: string
          description: URL-friendly slug
          example: acme-corp
        plan:
          type: string
          description: Subscription plan
          enum:
            - FREE
            - STARTER
            - PROFESSIONAL
            - ENTERPRISE
          example: FREE
        status:
          type: string
          description: Tenant status
          enum:
            - ACTIVE
            - SUSPENDED
            - CANCELLED
          example: ACTIVE
        isActive:
          type: boolean
          description: Whether the tenant is active (derived from status)
          example: true
        isAlphaLocked:
          type: boolean
          description: Whether tenant is locked to FREE tier during alpha
          example: true
        onboardingStatus:
          type: string
          description: Onboarding progress status
          enum:
            - PENDING
            - EMAIL_VERIFIED
            - PROJECT_CREATED
            - FIRST_EVENT_SENT
            - COMPLETED
          example: PENDING
        alphaApprovalStatus:
          type: string
          description: Alpha approval status
          enum:
            - PENDING
            - APPROVED
            - REJECTED
          example: PENDING
        alphaApprovedAt:
          type: object
          description: When the tenant was approved for alpha
          example: '2025-01-15T10:30:00Z'
        alphaApprovedBy:
          type: object
          description: Email of super admin who approved
          example: admin@engagefabric.com
        alphaRejectionReason:
          type: object
          description: Reason for rejection if rejected
          example: Not a good fit for alpha program
        alphaApplicationNote:
          type: object
          description: Application note from user
          example: We are building a gamification platform
        metadata:
          type: object
          description: Additional metadata
          example:
            industry: SaaS
        createdAt:
          format: date-time
          type: string
          description: Creation timestamp
          example: '2025-01-15T10:30:00Z'
        updatedAt:
          format: date-time
          type: string
          description: Last update timestamp
          example: '2025-01-15T10:30:00Z'
        deletedAt:
          type: object
          description: Soft deletion timestamp
          example: null
        _count:
          type: object
          description: Count of related entities
          example:
            projects: 3
            members: 5
      required:
        - id
        - name
        - slug
        - plan
        - status
        - isActive
        - isAlphaLocked
        - onboardingStatus
        - alphaApprovalStatus
        - createdAt
        - updatedAt
  securitySchemes:
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: JWT token for admin console authentication

````