---
title: "Save Or update User (saveUser)"
method: POST
path: "/api/user"
tags: ["user-controller"]
---

# Save Or update User (saveUser)

`POST /api/user`

Create or update the User. When creating user, platform generates User Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created User Id will be present in the response. Specify existing User Id to update the device. Referencing non-existing User Id will cause 'Not Found' error.

Device email is unique for entire platform setup.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new User entity.

Available for users with 'SYS_ADMIN', 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.

## Query parameters

- `sendActivationMail` string

## Request body

- User — A JSON value representing the User.
  - `id` UserId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'USER', required — string
  - `createdTime` integer — Timestamp of the user creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `customerId` CustomerId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'CUSTOMER', required — string
  - `email` string, required — Email of the user
  - `authority` 'SYS_ADMIN' | 'TENANT_ADMIN' | 'CUSTOMER_USER' | 'REFRESH_TOKEN' | 'PRE_VERIFICATION_TOKEN' | 'MFA_CONFIGURATION_TOKEN', required — Authority
  - `firstName` string — First name of the user
  - `lastName` string — Last name of the user
  - `phone` string — Phone number of the user
  - `version` integer
  - `name` string — Duplicates the email of the user, readonly
  - `additionalInfo` unknown

## Response `200`

OK

- User — A JSON value representing the User.
  - `id` UserId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'USER', required — string
  - `createdTime` integer — Timestamp of the user creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `customerId` CustomerId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'CUSTOMER', required — string
  - `email` string, required — Email of the user
  - `authority` 'SYS_ADMIN' | 'TENANT_ADMIN' | 'CUSTOMER_USER' | 'REFRESH_TOKEN' | 'PRE_VERIFICATION_TOKEN' | 'MFA_CONFIGURATION_TOKEN', required — Authority
  - `firstName` string — First name of the user
  - `lastName` string — Last name of the user
  - `phone` string — Phone number of the user
  - `version` integer
  - `name` string — Duplicates the email of the user, readonly
  - `additionalInfo` unknown

---

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