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

# Create new user 

> Create a new user in the system using the unique userId from your database. Note that this function is idempotent, therefore, calling it multiple times with the same userId will not do anything.

Authentication with the "FERMION-API-KEY" header is required to use this endpoint.

Rate limit: Maximum 600 requests in a window of 1m.



## OpenAPI

````yaml https://backend.codedamn.com/webhook/fermion-backend-openapi.yaml post /public/create-new-user
openapi: 3.0.0
info:
  version: 1.0.0
  title: Fermion Backend API
  description: Documentation for interacting with the Fermion API
  contact:
    name: Fermion Support
    email: support@codedamn.com
servers:
  - url: https://backend.codedamn.com/api
    description: Fermion primary backend server
security: []
externalDocs:
  description: Fermion Docs
  url: https://docs.fermion.app
paths:
  /public/create-new-user:
    post:
      tags:
        - User
      summary: 'Create new user '
      description: >-
        Create a new user in the system using the unique userId from your
        database. Note that this function is idempotent, therefore, calling it
        multiple times with the same userId will not do anything.


        Authentication with the "FERMION-API-KEY" header is required to use this
        endpoint.


        Rate limit: Maximum 600 requests in a window of 1m.
      requestBody:
        description: API Request Body
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          userId:
                            type: string
                            description: >-
                              Internal userId you have been using for the user
                              in your database
                          profileDefaults:
                            type: object
                            properties:
                              name:
                                type: string
                                minLength: 2
                                maxLength: 100
                                description: >-
                                  Pass a value here to set name of user. Leave
                                  undefined to keep it as system default
                              username:
                                type: string
                                minLength: 3
                                maxLength: 24
                                pattern: ^[a-zA-Z0-9]+$
                                description: >-
                                  Pass a value here to set username of user.
                                  Leave undefined to keep it as system default
                              email:
                                type: string
                                format: email
                                description: >-
                                  Pass a value here to set email of user.
                                  Without this, the user will not show up inside
                                  the "Users" tab.
                              profilePictureUrl:
                                type: string
                                format: uri
                                description: >-
                                  Pass a value here to set profile photo of
                                  user. Leave undefined to keep it as system
                                  default
                              password:
                                type: string
                                minLength: 6
                                maxLength: 127
                                description: >-
                                  Password for this user account. Leave
                                  undefined to not set any password.
                              phoneNumber:
                                type: string
                                description: >-
                                  Pass a value here to set the phone number of
                                  the user. Leave undefined to keep it blank.
                            description: >-
                              Optional default profile information to set for
                              the new user. All fields are optional and will use
                              system defaults if not provided.
                          shouldSendWelcomeEmail:
                            type: boolean
                            description: >-
                              If true, a welcome email will be sent to the
                              students with their initial account data from the
                              system
                        required:
                          - userId
                          - profileDefaults
                    required:
                      - data
              required:
                - data
      responses:
        '200':
          description: API Response Body
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    output:
                      anyOf:
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - ok
                            data:
                              type: object
                              properties: {}
                          required:
                            - status
                            - data
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - error
                            errorMessage:
                              type: string
                          required:
                            - status
                            - errorMessage
                  required:
                    - output
      security:
        - FERMION-API-KEY: []
components:
  securitySchemes:
    FERMION-API-KEY:
      name: FERMION-API-KEY
      type: apiKey
      in: header

````