post
https://api.duodeal.app/api/users
Creates a new user inside the authenticated admin's company. Requires ROLE_ADMIN.
The new user is automatically attached to the caller's company. A super admin can override the company by passing a company ID in the body.
The account can be created already active and with a profile photo in a single request by passing active and avatar (see below).
Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Unique email address (validated) |
password | string | Yes | Plain password — hashed before storage |
firstName | string | No | First name |
lastName | string | No | Last name |
userGroup | object | No | User group: {"id": <user_group_id>} |
active | boolean | No | Active status. Pass true to activate the account immediately (no manual activation needed). |
avatar | string | No | Profile photo as a base64-encoded image (data-URI accepted, e.g. data:image/png;base64,…). Stored under the new user's own path. |
phone | string | No | Phone number |
jobTitle | string | No | Job title |
mailProvider | string | No | Mail provider: internal, gmail, outlook, or mailto |
language | string | No | Preferred locale (e.g. en, fr) |
locale | string | No | Alias used to set language |
Response
201 Created: User successfully created400 Bad Request: Missing password, invalid JSON, or validation error401 Unauthorized: Invalid or missing API key403 Forbidden: Caller is not an admin
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
201Resource created
400Bad request
401Unauthorized
