# Create a new user Creates a new user account with role and contact details. ## Endpoint `POST /emsapi/users` ## Request ### Request URL `https://{server-hostname}:8383/emsapi/users` ### Scope `Admin.CREATE` ### Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ### Request Body `application/json` JSON object: - **authType** `string` *(Optional)*: Authentication mode for the user (e.g., localAuthentication). - **language** `string` *(Optional)*: User locale identifier. - **probeScopeType** `integer` *(Optional)*: Probe scope type for summary/probe configuration. - **deviceScopeType** `integer` *(Optional)*: Device scope type for MDM access control. - **remoteOfficeGroups** `array` *(Optional)*: List of remote office group identifiers for user scope. - **roleID** `long` *(Optional)*: Role identifier to assign to the user. - **userName** `string` *(Optional)*: Username for the new user. - **mailID** `string` *(Optional)*: Email address for the user. - **phoneNumber** `string` *(Optional)*: Phone number for the user. ### Sample Request #### Curl ```curl curl --request POST \ --url https://appdomain/emsapi/users \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{"phoneNumber":"22222676","probeScopeType":1,"roleID":4,"deviceScopeType":0,"language":"en_us","mailID":"alex.morgan@example.com","remoteOfficeGroups":[],"authType":"localAuthentication","userName":"alex.morgan"}' ``` ### Sample Request Body Create a local user with role, email, and scope settings. ```json { "phoneNumber": "22222676", "probeScopeType": 1, "roleID": 4, "deviceScopeType": 0, "language": "en_us", "mailID": "alex.morgan@example.com", "remoteOfficeGroups": [], "authType": "localAuthentication", "userName": "alex.morgan" } ``` ## Response Parameters ### HTTP Code 200 Response body: `application/json` JSON object: - **mailStatus** `boolean`: Indicates whether the invitation or activation email was sent successfully. - **domainName** `string`: Domain name for the user. Local users are represented as 'local'. - **userName** `string`: Username of the created user. - **loginId** `string`: Unique login identifier for the newly created user. - **securityAdvisoryCode** `string`: Security advisory code returned after user creation. - **meta** `JSON object`: Metadata related to the user creation. ### Possible Response Codes - **200** `HTTP code` ### Sample Response: HTTP 200 User creation succeeds and returns login identity with metadata. ```json { "loginId": "302", "securityAdvisoryCode": "SAC001", "meta": { "userCount": 3 }, "domainName": "local", "mailStatus": true, "userName": "alex.morgan" } ``` ## Rate Limit ![ ](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **Duration:** 1 minute | **Threshold:** 30 | **Lock period:** 5 minutes Duration - Time window for the threshold. Threshold - Number of API calls allowed within the specified duration. Lock Period - Wait time before consecutive API requests.