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

# Tenant Setup

> Public endpoint to provision a single-tenant environment using a license.
It validates the license, creates tenant DB, registers the first admin, and returns an org token.



## OpenAPI

````yaml post /api/tenant/setup
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/tenant/setup:
    post:
      tags:
        - Tenant
      summary: Tenant Setup
      description: >-
        Public endpoint to provision a single-tenant environment using a
        license.

        It validates the license, creates tenant DB, registers the first admin,
        and returns an org token.
      operationId: tenant_setup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantSetupRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantSetupResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    TenantSetupRequest:
      properties:
        license_token:
          type: string
          title: License Token
        admin_email:
          type: string
          format: email
          title: Admin Email
        admin_name:
          type: string
          title: Admin Name
        admin_password:
          type: string
          title: Admin Password
      type: object
      required:
        - license_token
        - admin_email
        - admin_name
        - admin_password
      title: TenantSetupRequest
    TenantSetupResponse:
      properties:
        message:
          type: string
          title: Message
        tenant_org_token:
          type: string
          title: Tenant Org Token
      type: object
      required:
        - message
        - tenant_org_token
      title: TenantSetupResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````