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

# Create a user

> Creates a user.

Sends an email with a generated password if the password is missing.



## OpenAPI

````yaml /openapi.json post /users
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /users:
    post:
      tags:
        - Users
      summary: Create a user
      description: "Creates a user.\r\n\r\nSends an email with a generated password if the password is missing."
      operationId: CreateUserAsync
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UserDto'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UserDto'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UserDto'
      responses:
        '202':
          description: >-
            When request is accepted. Returns a hypermedia 'Link' object of the
            user to be created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          description: When user or password validation fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    UserDto:
      required:
        - email
      type: object
      properties:
        email:
          minLength: 1
          type: string
          description: Email address of the user.
          example: user@domain.com
        password:
          type: string
          description: "Password for the user.\r\n\r\nPassword must include atleast one lowercase character, uppercase character, numeric character as well as a special character."
          nullable: true
        expireAfterDays:
          type: integer
          description: >-
            Expire after the specified days. Must be left blank for users that
            do not expire.
          format: int32
          nullable: true
          example: 7
        isInternal:
          type: boolean
          description: "Creates the user as an internal user.\r\n\r\nInternal users are excluded from billing and license counts.\r\n\r\nUse this option for testing, background services, or other non-customer-facing purposes."
          example: true
        bypassMfa:
          type: boolean
          description: "Bypasses multi-factor authentication for the user.\r\n\r\nWhen enabled, the user will not be prompted for two factor authentication during login."
          example: true
      additionalProperties: false
    Link:
      type: object
      properties:
        id:
          type: string
          nullable: true
        href:
          type: string
          nullable: true
        relation:
          type: string
          nullable: true
        method:
          type: string
          default: GET
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````