---
title: "Create new user"
method: POST
path: "/public/create-new-user"
tags: ["User"]
---

# Create new user

`POST /public/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.

## Request body

- object
  - `data` object[], required
    - `data` object, required
      - `userId` string, required — Internal userId you have been using for the user in your database
      - `profileDefaults` object, required — Optional default profile information to set for the new user. All fields are optional and will use system defaults if not provided.
        - `name` string — Pass a value here to set name of user. Leave undefined to keep it as system default
        - `username` string — Pass a value here to set username of user. Leave undefined to keep it as system default
        - `email` string, email — Pass a value here to set email of user. Without this, the user will not show up inside the "Users" tab.
        - `profilePictureUrl` string, uri — Pass a value here to set profile photo of user. Leave undefined to keep it as system default
        - `password` string — Password for this user account. Leave undefined to not set any password.
        - `phoneNumber` string — Pass a value here to set the phone number of the user. Leave undefined to keep it blank.
      - `shouldSendWelcomeEmail` boolean — If true, a welcome email will be sent to the students with their initial account data from the system

## Response `200`

API Response Body

- object[]
  - `output` union, required
    - object
      - `status` 'ok', required
      - `data` object, required
    - object
      - `status` 'error', required
      - `errorMessage` string, required

---

[API](https://skmtc.net/fermion/apis/fermion-backend-api.md) · [All operations](https://skmtc.net/fermion/apis/fermion-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fermion/fermion-backend-api/revisions/7ce364c8820b/schema)
