> ## 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.

# Register a new tenant

> Creates a new tenant organization and the first admin user. Used by marketing website signup flow.



## OpenAPI

````yaml /api-reference/openapi.json post /auth/register-tenant
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:
  /auth/register-tenant:
    post:
      tags:
        - auth
      summary: Register a new tenant
      description: >-
        Creates a new tenant organization and the first admin user. Used by
        marketing website signup flow.
      operationId: AuthController_registerTenant
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterTenantDto'
      responses:
        '201':
          description: Tenant and admin user created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterTenantResponseDto'
        '400':
          description: Invalid input or terms not accepted
        '409':
          description: Tenant slug or email already exists
        '429':
          description: Too many registration attempts from this IP
components:
  schemas:
    RegisterTenantDto:
      type: object
      properties:
        companyName:
          type: string
          description: Company/Organization name
          example: Acme Corporation
          minLength: 2
          maxLength: 255
        slug:
          type: string
          description: >-
            URL-friendly slug for the tenant (auto-generated from company name
            if not provided)
          example: acme-corp
          minLength: 2
          maxLength: 100
        email:
          type: string
          description: Admin user email address
          example: admin@acme.com
        name:
          type: string
          description: Admin user full name
          example: John Doe
          minLength: 2
          maxLength: 255
        password:
          type: string
          description: >-
            Admin user password (min 8 chars, must include uppercase, lowercase,
            number)
          example: SecurePassword123!
          minLength: 8
        applicationNote:
          type: string
          description: Optional note about why they want to join the alpha program
          example: >-
            We run an EdTech platform with 10k MAUs and want to reduce churn by
            adding gamification.
          maxLength: 500
        captchaToken:
          type: string
          description: Cloudflare Turnstile CAPTCHA token
          example: 0.AbCdEfGhIjKlMnOpQrStUvWxYz...
        website:
          type: string
          description: Honeypot field — must be empty (used for bot detection)
        acceptedTerms:
          type: boolean
          description: User has accepted terms of service
          example: true
      required:
        - companyName
        - email
        - name
        - password
        - captchaToken
        - acceptedTerms
    RegisterTenantResponseDto:
      type: object
      properties:
        accessToken:
          type: string
          description: Access token (JWT)
        refreshToken:
          type: string
          description: Refresh token
        tokenType:
          type: string
          description: Token type
          example: Bearer
        expiresIn:
          type: number
          description: Token expiration time in seconds
        tenant:
          type: object
          description: Created tenant information
          example:
            id: 123e4567-e89b-12d3-a456-426614174000
            name: Acme Corporation
            slug: acme-corp
            plan: FREE
            alphaApprovalStatus: PENDING
        user:
          type: object
          description: Created admin user information
          example:
            id: 123e4567-e89b-12d3-a456-426614174000
            email: admin@acme.com
            name: John Doe
            role: OWNER
            emailVerified: false
        redirectUrl:
          type: string
          description: URL to redirect user to after signup
          example: https://admin.engagefabric.com/auth/callback
      required:
        - accessToken
        - refreshToken
        - tokenType
        - expiresIn
        - tenant
        - user
        - redirectUrl

````