---
title: "Create User"
method: POST
path: "/users"
tags: ["users"]
---

# Create User

`POST /users`

## Request

- Base URL: `https://api.b2metric.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.b2metric.com/users`
- Auth: none declared

Create a Keycloak user. Two provisioning modes:

- ``email``: send an email invite (UPDATE_PASSWORD + VERIFY_EMAIL). Suits the
  console's own users, who log in via OIDC redirect and CAN complete those
  interactive actions. Requires a configured SMTP server.
- ``password``: set a permanent password and verify the email up front, with
  NO required actions, so the user can log in immediately — including via the
  direct (password) grant used by signalone/cockpit. The password is returned
  once for the admin to hand off.

## Headers

- `authorization` string, nullable

## Request body

- UserCreate
  - `email` string, required
  - `first_name` string, required
  - `last_name` string, required
  - `username` string, nullable
  - `tenant_group_id` string, nullable
  - `role` string, nullable
  - `mode` 'email' | 'password'
  - `password` string, nullable

## Response `201`

Successful Response

- AppSchemasUserInviteOut
  - `id` string, required
  - `invite` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/b2metric/apis/b2metric-license-api.md) - [All operations](https://skmtc.dev/b2metric/apis/b2metric-license-api/llms.txt) - [OpenAPI document](https://skmtc.dev/b2metric/apis/b2metric-license-api/revisions/5c26e11e8b53?raw)
