Skip to main content
POST
Create New User

Create New User

Create a new user account. Only accessible by administrators.

Endpoint

Description

This endpoint allows administrators to create new user accounts in the system. You can specify various user attributes including role, license, and authentication type. This is an administrative endpoint that requires appropriate permissions.

User Creation Flow

Basic Auth (authType: "basic"): User receives a welcome email with a password setup link. Account is created unverified until password is set. Enterprise SSO (authType: "enterprise"): User is created verified and can sign in via enterprise SSO (Auth0, Microsoft AD, etc.). No password setup required.

Authentication

Required. Include your API key in the Authorization header.

Request

Request Body

Example Request

Response

Success Response (201)

Response Fields

Example Usage

JavaScript

Python

cURL

Error Responses

400 Bad Request

400 Invalid AuthType

400 Missing Required Fields

401 Unauthorized

403 Forbidden

409 Conflict

Validations and Business Rules

  • License value: Must be one of the allowed licenses (Essential, Growth, Ultra, Early Access). Invalid values return 400.
  • License capacity: Enforced via checkLicenseCapacity. If capacity is full for the selected tier, returns 400.
  • Email normalization: Lowercased and trimmed before validation and storage.
  • Username normalization: Lowercased and trimmed before validation and storage. Auto-generated from email if not provided.
  • Email format: Validated with a simple regex; invalid emails return 400.
  • Username format: Must match ^[a-z0-9.-]{3,30}$; invalid usernames return 400.
  • Uniqueness: email, username, and name must be unique. Conflicts return 409.
  • Email invite behavior: For basic auth, users receive welcome emails with password setup links.

Normalization and Storage

  • email and username are always stored lowercased and trimmed.

Typical Error Shapes

400 Invalid License

400 License Unavailable

400 Invalid Email

400 Invalid Username

409 Conflict (Uniqueness)

User Roles

License Tiers

Authentication Types

Use Cases

  • User Onboarding: Create new user accounts for team members
  • Passwordless Onboarding: Create users who receive email invites to set their own passwords
  • SSO Integration: Create users who authenticate via external identity providers
  • Bulk User Creation: Programmatically create multiple users
  • Integration: Create users from external systems
  • Administrative Tasks: Manage user accounts through API

Rate Limits

This endpoint follows the standard rate limits:
  • 60 requests per minute
  • 1000 requests per hour

Authorizations

Authorization
string
header
required

API key authentication using Bearer token format. Example: Authorization: Bearer sk-your-api-key-here

Body

application/json
name
string
required

User's full name

Example:

"John Doe"

username
string
required

Unique username

Example:

"johndoe"

email
string<email>
required

User's email address

Example:

"john@example.com"

password
string
required

User's password

Example:

"securepassword123"

role
enum<string>
default:user

User's role

Available options:
admin,
user,
globalReader
Example:

"user"

license
enum<string>
default:Essential

User's license tier

Available options:
Essential,
Growth,
Ultra,
Early Access
Example:

"Growth"

roleId
string

Custom role ID (MongoDB ObjectId)

Example:

"60a7c8f5e8b4f5001f7a8c24"

setupCompleted
boolean
default:false

Whether user setup is completed

Example:

false

authType
enum<string>
default:basic

Authentication type

Available options:
basic,
auth0
Example:

"basic"

Response

User created successfully

success
boolean
Example:

true

message
string
Example:

"User created successfully"

user
object