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

# creates a tenant

> makes a tenant, assigns user to that tenant



## OpenAPI

````yaml https://us-west-2.api.thenile.dev/v2/openapi post /v2/databases/{database}/tenants
openapi: 3.0.0
info:
  title: Nile auth API
  version: '0.1'
servers: []
security: []
tags: []
paths:
  /v2/databases/{database}/tenants:
    post:
      tags:
        - tenants
      summary: creates a tenant
      description: makes a tenant, assigns user to that tenant
      operationId: createTenant
      parameters:
        - name: database
          in: path
          required: true
          schema:
            type: string
      requestBody:
        description: A wrapper for the tenant name.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTenantRequest'
            examples:
              Create Tenant Request:
                summary: Creates a named tenant
                description: Create Tenant Request
                value:
                  name: My Sandbox
      responses:
        '201':
          description: A created tenants
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenant'
        '400':
          description: API/Database failures
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not found
          content: {}
      security:
        - sessionCookie: []
components:
  schemas:
    CreateTenantRequest:
      required:
        - name
      type: object
      properties:
        name:
          type: string
        id:
          type: string
          description: The desired uuidv7 of the tenant
    Tenant:
      required:
        - id
      type: object
      properties:
        id:
          type: string
        name:
          type: string
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: nile-auth.session-token
      description: >-
        Session token stored in a cookie after user signs in, prefixed with
        __Secure if on https

````