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

# create a new user and assigns them to a tenant

> Creates a brand new user on a tenant



## OpenAPI

````yaml https://us-west-2.api.thenile.dev/v2/openapi post /v2/databases/{database}/tenants/{tenantId}/users
openapi: 3.0.0
info:
  title: Nile auth API
  version: '0.1'
servers: []
security: []
tags: []
paths:
  /v2/databases/{database}/tenants/{tenantId}/users:
    post:
      tags:
        - users
      summary: create a new user and assigns them to a tenant
      description: Creates a brand new user on a tenant
      operationId: createTenantUser
      parameters:
        - name: database
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUser'
      responses:
        '201':
          description: update an existing tenant wih a new user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantUser'
        '400':
          description: API/Database failures
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not found
          content: {}
      security:
        - sessionCookie: []
components:
  schemas:
    CreateUser:
      required:
        - email
        - password
      type: object
      properties:
        email:
          type: string
        password:
          type: string
        name:
          type: string
        givenName:
          type: string
        familyName:
          type: string
        picture:
          type: string
    TenantUser:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        name:
          type: string
        givenName:
          type: string
        familyName:
          type: string
        picture:
          type: string
        created:
          type: string
          format: date-time
        emailVerified:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
  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

````