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

# Create tenants

> Create tenants.



## OpenAPI

````yaml https://admin.trophy.so/v1/openapi post /tenants
openapi: 3.1.0
info:
  title: Trophy
  version: 1.19.0
servers:
  - x-fern-server-name: Admin API
    url: https://admin.trophy.so/v1
    description: Admin API
security: []
paths:
  /tenants:
    servers:
      - url: https://admin.trophy.so/v1
        description: Admin API
    post:
      tags:
        - Admin
      summary: Create tenants
      description: Create tenants.
      operationId: admin_tenants_create
      requestBody:
        description: Array of tenants to create. Maximum 100 tenants per request.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTenantsRequest'
            examples:
              Create tenants:
                value:
                  - customerId: customer_12345
                    name: Acme Corp
                  - customerId: customer_67890
                    name: Globex Inc
      responses:
        '200':
          description: Successful operation (no tenants created)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTenantsResponse'
              examples:
                All requests had errors:
                  value:
                    created: []
                    issues:
                      - index: 0
                        severity: error
                        message: >-
                          Customer ID "customer_12345" already exists in this
                          environment
        '201':
          description: Created (at least one tenant created)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTenantsResponse'
              examples:
                Success with no issues:
                  value:
                    created:
                      - id: 550e8400-e29b-41d4-a716-446655440000
                        customerId: customer_12345
                        name: Acme Corp
                        status: active
                        created: '2026-01-15T09:30:00.000Z'
                        updated: '2026-01-15T09:30:00.000Z'
                    issues: []
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminErrorBody'
        '422':
          description: Unprocessible Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminErrorBody'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: javascript
          source: |
            import { TrophyApiClient } from '@trophyso/node';

            const trophy = new TrophyApiClient({
              apiKey: 'YOUR_API_KEY'
            });

            const response = await trophy.admin.tenants.create([
              {
                customerId: 'customer_12345',
                name: 'Acme Corp'
              }
            ]);
        - lang: python
          source: |
            from trophy import TrophyApi

            client = TrophyApi(api_key='YOUR_API_KEY')

            response = client.admin.tenants.create([
              {
                "customerId": "customer_12345",
                "name": "Acme Corp"
              }
            ])
        - lang: go
          source: >
            import (
              "context"

              api "github.com/trophyso/trophy-go"
              trophyclient "github.com/trophyso/trophy-go/client"
              "github.com/trophyso/trophy-go/option"
            )


            client := trophyclient.NewClient(
              option.WithApiKey("YOUR_API_KEY"),
            )


            response, err := client.Admin.Tenants.Create(context.TODO(),
            api.CreateTenantsRequest{})
components:
  schemas:
    CreateTenantsRequest:
      title: CreateTenantsRequest
      type: array
      description: Request body for creating tenants.
      items:
        $ref: '#/components/schemas/CreateTenantRequestItem'
      minItems: 1
      maxItems: 100
    CreateTenantsResponse:
      title: CreateTenantsResponse
      type: object
      description: Response containing created tenants and any issues.
      properties:
        created:
          type: array
          items:
            $ref: '#/components/schemas/AdminTenant'
          description: Array of successfully created tenants.
        issues:
          type: array
          items:
            $ref: '#/components/schemas/AdminIssue'
          description: Array of issues encountered during creation.
      required:
        - created
        - issues
    AdminErrorBody:
      title: AdminErrorBody
      type: object
      properties:
        error:
          type: string
      required:
        - error
    CreateTenantRequestItem:
      title: CreateTenantRequestItem
      type: object
      description: A tenant to create.
      properties:
        customerId:
          type: string
          description: The external customer ID. Must be unique within the environment.
          example: customer_12345
          maxLength: 255
        name:
          type: string
          description: Human-readable name for the tenant.
          example: Acme Corp
          maxLength: 255
      required:
        - customerId
        - name
    AdminTenant:
      title: AdminTenant
      type: object
      description: A tenant in a multi-tenant environment.
      properties:
        id:
          type: string
          format: uuid
          description: The tenant UUID.
          example: 550e8400-e29b-41d4-a716-446655440000
        customerId:
          type: string
          description: The external customer ID for this tenant.
          example: customer_12345
        name:
          type: string
          description: Human-readable name for the tenant.
          example: Acme Corp
        status:
          type: string
          enum:
            - active
            - archived
          description: The lifecycle status of the tenant.
          example: active
        created:
          type: string
          format: date-time
          description: When the tenant was created.
        updated:
          type: string
          format: date-time
          description: When the tenant was last updated.
      required:
        - id
        - customerId
        - name
        - status
        - created
        - updated
    AdminIssue:
      title: AdminIssue
      type: object
      description: An issue encountered while processing an item in an admin API request.
      properties:
        id:
          type: string
          description: The ID of the resource the issue relates to, when applicable.
          example: 550e8400-e29b-41d4-a716-446655440000
        userId:
          type: string
          description: The ID of the user the issue relates to, when applicable.
          example: user-123
        boostId:
          type: string
          description: The ID of the points boost the issue relates to, when applicable.
          example: 550e8400-e29b-41d4-a716-446655440000
        index:
          type: integer
          description: >-
            The zero-based index of the item the issue relates to, when no
            resource ID exists yet.
          example: 0
        severity:
          type: string
          enum:
            - error
            - warning
          description: The severity level of the issue.
          example: warning
        message:
          type: string
          description: A human-readable description of the issue.
          example: Would exceed maximum freeze limit
      required:
        - severity
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````