---
title: "Create a new user"
method: POST
path: "/users"
tags: ["users"]
---

# Create a new user

`POST /users`

## Request

- Base URL: `https://pmp-demo.privateplatform.mendix.com/userservice/v1`
- URL: `https://pmp-demo.privateplatform.mendix.com/userservice/v1/users`
- Auth: API key in header `Authorization`

## Use this operation to create a new user

Name field is mandatory. Name can only be alphanumeric, spaces, underscores, or dashes. Max length for name field is 100 characters. Max length for Description is 250 characters.

## Request body

- UserInput: User creation request
  - `name` string, required: User name.
  - `fullName` string, required: User full name.
  - `email` string, email, required: User's Email.
  - `company` string: The company that use belongs to.
  - `department` string: The department that use belongs to.
  - `unit` string: The unit that use belongs to.
  - `team` string: The team that use belongs to.
  - `aux1` string: User's auxiliar info 1.
  - `aux2` string: User's auxiliar info 2.
  - `userRoles` object[], required: User roles.
    - `role` 'User' | 'SystemAdmin' | 'CompanyAdmin', required: User role.
  - `blocked` boolean: User is blocked (can not login).

## Response `201`

User

- object
  - `id` string
  - `name` string
  - `fullName` string
  - `email` string
  - `isLocalUser` boolean
  - `active` boolean
  - `firstLoginTime` string
  - `lastLogin` string
  - `approved` boolean
  - `emailVerified` boolean
  - `onboarded` boolean
  - `roles` object[]
    - `role` string
  - `blocked` boolean

## Other responses

- `400`: Invalid input parameter or request body
- `401`: Authentication information is missing or invalid
- `403`: User has no permission for this operation
- `404`: Resource not found

---

[API](https://skmtc.dev/mendix/apis/user-service.md) - [All operations](https://skmtc.dev/mendix/apis/user-service/llms.txt) - [OpenAPI document](https://skmtc.dev/mendix/apis/user-service/revisions/eec46375b41a?raw)
