---
title: "Create user"
method: POST
path: "/api/users"
tags: ["Users"]
---

# Create user

`POST /api/users`

Creates a new user account with the provided details and password

## Request body

- UserWithPassword
  - `user` UserCommandDTO, required — Command Data Transfer Object for creating or updating a user. Used as the request body for user creation/update endpoints.
    - `login` string, required — The login username of the user.
    - `firstName` string, nullable, required — The first name of the user. Can be `null` if not provided.
    - `lastName` string, nullable, required — The last name of the user. Can be `null` if not provided.
    - `email` string, nullable, required — The email address of the user. Can be `null` if not provided.
    - `language` 'fr' | 'en', required — Type representing a supported language.
    - `timezone` string, required — Represents a timezone as an IANA timezone string.
  - `password` string, required

## Response `201`

User created successfully

- UserDTO — Data Transfer Object for a user. Represents a user with their personal information, login credentials, preferences, and display name.
  - `id` string, required — The unique identifier of the entity.
  - `createdBy` UserInfo, required — Represents the user who performed an action, with a computed display name.
    - `id` string, required — The unique identifier of the user.
    - `friendlyName` string, required — A human-readable display name for the user. "OIAnalytics" for the oianalytics system user, "Admin" for the admin login, or "Firstname Lastname (login)" for regular users.
  - `updatedBy` UserInfo, required — Represents the user who performed an action, with a computed display name.
    - `id` string, required — The unique identifier of the user.
    - `friendlyName` string, required — A human-readable display name for the user. "OIAnalytics" for the oianalytics system user, "Admin" for the admin login, or "Firstname Lastname (login)" for regular users.
  - `createdAt` string, required — Represents an instant in time as an ISO 8601 string.
  - `updatedAt` string, required — Represents an instant in time as an ISO 8601 string.
  - `login` string, required — The login username of the user.
  - `firstName` string, nullable, required — The first name of the user. Can be `null` if not provided.
  - `lastName` string, nullable, required — The last name of the user. Can be `null` if not provided.
  - `email` string, nullable, required — The email address of the user. Can be `null` if not provided.
  - `language` 'fr' | 'en', required — Type representing a supported language.
  - `timezone` string, required — Represents a timezone as an IANA timezone string.
  - `friendlyName` string, required — The friendly display name of the user.

---

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